diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-18 21:41:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-18 21:41:39 +0000 |
commit | 954f66a8cd43d552801f60f9e113f5c704487ee7 (patch) | |
tree | a6126414b4e19f4770c61914f4e9915763486370 | |
parent | 1085548d35ccaf5e90e001b5c2af8cc311872f15 (diff) |
Delete stoppoints that occur for the same source line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17970 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index f336722dd7..b279d9201a 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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); |