From a7065b1fcc394c91a647759aa36feaa280391b12 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 29 Jun 2010 14:52:10 +0000 Subject: Return Changed. This required setting Changed if dbg metadata is stripped off. Currently set unconditionally, since the API does not provide a way of working out if anything was actually stripped off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107142 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/StripSymbols.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/IPO/StripSymbols.cpp') diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 6bc8e66..7ab87a6 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -228,22 +228,24 @@ static bool StripDebugInfo(Module &M) { Changed = true; NMD->eraseFromParent(); } - + NMD = M.getNamedMetadata("llvm.dbg.lv"); if (NMD) { Changed = true; NMD->eraseFromParent(); } - + unsigned MDDbgKind = M.getMDKindID("dbg"); - for (Module::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI) + for (Module::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI) for (Function::iterator FI = MI->begin(), FE = MI->end(); FI != FE; ++FI) for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; - ++BI) + ++BI) { + Changed = true; // FIXME: Only set if there was debug metadata. BI->setMetadata(MDDbgKind, 0); + } - return true; + return Changed; } bool StripSymbols::runOnModule(Module &M) { -- cgit v1.1