Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
26 views

Standard library not detected in my custom Clang Tool

I have the following code (Want to Develop a CXX refactoring tool) using namespace clang; int main(int argc, const char **argv) { static llvm::cl::OptionCategory KsaiToolOptions("my_tool ...
Darshan Koirala's user avatar
0 votes
0 answers
22 views

Break basic blocks in llvm over function calls

I have a C function that invokes bar() void foo(int x) { bar(x); bar(x + 1); } Its LLVM IR looks like define dso_local void @foo(i32 noundef %0) #0 { entry: %2 = alloca i32, align 4 ...
zell's user avatar
  • 10k
0 votes
0 answers
32 views

Address Sanitizer do not show nothing and lsan_is_turned_off

I'm trying to use address sanitizer in my main.cpp on Windows. Makefile: default: clang++ main.cpp -o app.exe -fsanitize=address -g set ASAN_OPTIONS=detect_leaks=1 ./app.exe main.cpp #...
BaraNot's user avatar
0 votes
1 answer
25 views

LLVM linker does not work on MacOS while trying to develop on-chain Solana app (C++)

this is the error i get: ./account_logger.so () dyld[61282]: Library not loaded: @rpath/libLLVM.dylib Referenced from: <A9E4BE2A-BF8D-3956-BCA9-E3BC5A6C9F9C> /Users/myusername/.local/share/...
Tiron Raul's user avatar
0 votes
1 answer
27 views

Finding the dominating definition location from a use location using llvm

I am trying to find the defining locations that can reach a use location in llvm. For example, I have a CFG that looks like a (def) / \ b c (def) \ / d (use) So, both instructions a and c ...
heturing's user avatar
  • 151
4 votes
1 answer
156 views

std::optional<std::unique_ptr<int>> is not constexpr?

Why is the following method not constexpr? constexpr std::optional<std::unique_ptr<int>> test2(void) { return std::nullopt; } Clang gives me the following error: [build] /.../<>....
user avatar
0 votes
0 answers
29 views

LLVM invalid cast opcode for cast from 'i64' to 'i64'

I'm trying to use LLVM Create and replaceAllUsesWith to modify the (A+B+C) calculation to (A*B)-C The ReplaceInst.cpp code I wrote is this, // Traverse Instructions in TheModule void TraverseModule(...
ummmsso's user avatar
  • 13
0 votes
1 answer
89 views

Can clang-format arrange each function entirely on one line?

I'd like to format a set of C++ files so that each function or function template is defined entirely on one line. With input such as: template <typename T> void foo(int i) { return; } ...
user2023370's user avatar
  • 10.9k
-2 votes
1 answer
132 views

What is the Microsoft goto extension? [closed]

I am writing a C++ generator, that needs to use the goto statement. I am compiling my code with clang++ and get the warning [-Wmicrosoft-goto] on some of my gotos. All of my gotos only jump around ...
Peter's user avatar
  • 105
0 votes
0 answers
74 views

Is it possible to webassembly a C++ Windows application using emscripten:

I have a complex windows application that uses MFC and some OpenGL. I'd like to use Webassembly https://github.com/emscripten-core/emscripten to use emscripten to convert the c++ application to web. ...
felipe's user avatar
  • 1,226
0 votes
1 answer
84 views

llvm/IR/Attributes.inc: No such file or directory when write toy compiler using LLVM

I want to use flex bison and llvm to generate IR,in my project, I use Clion as ide, and I correctly include all the header files that llvm needs. cmake_minimum_required(VERSION 3.28) project(Compiler)...
陈那几's user avatar
-1 votes
1 answer
39 views

llvm-cov ignore file regex does not work on windows

I have a large c++ Project which contains serveral shared objects using cmake. I am using gtest and gmock for unit tests and in addition I am using a code coverage extension from here https://github....
MarkaRagnos0815's user avatar
0 votes
0 answers
39 views

Obtain LLVM IR after linking with C++ STD library?

I am trying to analyse instruction count of a C++ program using LLVM passes. Issue is the when i use function from standard library like sqrt() from cmath, the LLVM IR does not contain the ...
tapas1994's user avatar
2 votes
2 answers
60 views

Using libclang, is there a way to know if a closure type was introduced in the context of the initialization of a inline variable?

Given the following C++ code: inline auto v = []{ return 1; }(); The context of the closure type is the initializer of an inline variable. This leads to a special mangling rule in the Itanium ABI (...
Dorian's user avatar
  • 552
0 votes
0 answers
38 views

Allocating complex data (btVector3) on the stack in LLVM IR

I want to use LLVM to JIT compile some code in my game using the LLVM C/C++ API. The JIT compiled functions should be able to effect the physics of the world, which is handled by bullet3. To do so I ...
Lessthan314's user avatar

15 30 50 per page
1
2 3 4 5
116