diff options
-rw-r--r-- | lib/Transforms/IPO/StripSymbols.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 3906b5111e..fbb2075cb4 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -28,6 +28,7 @@ #include "llvm/Pass.h" #include "llvm/ValueSymbolTable.h" #include "llvm/TypeSymbolTable.h" +#include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/Compiler.h" #include "llvm/ADT/SmallPtrSet.h" using namespace llvm; @@ -268,8 +269,8 @@ bool StripDebugInfo(Module &M) { if (Arg1->use_empty()) { if (Constant *C = dyn_cast<Constant>(Arg1)) DeadConstants.push_back(C); - if (Instruction *I = dyn_cast<Instruction>(Arg1)) - I->eraseFromParent(); + else + RecursivelyDeleteTriviallyDeadInstructions(Arg1, NULL); } if (Arg2->use_empty()) if (Constant *C = dyn_cast<Constant>(Arg2)) |