aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-03 23:30:00 +0000
committerDale Johannesen <dalej@apple.com>2009-03-03 23:30:00 +0000
commit4bb1f4ad88bdf4c47e72b68f51d7da30e25296a0 (patch)
treee4d6fe2be0f6913dff617a39a10cef6ca311218a /lib/Transforms/Utils/Local.cpp
parent605879dd16294748fba6edf4e17da9bf4ddfa433 (diff)
downloadexternal_llvm-4bb1f4ad88bdf4c47e72b68f51d7da30e25296a0.zip
external_llvm-4bb1f4ad88bdf4c47e72b68f51d7da30e25296a0.tar.gz
external_llvm-4bb1f4ad88bdf4c47e72b68f51d7da30e25296a0.tar.bz2
Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead. Fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r--lib/Transforms/Utils/Local.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 38809e5..d2cbec0 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -159,6 +159,9 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
bool llvm::isInstructionTriviallyDead(Instruction *I) {
if (!I->use_empty() || isa<TerminatorInst>(I)) return false;
+ // We don't want debug info removed by anything this general.
+ if (isa<DbgInfoIntrinsic>(I)) return false;
+
if (!I->mayWriteToMemory())
return true;