From e20ba28933119800942757871a1ed5c05f6f388d Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Tue, 18 Oct 2016 10:41:32 +0100 Subject: Fix `-Wmisleading-indentation` warning and also correctly set the `dirty` flag if we remove `llvm.trap` from the module. --- lib/Module/IntrinsicCleaner.cpp | 7 +++++-- 1 file 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; } -- cgit 1.4.1