bhavani krishnan
2008-Nov-15 22:47 UTC
[LLVMdev] How do I get the result of an instruction?
Hi all, I probably have a stupid question but I could not find out so please help me out here. I can use getOperand to get the operands of an instruction. Similarly, How do I get the result of an instruction? Thanks, Bhavani
bhavani krishnan <bhavi63 at yahoo.com> writes:> I probably have a stupid question but I could not find out so please > help me out here. I can use getOperand to get the operands of an > instruction. Similarly, How do I get the result of an instruction?The result of the instruction is the instruction itself. Whenever you need to use the result of the instruction, pass the instruction as an argument. -- Oscar
bhavani krishnan
2008-Nov-15 23:58 UTC
[LLVMdev] How do I get the result of an instruction?
Thanks! How do I cast the result to a string? I basically need to store the results of some instructions in a file. Thanks, Bhavani --- On Sun, 11/16/08, John Criswell <criswell at uiuc.edu> wrote:> From: John Criswell <criswell at uiuc.edu> > Subject: Re: [LLVMdev] How do I get the result of an instruction? > To: "bhavi63 at yahoo.com" <bhavi63 at yahoo.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> > Date: Sunday, November 16, 2008, 10:55 AM > bhavani krishnan wrote: > > Hi all, > > > > I probably have a stupid question but I could not find > out so please help me out here. I can use getOperand to get > the operands of an instruction. Similarly, How do I get the > result of an instruction? > The instruction itself is its result. > > For example, if I wanted to generate code that does a > getlemeneptr instruction (GEP) and then uses the result of > the GEP as the pointer to a load instruction, I would do the > following: > > Instruction * GEP = new GetElementPtrInst (Value, ....); > Instruction * LI = new LoadInst (GEP, "name", > ...); > > -- John T. > > > Thanks, > > Bhavani > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
bhavani krishnan wrote:> Hi all, > > I probably have a stupid question but I could not find out so please help me out here. I can use getOperand to get the operands of an instruction. Similarly, How do I get the result of an instruction? >The instruction itself is its result. For example, if I wanted to generate code that does a getlemeneptr instruction (GEP) and then uses the result of the GEP as the pointer to a load instruction, I would do the following: Instruction * GEP = new GetElementPtrInst (Value, ....); Instruction * LI = new LoadInst (GEP, "name", ...); -- John T.> Thanks, > Bhavani > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Reasonably Related Threads
- [LLVMdev] How do I get the result of an instruction?
- [LLVMdev] How do I get the result of an instruction?
- [LLVMdev] Is it possible to use EE within optimization pass?
- [LLVMdev] Is it possible to use EE within optimization pass?
- [LLVMdev] Assertion `InReg && "Value not in map!"' failed