Questions tagged [llvm-3.0]

54 questions
1
vote
1 answer

Cast from uint8_t* to StringRef

I'm using ExecutionEngine.cpp. I want to get StringRef from found addresses by the following code: const APInt &IntVal; uint8_t *y2 = reinterpret_cast(const_cast(IntVal.getRawData())); int v2 = *reinterpret_cast
R.Omar
  • 645
  • 1
  • 6
  • 18
1
vote
2 answers

llvm - get label of br instruction

My question is simple. Given an instruction of type branch, how do I extract the label out of it? For example: br label %while.cond Should give me while.cond br label %while.end Should give me while.end br i1 %cmp1, label %if.then, label…
mikasa
  • 783
  • 1
  • 11
  • 29
1
vote
2 answers

Get filename and location from Function

I have an LLVM pass that iterates over LLVM IR code and I would like to get a directory and a filename for both the functions and basic blocks for the original code. I know that when I have an Instruction Pointer, I can easily get the information…
Quentin Mayo
  • 390
  • 4
  • 11
1
vote
0 answers

Calculate number of times each instruction could be called at run-time

I read the answer of this question How to calculate number of times each instruction could be called at run-time? I found at InstrProfiling.cpp file function called castToIncrementInst, but this function only calculate total number of instructions.…
R.Omar
  • 645
  • 1
  • 6
  • 18
1
vote
0 answers

Conversion with LLVM

I was working on some project to convert a C+ACSL language into another language by converting first into LLVM IR and then convert it into another language. I cannot tell about that because it is related to a group of some people who do not want to…
Arpit Sancheti
  • 248
  • 2
  • 12
1
vote
3 answers

How to see the changes made by llvm transformation passes

How to see the changes made by transformation passes(like dead code elimination) in the c program.Like if I run following command on terminal it create a .bc file by which I can see the IR. But how to see the changes made by -dce in c…
user2167322
  • 139
  • 1
  • 1
  • 8
1
vote
1 answer

Error in CloneFunctioninto() LLVM

I'm trying to copy the CFG in function into a new function to do some operations with old one. I used CloneFunctionInto by the following code std::vector ArgTypes; ValueToValueMapTy VMap; FunctionType *FTy =…
R.Omar
  • 645
  • 1
  • 6
  • 18
1
vote
1 answer

How to build llvm packaged in Android Sources?

I'm trying to build llvm that is packaged in android sources. I'm running ubuntu 12.04, with android src version 4.0.4 The llvm is located in android-src/external/llvm/ I did the following to build: ./configure make And the following error message…
wangyif2
  • 2,843
  • 2
  • 24
  • 29
1
vote
1 answer

LLVM : inject debugging lines in C++ source code

I have downloaded LLVM 3.1 and build it successfully. My requirement is to add some few debugging lines in a C++ source code files. I have coded module using CLANG 3.1. But CLANG reports a lot of AST error which gcc does not. Note my code compiles…
Programmer
  • 8,303
  • 23
  • 78
  • 162
0
votes
1 answer

llvm: strategies to build JIT content incrementally

I want my language backend to build functions and types incrementally but don't pollute the main module and context when functions and types fail to build successfully (due to problems with the user input). I ask an earlier question regarding…
lurscher
  • 25,930
  • 29
  • 122
  • 185
0
votes
1 answer

llvm: is it possible to merge validation and compilation in a single stage?

Generally speaking, when writing a llvm frontend, one will take an AST and first check that its semantics is well-defined. After this, one will take the AST and perform the IR build phase. I was wondering, how realistic is to perform directly the IR…
lurscher
  • 25,930
  • 29
  • 122
  • 185
0
votes
1 answer

Compilation errors while trying to link LLVM library

I am trying to use some LLVM API in my C++ code, and I end up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for the compile. It is the CreateGlobalStringPtr which is throwing the error. This is LLVM 3.0. Here's the code:…
Fanatic23
  • 3,378
  • 2
  • 28
  • 51
0
votes
2 answers

memset 'CortexA8' issue under iOS5

Since iOS5 hit the streets I have begun I have been receiving many (so many) crash reports like: ... Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x0 Crashed Thread: 0 Thread 0 Crashed: 0 libsystem_c.dylib 0x35ec4b3c…
Jaysen Marais
  • 3,956
  • 28
  • 44
0
votes
1 answer

Error building haskell llvm bindings on Linux

I built llvm 3.0, downloaded from here. I did: ./configure CC=gcc CXX=g++ --enable-shared sudo make -j5 -s install Next, I cloned the LLVM bindings from here. I am trying: runhaskell Setup configure But I get: Configuring…
aelguindy
  • 3,703
  • 24
  • 31
0
votes
0 answers

How can we get the program counter address using LLVM compiler?

I am trying to write an LLVM pass which would pass the program counter as an argument. However, I am not sure as to which command or how exactly one can get the program counter address using the llvm classes.