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

How to install clang on ubuntu14.04

I want to learn llvm so I have to install clang in my ubuntu 14.04,but I encounter some problems.Here it is: when I execute command:sudo apt-get install clang-3.5 I just get some error message like follow: Reading package lists... Done Building…
aolphn
  • 2,950
  • 2
  • 21
  • 30
0
votes
0 answers

lli -force-interpreter Error

When I try to run this command lli -force-interpreter file.ll I have this error LLVM ERROR: Tried to execute an unknown external function: posix_memalign Also, when I search for this error I found this link How could I solve this problem?
R.Omar
  • 645
  • 1
  • 6
  • 18
0
votes
1 answer

Is it possible LibTooling doesn't change headers?

I have an LibTooling (TimeFlag), which is used to add an flag for every forstmt/whilestmt. And I use ./TimeFlag lalala.cpp -- to insert flags in lalala.cpp Unfortunately, this tool also will change the headers, even system library. So is there some…
Aries_Liu
  • 95
  • 1
  • 10
0
votes
1 answer

How to uninstall libc++ after installing from source?

I installed libc++ from source using following script. The make uninstall is not supported. What would be the best way to uninstall it? git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source git clone --depth=1…
Shital Shah
  • 63,284
  • 17
  • 238
  • 185
0
votes
1 answer

call graph(.dot) generated by clang libtooling has no node labels

I'm a beginner of clang libtooling. I'm trying to use clang::CallGraph viewGraph to generate a .dot file of my call graph. here is the code: clang::CallGraph mCG; for (unsigned i = 0 ; i < DeclsSize ; ++i) { clang::FunctionDecl *FnDecl =…
ignorer
  • 327
  • 1
  • 11
0
votes
1 answer

Clang Libtool behavior different based on the location of the generated binary

I have created a very simple Clang Libtool based program which builds an AST and dumps the AST to the console. I'm compiling/linking my program which is present outside the LLVM/Clang source tree against one of the pre-built binaries from…
Hari Reddy
  • 3,808
  • 4
  • 33
  • 42
0
votes
1 answer

How to exculde build-in / system function during function analysis by clang libtooling

I'm trying to analyze functions by using clang libtooling. Here is the source code that I want to analyze: #include int main(){ int a = 100; printf("a==%d", a); } when I run my tool to get all the function decl in above files, I…
ignorer
  • 327
  • 1
  • 11
0
votes
0 answers

Macports LLVM-3.9 installation

I'm trying to install clang and llvm as they are dependencies of PySide2. Using macports, I have installed llvm and clang and port installed indicates they are active. The following ports are currently installed: bzip2 @1.0.6_0 (active) cctools…
stagermane
  • 1,003
  • 2
  • 12
  • 29
0
votes
1 answer

Clang IfStmt with shortcut binary operator in condition

I am trying to detect if there is a function call inside an if statement as part of condition; like following: if (cmp(a, b)){ \\do something } I have found I could do this with AST matcher in following…
0
votes
1 answer

How to get metadata without -g

I'm trying to write a LLVM function pass to do some instrumentation. Therefore, I I need to get filename in which the function is declared the line numbers (begin and end) of the source file in which the function is decalred. I already found and…
Neutrino
  • 35
  • 6
0
votes
0 answers

ARM Hard Float ABI Removal

It seems that the "hard float" options of the NDK have been removed from the latest version of the Android NDK The page lists three reasons for the removal People often use it because they think it's required to get floating point instructions,…
John Joseph
  • 115
  • 2
  • 6
0
votes
0 answers

Clang Source to Source Transformation

I am working on some Clang source-to-source transformation. I am doing it from Clang source code: clang/tools/extra. What I do is that I am adding a printf("Hello World\n"); at the beginning of the main method. It works perfectly, I run my tool as…
0
votes
1 answer

C Seemingly Trivial Optimization Not Done

A program that I'm writing contained 10 global function pointers. I then decided to put them in a struct to see if that would change the machine code generated after calling two of the functions. I was surprised to see that the version of the code…
Cpp plus 1
  • 990
  • 8
  • 25
0
votes
0 answers

bash: /usr/local/bin/lli: cannot execute binary file: Exec format error

I'm trying to use lli file.ll but this error appeared bash: /usr/local/bin/lli: cannot execute binary file: Exec format error What could be the problem?
R.Omar
  • 645
  • 1
  • 6
  • 18
0
votes
2 answers

How to get which pointer points to a specific object in c/c++?

I want to know which pointers point to a specific object at runtime in c/c++. For example, I have an object A, now I want to do something for A, such as changing the memory address of A, at this moment I have to know there are how many pointer…
Aries_Liu
  • 95
  • 1
  • 10