[llvm-dev] LLVM 3.8.0 - Adding new instruction to a basic block

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 4 18:20:12 PDT 2016


On Sun, Sep 4, 2016 at 1:06 PM, Simona Simona via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello,
>
> I'm trying to add a new instruction after a given instruction in a basic
> block.
> Until LLVM 3.7, I was using the following code:
>
>    BB->getInstList().insertAfter(I, new_inst);
>    [where both I and new_inst are Instruction*]
>
> In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
> iplist.
> Could anyone please tell me how I can do the same type of insertion in
> LLVM 3.8?
>

     auto InsertPt = I->getIterator();
     BB->getInstList().insert(InsertPt, new_inst);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160904/4e4e92e3/attachment.html>


More information about the llvm-dev mailing list