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
0
votes
1 answer

What version clang is in Xcode 3?

How do I figure which version of clang that Xcode use? It's 1.5 in Xcode, yet the official llvm-clang is 2.7. Are they the same?
Trung Lê
  • 5,188
  • 5
  • 27
  • 26
0
votes
0 answers

CLang Python bindings: parse if statement node

I want to parse if (email.find ("@")! = String :: npos) {cout << "Correct"; } hild nodes get so node.getchildren () BUT CLang not find if statement node, because in the condition there email.find ("@")! = String :: npos Now this statement if…
0
votes
1 answer

What is the purpose of the intrinsic cvta_shared_yes, cvta_shared_yes_64, cvta_to_shared_yes_64 etc in llvm

In the LLVM source code folder we can see the intrinsic cvta_shared_yes, cvta_shared_yes_64, cvta_to_shared_yes_64 similarly for other memory types like global, local, constant etc. What is the purpose of this. Is it defining the behavior of memory…
Ginu Jacob
  • 1,588
  • 2
  • 19
  • 35
0
votes
1 answer

Parsing of CUDA keyword __shared__ by Clang/CUDA

Since its possible to use Clang for CUDA compilation, I am interested in studying about the cuda code (.cu file) conversion by the clang to intermediate representation (IR). The CUDA compilation by Clang require certain CUDA libraries. So is the…
Ginu Jacob
  • 1,588
  • 2
  • 19
  • 35
0
votes
1 answer

XCode Clang; how to pass custom arguments

Since Xcode 5, it seems that Apple considers all unknown arguments to clang as errors (info). I wrote some LLVM passes which take some custom arguments. I can't pass them however because of this. Does anyone know if there is a workaround / official…
dzan
  • 425
  • 3
  • 14
0
votes
1 answer

The structure of a branch instruction

I am currently building a static analyzer for 'llvm-ir' and working on branch instructions. The 'condition' of a branch instruction seems to be either a result of a compare instruction, or a result of some logical operations of a compare…
izazu
  • 87
  • 9
0
votes
1 answer

Parsing AST generated by clang with clang Python bindings

I have a header file for which I want to generate an AST and save it to a file. I run clang-cl on Visual Studio command line like this: clang-cl -Xclang -ast-dump -fsyntax-only -fno-color-diagnostics -w I then take the output of this…
Daniel Kats
  • 5,141
  • 15
  • 65
  • 102
0
votes
2 answers

clang - build with default flags

I want to use clang for cross compiling. I've found out that it seems very easy, I can specify architectures/includes etc. just as I invoke clang directly. However, I don't want to keep passing those flags, I'd rather compile clang so that it…
Vanilla Face
  • 908
  • 1
  • 7
  • 17
0
votes
2 answers

Hard to make clang+lldb work on centos7

I yum install clang, llvm-devel and lldb 3.4.2 on centos7. In order to add libc++ and libc++abi, I followed the guide in How to Build libcxx and libcxxabi by clang on CentOS 7. I only build libc++ without libc++abi and build libc++abi with libc++,…
ztao1987
  • 71
  • 7
0
votes
1 answer

what are the args that are being passed from clang to llc?

I am working on the llvm project. Recently I tryed to compiler one of my .c files using clang command line into an .s file by using the next command: clang --target=arch -S -O0 select.c -o select.s and it crashed in the backend in the function…
yehudahs
  • 2,488
  • 8
  • 34
  • 54
0
votes
2 answers

Can clang produce an AST dump and a binary in the same run

If I'm trying to do some offline processing of the AST of a project, is there any way for LLVM to produce AST files alongside the object files it produces during a build? As it stands it seems like there would have to be a second run to get the AST,…
ultramiraculous
  • 1,062
  • 14
  • 21
0
votes
1 answer

using loop in GNU makefile

Can anyone help me figure out why am I not be bale to pass different versions of .ll files to LLVM_OPT here? Is there a way in makefile to extract each basename of those $(SRC) to pass to opt? So the scenario is compiling *.c with clang and then…
Amir
  • 1,348
  • 3
  • 21
  • 44
0
votes
0 answers

LLVM/Clang: Reducing a compound statement to a subset

I have a compound statement representing the following block of code { int a = 3; foo(a); a = 4; foo(a); a = 5; } I want to create another compound statement which contains the first 2 statements of the…
Ruup
  • 177
  • 2
  • 8
0
votes
2 answers

Writing Clang AST Matchers

Is it possible to use the bind string on one expression in the other like the following code: expr(declRefExpr().bind("id"), hasDesendent(declRefExpr(has("id"))); Basically to use bind id string of one node to find the other node.
G Gill
  • 1,087
  • 1
  • 12
  • 24
0
votes
1 answer

Ensure that register is pushed to the stack at function entry

Typically, a C function is translated by clang for an ARM architecture in a way such that the LR register is pushed on the stack. However, if the function does not contain any function calls itself, LR is not pushed, i.e. the compiler assumes that…