search for: getstringrepresentation

Displaying 11 results from an estimated 11 matches for "getstringrepresentation".

2016 Sep 14
4
setDataLayout segfault
...lowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions( targetOptions ); TargetMachine *targetMachine = engineBuilder.selectTarget(); assert(targetMachine && "failed to create target machine"); std::cout << targetMachine->createDataLayout().getStringRepresentation() << "\n"; Mod.get()->setDataLayout( targetMachine->createDataLayout().getStringRepresentation() ); // this segfaults Mod.get()->setDataLayout( targetMachine->createDataLayout() ); // as well as this } Backtrace: Using host libthread_db library "/lib/...
2016 Sep 14
2
setDataLayout segfault
...setTargetOptions( targetOptions ); >> >> TargetMachine *targetMachine = engineBuilder.selectTarget(); >> >> assert(targetMachine && "failed to create target machine"); >> >> std::cout << >> targetMachine->createDataLayout().getStringRepresentation() << "\n"; >> >> Mod.get()->setDataLayout( >> targetMachine->createDataLayout().getStringRepresentation() ); // >> this segfaults >> Mod.get()->setDataLayout( targetMachine->createDataLayout() ); // >> as well as this >>...
2012 Jan 12
4
[LLVMdev] How to pass an array to a function using GenericValue
Hi, My application generates some LLVM assembly code which I then convert to IR code using ParseAssemblyString. If I have the following LLVM assembly code: define double @test() { ret double 1.230000e+02 } then, using ExecutionEngine::runFunction, I get a GenericValue return value which DoubleVal property is indeed equal to 123. So, all is fine there. However, if I have the
2012 Jan 12
1
[LLVMdev] How to pass an array to a function using GenericValue
> > Yes, it was the entire LLVM assembly code that I generated. However, I > > have now prepended targetdata to the code I generate (using > > executionEngine->getTargetData()->getStringRepresentation()), but to > > executionEngine->no > > avail. I still get the exact same result...?! > > What is the string you prepended? If the execution engine thinks the target is > different to what it is then prepending the execution engine's notion of target > isn't goin...
2012 May 28
2
[LLVMdev] Help with Values sign
On May 27, 2012, at 9:15 PM, Santos Merino wrote: > I have found that the problem is the endianness of Values. For example a 1 it's > stored as 00000001 00000000 00000000 0000000 instead of 0000000 00000000 0000000 > 00000000 so how can I change how the values are stored and/or load (because I > suppose that the problem is when I store it or load from memory) Are you setting up
2012 May 28
0
[LLVMdev] Help with Values sign
In my main function after generate the code and before start the execution via JIT I do this: ExecutionEngine *EE = EngineBuilder(M).create(); string str = EE->getTargetData()->getStringRepresentation(); str[0] = 'e'; M->setDataLayout(str); if (verifyModule(*M)) { errs() << argv[0] << ": Error building the function!\n"; return 1; } vector<GenericValue> noargs; GenericValue GV = EE->runFunction(Main, noargs); o...
2012 May 28
1
[LLVMdev] Help with Values sign
...2012 10:13, Santos Merino <santitox at hotmail.es> wrote: > In my main function after generate the code and before start the execution > via > JIT I do this: > > ExecutionEngine *EE = EngineBuilder(M).create(); > string str = > EE->getTargetData()->getStringRepresentation(); > str[0] = 'e'; > M->setDataLayout(str); > > if (verifyModule(*M)) { > errs() << argv[0] << ": Error building the function!\n"; > return 1; > } > > vector<GenericValue> noargs; > GenericValue GV =...
2012 Jan 12
0
[LLVMdev] How to pass an array to a function using GenericValue
Hi Alan, On 12/01/12 20:19, Alan Garny wrote: >>> Yes, it was the entire LLVM assembly code that I generated. However, I >>> have now prepended targetdata to the code I generate (using >>> executionEngine->getTargetData()->getStringRepresentation()), but to >>> executionEngine->no >>> avail. I still get the exact same result...?! >> >> What is the string you prepended? If the execution engine thinks the > target is >> different to what it is then prepending the execution engine's notion of >...
2010 Jan 18
1
[LLVMdev] Finding the host datalayout
Hello all, As we work the last few bugs out of our project for the last release, we need to find a way to set the default datalayout of the LLVM Assembly file we are generating to be that of the host machine. I've seen options for target triples in the Doxygen but not the datalayout. BTW, we're using version 2.6 of LLVM. --Sam
2012 Jan 12
0
[LLVMdev] How to pass an array to a function using GenericValue
Hi Alan, > if I have the following LLVM assembly code: > > define void @test(double* %data) { > > %1 = getelementptr inbounds double* %data, i64 1 > > store double 1.230000e+02, double* %1, align 8 > > %2 = getelementptr inbounds double* %data, i64 3 > > store double 1.230000e+02, double* %2, align 8 > > ret void > > } is this the entire LLVM IR? If
2016 Sep 19
3
llvm interpreter does not find function defined by addGlobalMapping
Hi, I want to use a function defined in c(++)-code from code generated by llvm. For this I use ExecutionEngine.addGlobalMapping(). I started with the JIT execution engine and everything worked, then I switched to the interpreter engine and it stopped working, but only if compiled on a Linux system. More precisely it works if I use llvm 3.8.1 + gcc (Linux) + JIT llvm 3.8.0 + mingw-gcc