/// inserted into a block.
void ClearInsertionPoint() {
BB = nullptr;
- InsertPt = nullptr;
+ InsertPt.reset(nullptr);
}
BasicBlock *GetInsertBlock() const { return BB; }
/// the specified instruction.
void SetInsertPoint(Instruction *I) {
BB = I->getParent();
- InsertPt = I;
- assert(I != BB->end() && "Can't read debug loc from end()");
+ InsertPt = I->getIterator();
+ assert(InsertPt != BB->end() && "Can't read debug loc from end()");
SetCurrentDebugLocation(I->getDebugLoc());
}