[LLVMdev] Re: global variable

Chris Lattner sabre at nondot.org
Tue Jun 6 13:15:13 PDT 2006


On Tue, 6 Jun 2006, Lan Bai wrote:

> Hi Chris, I want to use some new call inst to initialize some new global 
> variables at runtime (assign the return value of the call inst to the global 
> variable).
>
> Now I have successfully inserted the new global variables to the global list, 
> and inserted the new call instructions to the instruction list. But I don't 
> know how to associate them together. For example, I have
>
> GlobalVariable *Gv = new GlobalVariable(...);
> Instruction *NCall = new CallInst(...); 
> How do I assign the value of NCall to Gv?

You probably want to pass Gv in as an argument to the call?  I don't know 
what you're trying to do, so I can't help without more details.

-Chris

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



More information about the llvm-dev mailing list