Questions tagged [clang]
For questions about the clang LLVM compiler front end. For general questions about C, use the C tag.
clang
10,507
questions
1
vote
0
answers
6
views
Different basicblocks share the same object ID in LLVM
I use the following code to print the basicblocks in my LLVM module's object ID. To my surprise, different basicblocks share the same object ID, how could that be possible?
I got
foo
Block ID: ...
0
votes
0
answers
3
views
Can't build pkgconfig on macOS: incompatible integer to pointer conversion
I am trying to build pkgconfig 0.29 on macOS, using clang. I get these errors:
gatomic.c:392:10: error: incompatible integer to pointer conversion passing 'gssize' (aka 'long') to parameter of type '...
-5
votes
0
answers
38
views
VSCode C++ ld: symbol(s) not found for architecture arm64 problem in Mac [closed]
I have issue about the vscode with c++ when i run the single file like hello world its working good but gives this error when the header file and other files are included in the include event
When ı ...
-2
votes
2
answers
56
views
Call file-private function before its definition without manual declaration [duplicate]
For code modularity I like to subdivide long functions into a few smaller ones like so
void main_function() {
step_1();
step_2();
}
static inline void step_1() {
// code
}
static inline ...
0
votes
0
answers
23
views
Compiling CUDA programs with clang takes over an hour [closed]
I am using clang-18 to compile CUDA programs, and the compilation process does not report any errors, but it takes a very long time (even over an hour).
The program can be compiled very quickly using ...
-2
votes
0
answers
23
views
Swig CLang C++ Libraries Exceptions Crash Our Android App [closed]
Our android app have business layer which developed by c++ and deployed with swig clang and ndk23 to so libraries. Before ndk23 we have use gnu compiler and ndk15 and it works without problem if we ...
-1
votes
0
answers
18
views
cython (cglan) hangs on m3 macOS Sonoma x86_64
I have a python program that I've been working with for years and building on a macOS Catalina (x86) machine. The python code is Cythonized for speed and some code security (obfuscation). This has ...
0
votes
1
answer
21
views
Does LLVM iterate over blocks in a fixed order?
I am using LLVM to iterator basic blocks by
for (const Function &F : *M)
for (const BasicBlock &BB : F)
for (const Instruction &I : BB){
......
}
I want to know:
...
-1
votes
0
answers
41
views
Based on `Microsoft` style, how does clang-format automatically delete the blank line before the left brace? [closed]
How to automatically delete the empty line before the left brace? I always manully delete this empty line.
How to automatically delete thit line?
How to automatically delete thit line?
Here is my ....
1
vote
1
answer
73
views
Why do I get a "for declaration does not refer into a class, class template or class template partial specialization" on Clang and not GCC [duplicate]
I currently have this block of code which does not throw a compiler error on GCC, but throws this compiler error on clang:
error: nested name specifier 'MyEnum::' for declaration does not refer into ...
1
vote
0
answers
65
views
Why is Clang rejecting this coroutine code?
Here's the code:
#include <generator>
std::generator<int> foo() {
int i{};
while (true) {
co_yield i++;
}
}
Clang 18.1.8 rejects it with
/usr/bin/../lib64/gcc/x86_64-...
0
votes
0
answers
18
views
LLVM DAG Pattern Instruction Selection Fails after introducing a new intrinsic
I am currently expanding a RISC-V core with a custom load instruction. For this question, the specifics are unimportant. It functionally behaves like a normal load instruction and should use the same ...
-1
votes
0
answers
45
views
why my LLDB Debugger is not working even though everythign is correct
I'm a simply a DSA solving student. and since Clion hog lots of RAM. I shifted to VSCode and I'm more intrested in Clang instead of gcc or g++ due to its fast compilation and better diagonstic ability ...
-2
votes
0
answers
73
views
What does MSVC-like command line mean when using Clang compiler on Windows?
So I have installed the Clang tools on Visual Studio on Windows, and this lets me use the Clang compiler in Visual Studio. In my CMake I set the toolchain argument to 'ClangCL' and it sets it up ...
0
votes
0
answers
34
views
How to cross compile Clang/LLVM to musl with cmake?
I've been trying to build Clang/LLVM for a different C standard library, namely musl. If I build Clang for my host system (x86_64 Linux, glibc), I can build a binary written in C for musl by passing --...