[LLVMdev] A problem creating operands for a new IR instruction to the mailing list

John Criswell criswell at cs.uiuc.edu
Tue May 5 09:42:32 PDT 2009


seventh moon wrote:
> [snip]
>
> So to say it simply, my question is, "How can I create a new Value*, which indicates
> an immediate value, such as immediate value 5?"
>   
I don't know much about LLVM's code generators, but if all you need is
to create a Value * for an immediate constant, you might try using the
ConstantInt::get() method
(http://llvm.org/doxygen/classllvm_1_1ConstantInt.html#77cd822480bc78732c84a9619e49e14a). 
A ConstantInt is a subclass of Value, and you can use it to create
constant integer values in the LLVM IR.

-- John T.




More information about the llvm-dev mailing list