From cff6f244b5d0d378237c0f675f76a8c4f8cc8557 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 8 Oct 2013 22:09:56 -0400 Subject: Remove llvm.trap declaration after cleaning all uses. --- lib/Module/IntrinsicCleaner.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp index 64a47e1b..56d06d30 100644 --- a/lib/Module/IntrinsicCleaner.cpp +++ b/lib/Module/IntrinsicCleaner.cpp @@ -61,6 +61,8 @@ 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(); return dirty; } @@ -210,9 +212,6 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { ii->eraseFromParent(); - if (Function *Declare = M.getFunction("llvm.trap")) - Declare->eraseFromParent(); - dirty = true; break; } -- cgit 1.4.1