[LLVMdev] JIT'ing constant globals

Simon Burton simon at arrowtheory.com
Tue Jun 13 02:51:56 PDT 2006


On Mon, 12 Jun 2006 12:27:36 -0500 (CDT)
Chris Lattner <sabre at nondot.org> wrote:

> On Mon, 12 Jun 2006, Simon Burton wrote:
> > It seems one can only put constant global statements
> > _before_ any functions are defined, not after.
> 
> 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

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

thanks,

Simon.

> 
> > 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


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 



More information about the llvm-dev mailing list