Displaying 2 results from an estimated 2 matches for "bb_after".
2011 Oct 12
2
[LLVMdev] insert ICmpInst/BranchIns in Pass?
...ructions, but for some reason this
seems to ruin the iterator(i). What is the correct way todo something
like this?
void checkShadowPtr(Module &M, Function &F, inst_iterator i,
GlobalVariable *shadow, Value *val) {
/* Split old Block */
BasicBlock *bb = i->getParent();
BasicBlock *bb_after = i->getParent()->splitBasicBlock(&*i);
bb->getTerminator()->eraseFromParent();
/* Test */
ICmpInst *test = new ICmpInst(*bb, CmpInst::ICMP_NE, shadow, val,
"Shadow check");
/* Fail */
BasicBlock *trueBlock = BasicBlock::Create(M.getContext(), "Shadow...
2011 Sep 28
3
[LLVMdev] ICmpInst example?
...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();
BasicBlock *bb_after = i->getParent()->splitBasicBlock(&*i);
bb->getTerminator()->eraseFromParent();
ICmpInst *test = new ICmpInst(j, CmpInst::ICMP_EQ, shadow, val,
"Shadow check");
BasicBlock *trueBlock = BasicBlock::Create(M.getContext(), "Shadow
Check Block: TRUE", &...