about summary refs log tree commit diff homepage
path: root/lib/Module/IntrinsicCleaner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Module/IntrinsicCleaner.cpp')
-rw-r--r--lib/Module/IntrinsicCleaner.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 54ad7db7..54582e69 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -59,8 +59,11 @@ bool IntrinsicCleanerPass::runOnModule(Module &M) {
   for (Module::iterator f = M.begin(), fe = M.end(); f != fe; ++f)
     for (Function::iterator b = f->begin(), be = f->end(); b != be; ++b)
       dirty |= runOnBasicBlock(*b, M);
-    if (Function *Declare = M.getFunction("llvm.trap"))
-      Declare->eraseFromParent();
+
+  if (Function *Declare = M.getFunction("llvm.trap")) {
+    Declare->eraseFromParent();
+    dirty = true;
+  }
   return dirty;
 }