//
if (!AliveBlocks.count(&Func->front())) {
BasicBlock *NewEntry = new BasicBlock();
- new BranchInst(&Func->front(), NewEntry->end());
+ NewEntry->getInstList().push_back(new BranchInst(&Func->front()));
Func->getBasicBlockList().push_front(NewEntry);
AliveBlocks.insert(NewEntry); // This block is always alive!
}
// Delete the old terminator instruction...
BB->getInstList().pop_back();
const Type *RetTy = Func->getReturnType();
- new ReturnInst(RetTy != Type::VoidTy ? Constant::getNullValue(RetTy) :0,
- BB->end());
+ BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ?
+ Constant::getNullValue(RetTy) : 0));
}
BB->dropAllReferences();