1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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.

llvm-svn: 107142
This commit is contained in:
Duncan Sands 2010-06-29 14:52:10 +00:00
parent 07e9b76b61
commit 2f42c8716a

View File

@ -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) {