[LLVMdev] FW: How to pass an array to a function using GenericValue

Alan Garny agarny at hellix.com
Thu Jan 12 11:13:49 PST 2012


Hi Duncan,

> > 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 so you should probably add targetdata 
> to it since otherwise (IIRC) it may assume things about the target 
> that aren't true for your machine.

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 no
avail. I still get the exact same result...?!

Alan




More information about the llvm-dev mailing list