aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-11-19 00:22:02 +0000
committerDevang Patel <dpatel@apple.com>2008-11-19 00:22:02 +0000
commit43f586b92d108b5c5b0cc1888df677489a9f99f0 (patch)
tree6658b5ccf18a5e2fabbcd36f0fb28321cd1220f4 /lib
parent4bb7d03021fa96542e97fe72172d8479a84a5437 (diff)
downloadexternal_llvm-43f586b92d108b5c5b0cc1888df677489a9f99f0.zip
external_llvm-43f586b92d108b5c5b0cc1888df677489a9f99f0.tar.gz
external_llvm-43f586b92d108b5c5b0cc1888df677489a9f99f0.tar.bz2
Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/StripSymbols.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp
index 1ab8308..6a0458c 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -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;