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

Can I build a Checker using prebuilt llvm/clang?

I came across this "How to Write a Checker in 24 Hours - LLVM" by Anna Zaks and Jordan Rose. I am using an Ubuntu/Debian system. To build a custom checker, do I need to build llvm and clang from source? Anybody knows how use the prebuilt clang and…
xyz
  • 870
  • 2
  • 8
  • 16
0
votes
1 answer

Constant propagation in llvm

I was checking llvm's constant propagation pass -sccp, with the following program int a,b,c; a=1; b=2; c=a+b; I was expecting an output %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 store i32 1, i32* %a, align…
0
votes
1 answer

Internal LLVM syntax errors when following Pass tutorial using CMake

I am attempting to follow the tutorial here for developing a "Hello, World" LLVM pass - I am using the guidelines linked by that tutorial here for doing so out of the LLVM source directory. However, when I attempt to follow this tutorial, CMake…
hyperdelia
  • 1,105
  • 6
  • 26
0
votes
1 answer

Insert int variable into the class using LLVM PASS or Clang

I want to insert integer variable into all classes using LLVM PASS or Clang. How to do this ? For example.. class foo { int a; } I want to insert new value as below. class foo { int a; unsigned int b; // I want to insert this. } How…
Zzingco
  • 41
  • 5
0
votes
0 answers

Error installing llvm and clang from source in Linux

I am trying to install clang from source following the instructions as given in http://clang.llvm.org/get_started.html ( Steps 1-4 and 7) in Ubuntu 14.04 Inside the build directory , I ran make which succeeded. I wasn't sure what to do after that ,…
G Ashwin
  • 23
  • 1
  • 6
0
votes
1 answer

LLVM undefined reference to llvm::createDemoteRegisterToMemoryPass

I'm working on OLLVM (https://github.com/obfuscator-llvm/obfuscator), which is an obfuscation project based LLVM. I'm getting the error message above when trying to use reg2mem pass in my own pass. The code is as blow. struct MyPass : public…
Andy Wang
  • 38
  • 6
0
votes
1 answer

Mingw + clang vs Boost under Windows: different kind of errors

I have prepared a llvm-clang compiler targeting 32bit Windows. I used 3.7.1 and applied this patch. I get to something that almost works, apart that I have errors with boost. If I compile my project (that normally works with mingw-gcc) using my…
Antonio
  • 19,451
  • 13
  • 99
  • 197
0
votes
0 answers

How do I use an exisiting pass for analysis from my LLVM pass/ How scan my program twice?

I have two questions: Part 1. I am implementing common subexpression elimination. For that, I am planning to write two passes. First pass (CSDetectPass) will detect the common subexpressions. Second pass (CSEliminationPass) will be eliminating those…
AKA
  • 5,479
  • 4
  • 22
  • 36
0
votes
1 answer

How to demo redundancy removal in LLVM?

I want to demo that redundancy removal is used in LLVM. I found the option -gvn (global value numbering) from opt. I tested the following example: int foo(int a, int b) { int c, d, e, f, g; c = a + b; d = a + b; e = a; f = e +…
JackWM
  • 10,085
  • 22
  • 65
  • 92
0
votes
2 answers

Integrate FDLIBM library to iOS

I am trying to integrate FDLIBM library (http://www.netlib.org/fdlibm/) into my Swift based (with some objc and c code too) iOS app. However, some of functions there are conflicting with math.h which is automatically included in iOS, i.e. sin,…
Zhao
  • 904
  • 1
  • 11
  • 34
0
votes
1 answer

"Ptr must be a pointer to Val type!" error while creating a new Store Instruction

I am trying to create a new Store instruction using the following code: AllocaInst* newTemp = new AllocaInst(llvm::Type::getInt32Ty(Context), 0, 4,tVname); bb->getInstList().insert(original, newTemp); Value* dest = inst->getOperand(1); StoreInst…
AKA
  • 5,479
  • 4
  • 22
  • 36
0
votes
1 answer

p7zip_15.09 compiling failed on MAC OS X El Capitan

Operation system name: MAC OS X El Capitan Operation system version: 10.11.3 (15D21) Compiler version: Apple LLVM version 7.0.2 (clang-700.1.81) 7zip source code version: p7zip_15.09 error message: ld: internal error: atom not found in…
figofuture
  • 251
  • 3
  • 3
0
votes
1 answer

Error while installing Cilk Plus on Mac OS X (El Capitan)

I have encountered issues while installing the CilkPlus on my Mac OS X.Following the installation page, I have executed the following commands in the following order: $mkdir Cilk $cd Cilk $git clone -b cilkplus https://github.com/cilkplus/llvm…
letsBeePolite
  • 2,183
  • 1
  • 22
  • 37
0
votes
1 answer

How to get LLVM debug symbols

I've got a c++-project which uses Clang API, and I'd like to have ability to debug into clang/llvm function when I debugging my project. I built llvm+clang v3.7.0 using CMake with the following opts: -DCMAKE_INSTALL_PREFIX=$HOME/opt/llvm…
Rom098
  • 2,445
  • 4
  • 35
  • 52
0
votes
1 answer

Clang does not inline calls having pointer casts (indirect function calls)

I was trying to inline functions in llvm using this command: opt -inline -inline-threshold=1000000 a.bc -o a.inline.bc The (indirect) function calls involving pointer casts were not been able to inline. For eg. %call4 = call i32 (...)* bitcast (i32…
piXel_pRo
  • 159
  • 2
  • 14