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

Duncan Sands baldrick at free.fr
Thu Jan 12 11:42:24 PST 2012


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
> target
>> isn't going to help.
>
> I currently prepend:
>
>     target datalayout =
> "E-p:64:64:64-S0-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:6
> 4:64-v64:64:64-v128:128:128-a0:0:64"

well, for example "E" means big endian ("e" would mean little endian), so
probably this is not what you want (are you on x86?).

> Otherwise, and as I said, I am new to LLVM, but... how could the execution
> engine return a target which is different than what it is?

I guess you mean it should use the characteristics of the machine you are
running the code on by default.  Actually I thought it did nowadays (in the
bad old days it would assume sparc or something like that), but I guess I
was mistaken.  It looks like you need to say explicitly what kind of machine
you will run the code on.

Ciao, Duncan.



More information about the llvm-dev mailing list