Delete stoppoints that occur for the same source line.

llvm-svn: 17970
This commit is contained in:
Chris Lattner 2004-11-18 21:41:39 +00:00
parent 4c9c99bda8
commit 953075442d
1 changed files with 11 additions and 1 deletions

View File

@ -182,7 +182,7 @@ namespace {
assert(I.use_empty() && "Cannot erase instruction that is used!");
AddUsesToWorkList(I);
removeFromWorkList(&I);
I.getParent()->getInstList().erase(&I);
I.eraseFromParent();
return 0; // Don't do anything with FI
}
@ -3217,6 +3217,16 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
}
if (Changed) return &CI;
} else if (DbgStopPointInst *SPI = dyn_cast<DbgStopPointInst>(&CI)) {
// If this stoppoint is at the same source location as the previous
// stoppoint in the chain, it is not needed.
if (DbgStopPointInst *PrevSPI =
dyn_cast<DbgStopPointInst>(SPI->getChain()))
if (SPI->getLineNo() == PrevSPI->getLineNo() &&
SPI->getColNo() == PrevSPI->getColNo()) {
SPI->replaceAllUsesWith(PrevSPI);
return EraseInstFromFunction(CI);
}
}
return visitCallSite(&CI);