[llvm-dev] InstList insert depreciated?
Shehbaz Jaffer via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 25 07:12:47 PDT 2016
Jon,
> You want:
> TaintVar->insertAfter(FirstI);
This worked! Thank you.
On Thu, Aug 25, 2016 at 9:38 AM, Jonathan Roelofs
<jonathan at codesourcery.com> wrote:
>
>
> On 8/25/16 7:01 AM, Shehbaz Jaffer via llvm-dev wrote:
>>
>> I tried an alternative way of adding instruction by first getting the
>> first instruction of the basic block, and then calling insertAfter()
>> on it as follows:
>>
>> auto &B = F->getEntryBlock();
>> auto &IList = B.getInstList();
>> auto &FirstI = *IList.begin();
>> auto TaintVar = new AllocaInst(IntPtrTy);
>> // IList.insert(FirstI, TaintVar); // OLD
>> FirstI.insertAfter(TaintVar); // NEW
>
>
> You want:
>
> TaintVar->insertAfter(FirstI);
>
>
> Jon
>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded
--
Shehbaz Jaffer
First Year Graduate Student
Sir Edward S Rogers Sr Department of Electrical and Computer Engineering
University of Toronto
More information about the llvm-dev
mailing list