[LLVMdev] Inserting Instructions After Instructions

Chris Lattner sabre at nondot.org
Wed Dec 5 14:58:51 PST 2007


On Wed, 5 Dec 2007, John Criswell wrote:
> Given a pointer to an instruction, what is the easiest way to insert one
> or more new instructions after that instructions?  We used to find the
> next instruction using Instruction::getNext(), but this method seems to
> have been made private now.

The best way is to use the LLVMBuilder interface to construct the 
instructions, which is more uniform and easier to use than 'new 
fooinst(...)'.  Examples of use are here:
http://llvm.org/docs/tutorial/LangImpl3.html

-Chris

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



More information about the llvm-dev mailing list