[LLVMdev] JIT'ing constant globals

Chris Lattner sabre at nondot.org
Mon Jun 12 20:06:58 PDT 2006


On Tue, 13 Jun 2006, Simon Burton wrote:
>> This is true in .ll files, but not necessary in LLVM modules.
>
> Yes, I'm generating .ll files.
> I'm using a workaround: permanently malloc some memory
> and just use that address directly in the .ll

Ok.  Note that the .ll file format wasn't really intended to be a 
streaming format like this.  One way to work around this would be to parse 
each LLVM chunk as an independent module, then use the llvm linker to 
combine it with the current module.

> Could I suggest that this fact about globals be added to
> the LangRef documentation ?

Here you go:
http://llvm.org/docs/LangRef.html#modulestructure

-chris

>>> I would like to produce eg. "hello world!" functions in a JIT.
>>> So I was hoping to use global string constants.
>>> Is there another way to do this kind of thing ?
>>
>> You should just be able to create the global.  Can you be more specific
>> what you are doing?
>>
>> -Chris
>>
>> --
>> http://nondot.org/sabre/
>> http://llvm.org/
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list