mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-19 04:26:05 +00:00
Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -273,18 +273,15 @@ bool StripDebugInfo(Module &M) {
|
|||||||
GV->setLinkage(GlobalValue::InternalLinkage);
|
GV->setLinkage(GlobalValue::InternalLinkage);
|
||||||
|
|
||||||
// Delete all dbg variables.
|
// Delete all dbg variables.
|
||||||
const Type *DbgVTy = M.getTypeByName("llvm.dbg.variable.type");
|
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||||
const Type *DbgGVTy = M.getTypeByName("llvm.dbg.global_variable.type");
|
I != E; ++I) {
|
||||||
if (DbgVTy || DbgGVTy)
|
GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
|
||||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
if (!GV) continue;
|
||||||
I != E; ++I) {
|
if (GV->use_empty() && llvmUsedValues.count(I) == 0
|
||||||
GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
|
&& (!GV->hasSection()
|
||||||
if (!GV) continue;
|
|| strcmp(GV->getSection().c_str(), "llvm.metadata") == 0))
|
||||||
if (GV->use_empty() && llvmUsedValues.count(I) == 0
|
DeadConstants.push_back(GV);
|
||||||
&& (!GV->hasSection()
|
}
|
||||||
|| strcmp(GV->getSection().c_str(), "llvm.metadata") == 0))
|
|
||||||
DeadConstants.push_back(GV);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DeadConstants.empty())
|
if (DeadConstants.empty())
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user