diff options
author | Duncan Sands <baldrick@free.fr> | 2010-06-29 14:52:10 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-06-29 14:52:10 +0000 |
commit | a7065b1fcc394c91a647759aa36feaa280391b12 (patch) | |
tree | be198538f544e3157a8ab74b1757cbc1e603cb94 /lib | |
parent | 80b9b8953753e0ca518671ef572d215d9365d091 (diff) | |
download | external_llvm-a7065b1fcc394c91a647759aa36feaa280391b12.zip external_llvm-a7065b1fcc394c91a647759aa36feaa280391b12.tar.gz external_llvm-a7065b1fcc394c91a647759aa36feaa280391b12.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/IPO/StripSymbols.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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) { |