[LLVMdev] ICmpInst example?
joe.abbey at gmail.com
Wed Sep 28 07:35:30 PDT 2011
Perhaps try j->back();
Sent from my iPad
On Sep 27, 2011, at 11:00 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Tue, Sep 27, 2011 at 7:28 PM, ret val <retval386 at gmail.com> wrote:
>> I'm trying to come up with a simple example of using ICmpInst in a
>> Pass. On each of the branches(true, false) I'd like to call a separate
>> function and then resume(to the code that was already there).
>> In this example i is a inst_iterator to Instruction the Pass is
>> currently on. Now it segfaults opt before I can even get a dump() on
>> it. Does anyone see what I am doing wrong?
>> BasicBlock *bb = i->getParent();
>> Instruction *j = bb->end();
> Your initialization of "j" isn't valid: bb->end() doesn't point at an
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev