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

LLVM - convert const void * to LLVMValRef

I need to cast const void * to LLVMValRef ,like this const void * context; args[0] = LLVMCastPtrToBoolType((void *) context); I get the following warning. warning: cast from type ‘const void*’ to type ‘void*’ casts away qualifiers
Pradeep
  • 23
  • 8
0
votes
1 answer

llvm clang installation fails

I am on CentOS 7. I used SVN to download the sources. Clang version is 4.0 and LLVM is 3.9.0 After I run the "make" command, the "make install" gives the following error: -- Up-to-date: /usr/local/lib/libclangSerialization.a -- Up-to-date:…
Dr. Ehsan Ali
  • 4,735
  • 4
  • 23
  • 37
0
votes
1 answer

Is Clang-3.3 not available for Sierra and future releases?

I have tried to upgrade my macports after upgrading my iMac to Sierra. When Clang-3.3 was encountered, port upgrade gave the message: llvm-3.3 is not supported on macOS Sierra or newer and stopped further upgrade process. Had Macports stopped…
Seshadri R
  • 1,192
  • 14
  • 24
0
votes
1 answer

Backtrack operations and operands in LLVM

I'm working towards analyzing the used instructions. Given I have found an instruction of interest, I want to backtrack all the used operations and variables. Given for example the following loop in LLVM IR. %i.01 = phi i32 [ 0, %0 ], [ %4, %2 ] %3…
John T.
  • 1
  • 3
0
votes
0 answers

clang-tidy 4.0 clang-analyzer-alpha.unix.PthreadLock check

Even after I thought that this check was missing, I am now suddenly getting the output of clang-analyzer-alpha.unix.PthreadLock check from the clang-tidy 4.0 tool. Here is a toned down use case of my code which I am trying to modernize by using…
Recker
  • 1,915
  • 25
  • 55
0
votes
1 answer

clang-analyzer-alpha.unix.PthreadLock check missing from clang-tidy version 3.8 and 4.0?

I am trying to modernize my module's C++ source code using clang-tidy. A few weeks ago, I downloaded and built clang and clang tools version 3.9 and when I ran it on one of my cpp files I got clang-analyzer-alpha.unix.PthreadLock saying that lock…
Recker
  • 1,915
  • 25
  • 55
0
votes
1 answer

Clang-3.8 undefined reference to `main' when compiling object file from llvm bytecode with global variables

I'm trying to implement nested functions in llvm through the C++ API. After i perform a semantic check (to assure that the program which is going to be compiled has correct nesting references etc) i define all function in the same scope in llvm and…
ysig
  • 447
  • 4
  • 18
0
votes
1 answer

Entry Point for CFI implementation in clang/llvm?

I want to implement Control-Flow Integrity in Clang/llvm. (I know there is Forward-Edge CFI already implemented) My problem is, that I have never implemented anything for a compiler (I am new to compiler based approaches) and therefore don't know…
0
votes
1 answer

How to run LibTool?

Currently I have tested my tool with clang-llvm installed on the machine I'm developing it on. All I have to do is go into build/bin to run my tool. However, I now want to try running this tool on another machine. What should I be doing here to run…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

Skipping statements inside an IfStatements

I have created an if(isa(s)) and if(isa(s)) which prints something if found. I have created this simple c++ codes which contains return statement inside an if statement #include int main(int argc, char** argv) { int…
HiWorld
  • 31
  • 7
0
votes
1 answer

about LLVM IR: No function definition in LLVM ir code

I am looking at a llvm ir file converted from a cpp file by clang. But I found there were several functions in llvm ir file only with declaration without definition. And all these functions are not the "build-in" functions like: declare i32…
He Yucheng
  • 31
  • 3
0
votes
1 answer

How to debug Clang static-linked libraries in VS2015

I'm investigating the Clang codebase with VS2015, and the .sln file is generated by CMake. I've configured the solution to Debug/x64, and I can see the generated .pdb files accompanying with the libs, but I can't break on the lib code that linked to…
0
votes
1 answer

Is there anyway to switch the functions using clang libtooling?

EDITED: Me and my colleague are very new to clang and llvm . I have three functions.. function 1{} function 2{} function 3{} Is there anyway to swap the functions to function 3{} function 2{} function 1{} using clang libtooling / rewriter and…
HiWorld
  • 31
  • 7
0
votes
0 answers

Clang AST - convert pointer to reference? [C++]

I'm trying to store my methodDecl nodes in a map within RecursiveASTVisitor std::map ObjCMethodsMap; Currently I'm storing it like this virtual bool HandleTopLevelDecl (DeclGroupRef DG) { for (DeclGroupRef::iterator…
Jeremy Kuah
  • 519
  • 1
  • 6
  • 18
0
votes
1 answer

AST visitor function call expression not recognizes correctly the function call

Hello I have implemented an AST visitor which is working quite good and it can print in the console the information I want from the AST such as variable declarations, function declarations and function calls. Today while I was experimenting I came…
Andreas Geo
  • 365
  • 2
  • 15