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
2 answers

How to uniquely identify an instruction in LLVM Pass?

So I am trying to keep a count of how many times certain call instructions are called and I am struggling with identifying the instructions uniquely. I couldn't find something as an instruction ID in the documentation. I want to get the ID and pass…
Dev2017
  • 857
  • 9
  • 31
0
votes
0 answers

Node Type info from a namedDecl() matcher

I'm writing an open-source misra-c rule checker using the clang-frontend libraries. Is there a way to get the type of a node(FieldDecl,RecordDecl,FunctionDecl,...) that I've matched with a namedDecl() matcher?
Farzad Sadeghi
  • 105
  • 2
  • 10
0
votes
1 answer

Library `Coroutines' not found in list of llvm libraries

I'm trying to setup LLVM release version 3.5 on my ubuntu 16.04 LTS 64-bit machine, and have been facing errors related to CMake. How to solve: Library `Coroutines' not found in list of llvm libraries ? I followed instructions given here, to the…
cappy0704
  • 557
  • 2
  • 9
  • 30
0
votes
1 answer

Conditional statement parsing in yacc

I am writing an llvm code generation demo for a certain language which includes if statement. Here are the rules and the actions corresponding to my question: IfStatement : IF CondExpression THEN Statement …
Rational Rose
  • 73
  • 1
  • 10
0
votes
0 answers

optimization flag '-falign-functions=8' is not supported in Clang

We have a library that heavily uses function pointer, where assumed functions are aligned 8 bytes. In GCC, there is falign-functions option to specify alignment of functions. However in Clang, falign-functions= option seems to be disabled…
furushchev
  • 2,539
  • 2
  • 10
  • 16
0
votes
0 answers

llvm toy example error

I am trying to run the make file of the toy example given here, but it gives me the following error: g++ -o parser parser.o codegen.o main.o tokens.o corefn.o native.o `llvm-config --libs` `llvm-config --ldflags` -lpthread -ldl -L/usr/bin -lz…
Rational Rose
  • 73
  • 1
  • 10
0
votes
1 answer

On Mac 10.9 Mavericks is the clang configuration different from the gcc link configuration?

I am trying to figure what the differences between "--version" output are when I check the versions of gcc/g++ and clang/clang++, which I understand should just be links to each other. Furthermore, it is unclear to me whether there is some way to…
synchronizer
  • 1,955
  • 1
  • 14
  • 37
0
votes
1 answer

How to detect a thread synchronization in a program in my LLVM pass?

I'm trying to measure how much time a program spends in its synchronized parts e.g. critical sections protected by locks (or any other form of concurrency control). I'm confused on how to do it and how to detect concurrency control methods in a…
0
votes
1 answer

Bypass C errors to generate clang debugging information

TL:DR Can you generate clang debugging information(CFGs, PDGs) when the original source file have DEPENDENCY errors from missing header files that cause compilation issues such as undeclared identifiers and unknown types? The files are…
Quentin Mayo
  • 390
  • 4
  • 11
0
votes
1 answer

How to use llvm libraries

I am working in a project that consist of some C++ teams. Each team delivers libraries and our team is integrating these libraries into a front end application. The application is cross platform, so it means that other the teams have to provide the…
user2281723
  • 519
  • 1
  • 5
  • 16
0
votes
0 answers

execute linux commands in llvm pass

Is there any way to execute linux commands in llvm pass and parse the objdump in it. For example in python we can do as follows: os.system('gcc example.c -o example') os.system('objdump -o example > parsed.txt') and parse it by using regular…
sephora
  • 21
  • 1
  • 7
0
votes
1 answer

how do you install a particular version of clang and llvm from tar?

If I want to install a particular version of llvm+clang, for instance 3.8.1 I see files like: http://llvm.org/releases/3.8.1/llvm-3.8.1.src.tar.xz http://llvm.org/releases/3.8.1/cfe-3.8.1.src.tar.xz listed here for download:…
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
0
votes
2 answers

Array Values in C loops( clang vs gcc)

I was trying to play with array initializations in a for loop in c. Here is the program I tried : #include int main(){ for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ int br[10]={0}; printf("%d\n", br[-1]); } } return…
satishdd
  • 19
  • 3
0
votes
1 answer

Executing more than one FrontendAction on a CompilerInstance in clang

I have a single cpp file of about 100 lines with the following contents. #include #include #include // The filename that will be processed (twice). static const char*…
rwols
  • 2,968
  • 2
  • 19
  • 26
0
votes
1 answer

Replacing a constant with a different value determined by the backend

Consider an architecture (namely, the Infocom Z-machine) with a large, readonly memory region (called "high memory") that is only intended to store strings (and machine code, but that doesn't pose a problem). This region can only be accessed by…