Questions tagged [llvm-clang]

Clang is the C language family front-end for the LLVM compiler. (The C language family includes C, C++, Objective-C, and Objective-C++.)

Clang refers to the C language family front-end for the LLVM (originally known as "low level virtual machine") compiler. The C language family consists of C, C++, Objective-C, and Objective-C++.

High-level features of clang include better compile-time performance than gcc, helpful error and warning messages, and a static analyzer to automatically detect software bugs.

1101 questions
4
votes
0 answers

Getting called function from LLVM's machine instruction

Is there a way to get called function from a Machine Instruction? Right now I'm identifying if the Machine Instruction is a function call or not as below: for (MachineBasicBlock &MBB : MF) { for (MachineInstr &MI : MBB) { if…
harry
  • 970
  • 6
  • 25
4
votes
2 answers

How do I cross-compile LLVM/Clang for AArch64 on x64 host?

I want to use clang-11 on my AArch64 Raspberry Pi 4, running Ubuntu 20.04 Focal. I looked at https://apt.llvm.org/, but AArch64 prebuilt binaries do not seem available? I tried building clang on the Raspberry Pi directly, but it was very slow and I…
user7610
  • 25,267
  • 15
  • 124
  • 150
4
votes
1 answer

lldb Windows errors with clang 10

I have clang 10.0.0 for Windows installed from here I also used the community VS installer to install 3 components that I understood were needed for clang 10: C++ 2019 Redistributable Update MSVC v142 - VS 2019 C++ x64/x86 build tools…
Jay
  • 2,535
  • 3
  • 32
  • 44
4
votes
2 answers

Clang 10 fails to link C++ application with CMake on macOS 10.12

I have a Jenkins build server running macOS 10.12. I am compiling a C++ application using the latest Clang 10 (not AppleClang) with CMake 3.17. The error I get is: The C++ compiler "/Users/XXX/llvm/bin/clang++" is not able to compile a simple test…
keith
  • 5,122
  • 3
  • 21
  • 50
4
votes
2 answers

How to use runtime tracing in OpenMP LLVM?

I want to enable runtime tracing and see the output. Something like the output of KD_TRACE(10, ( buff, gtid, schedule, chunk, lb, ub, st ) ); in kmp_dispatch.cpp Refer…
Madhuparna Bhowmik
  • 2,090
  • 4
  • 12
  • 22
4
votes
1 answer

Clang: How to get the macro name used for size of a constant size array declaration

TL;DR; How to get the macro name used for size of a constant size array declaration, from a callExpr -> arg_0 -> DeclRefExpr. Detailed Problem statement: Recently I started working on a challenge which requires source to source transformation tool…
4
votes
1 answer

Clang does not generate profraw file when linking manually

I am trying out the profiling functionality of clang using llvm-cov and llvm-profdata. I have everything setup with CMake, but it doesn't generate the default.profraw as expected. I'v tried the steps manually and discovered that clang does not…
MartenBE
  • 744
  • 1
  • 5
  • 20
4
votes
2 answers

R: can't update packages clang can't find head files

I have several R packages failed to be updated/complied from the source. Followings are snippets of error messages; clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.5.2_2/lib/R/include" -DNDEBUG …
akh22
  • 661
  • 4
  • 16
4
votes
1 answer

Using MSVC with QT creator: The clangbackend process has finished unexpectedly and was restarted

I'm using Qt Creator 4.7.2 and when I try to make a project using Desktop QT 5.11.2 with MSVC2015 32 bit compiler I get a repeating message under general messages: Clang Code Model: Error: The clangbackend process has finished unexpectedly and was…
4
votes
1 answer

Cannot use "using" declaration for std::tuple on Apple LLVM 7.3.0

I'm attempting to use tuple in my program, and for some reason I am not able to simplify the call with a using declaration. For example: #include using std::tuple; ... This throws an error when attempting to compile it: error: no member…
Isaac Corbrey
  • 553
  • 3
  • 20
4
votes
1 answer

Missing libclang_rt.tsan-x86_64.a on clang-7.0

I am trying to hunt down some deadlock in multi-threaded code which uses a condition variable. Somebody advised using thread sanitizer. So I compiled LLVM from source and enabled thread sanitizer LLVM built fine, but when I try to build my project…
Dženan
  • 3,329
  • 3
  • 31
  • 44
4
votes
0 answers

Pass not working anymore : undefined symbole _ZN4llvm24DisableABIBreakingChecksE

I had a very well working LLVM pass, but it seems to not work anymore for a very mysterious reason. I have also tried to make a basic tutorial pass work following this. But it gives me the same error: error: unable to load plugin …
guillau4
  • 177
  • 9
4
votes
1 answer

Why does LLVM projects use GCC Headers

I am looking at a project that is built with Clang but it needs GCC headers. Why would a project require both Clang and GCC headers?
user1610950
  • 1,837
  • 5
  • 33
  • 49
4
votes
0 answers

Why is __attribute__((constructor)) not working in my code when using clang but works fine while using other C compilers?

When I run the following code in mingw64 compiler, it works fine and output shows three lines as expected. But when the same code is run with clang, the constructor and destructor does not work as expected and the output is only one line that is…
phoenix_sp
  • 63
  • 1
  • 7
4
votes
1 answer

Can't compile libpd with emmake (Emscripten SDK)

I'm trying to compile libpd to javascript or webassembly using emscripten sdk. According to some docs, if there is a Makefile, it can be compiled by using emmake make, (emconfigure is not used because there is no ./configure file), but I get the…
Mr_LinDowsMac
  • 2,644
  • 9
  • 56
  • 75