aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp2
-rw-r--r--lib/Transforms/Utils/Local.cpp3
2 files changed, 1 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 78730b6eb7..358b0981cc 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -1223,7 +1223,7 @@ void SROA::CleanupAllocaUsers(AllocationInst *AI) {
CleanupGEP(GEPI);
else if (Instruction *I = dyn_cast<Instruction>(U)) {
SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;
- if (OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
+ if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
// Safe to remove debug info uses.
while (!DbgInUses.empty()) {
DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 468136c996..4be1b8717d 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -262,9 +262,6 @@ bool llvm::OnlyUsedByDbgInfoIntrinsics(Instruction *I,
if (DbgInUses)
DbgInUses->clear();
- if (I->use_empty())
- return false;
-
for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE;
++UI) {
if (DbgInfoIntrinsic *DI = dyn_cast<DbgInfoIntrinsic>(*UI)) {