[LLVMdev] Inserting Instructions After Instructions

John Criswell criswell at cs.uiuc.edu
Wed Dec 5 13:30:34 PST 2007


Tanya M. Lattner 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.
>>     
>
> 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
>   
Thanks!  That looks like it'll fit in well with the pre-existing code
I'm working on.

-- John T.

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