[llvm-commits] [llvm] r66471 - /llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
Devang Patel
dpatel at apple.com
Mon Mar 9 14:32:28 PDT 2009
Author: dpatel
Date: Mon Mar 9 16:32:28 2009
New Revision: 66471
URL: http://llvm.org/viewvc/llvm-project?rev=66471&view=rev
Log:
Remove llvm.dbg.global_variables also.
Modified:
llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=66471&r1=66470&r2=66471&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Mon Mar 9 16:32:28 2009
@@ -392,6 +392,16 @@
}
Declare->eraseFromParent();
+ // Delete all llvm.dbg.global_variables.
+ 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() && GV->hasName()
+ && strncmp(GV->getNameStart(), "llvm.dbg.global_variable", 24) == 0)
+ DeadConstants.push_back(GV);
+ }
+
while (!DeadConstants.empty()) {
Constant *C = DeadConstants.back();
DeadConstants.pop_back();
More information about the llvm-commits
mailing list