[LLVMdev] Inserting Instructions After Instructions

Tanya M. Lattner tonic at nondot.org
Wed Dec 5 14:58:55 PST 2007


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

LLVM Builder is the easiest way to create/insert instructions.

Or you turn the instruction pointer to an iterator and advance:
http://llvm.org/docs/ProgrammersManual.html#iterate_convert

-Tanya


>
> -- John T.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list