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

Remove unused variables.

llvm-svn: 59570
This commit is contained in:
Devang Patel 2008-11-19 00:22:02 +00:00
parent b49b40c2fb
commit dd2491943e

View File

@ -273,18 +273,15 @@ bool StripDebugInfo(Module &M) {
GV->setLinkage(GlobalValue::InternalLinkage);
// Delete all dbg variables.
const Type *DbgVTy = M.getTypeByName("llvm.dbg.variable.type");
const Type *DbgGVTy = M.getTypeByName("llvm.dbg.global_variable.type");
if (DbgVTy || DbgGVTy)
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) {
GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
if (!GV) continue;
if (GV->use_empty() && llvmUsedValues.count(I) == 0
&& (!GV->hasSection()
|| strcmp(GV->getSection().c_str(), "llvm.metadata") == 0))
DeadConstants.push_back(GV);
}
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) {
GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
if (!GV) continue;
if (GV->use_empty() && llvmUsedValues.count(I) == 0
&& (!GV->hasSection()
|| strcmp(GV->getSection().c_str(), "llvm.metadata") == 0))
DeadConstants.push_back(GV);
}
if (DeadConstants.empty())
return false;