[llvm-commits] [llvm] r78333 - /llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
Devang Patel
dpatel at apple.com
Thu Aug 6 13:53:06 PDT 2009
Author: dpatel
Date: Thu Aug 6 15:53:06 2009
New Revision: 78333
URL: http://llvm.org/viewvc/llvm-project?rev=78333&view=rev
Log:
Use DebugInfoFinder.
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=78333&r1=78332&r2=78333&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Aug 6 15:53:06 2009
@@ -207,21 +207,20 @@
findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
findUsedValues(M.getGlobalVariable("llvm.compiler.used"), llvmUsedValues);
- SmallVector<GlobalVariable *, 2> CUs;
- SmallVector<GlobalVariable *, 4> GVs;
- SmallVector<GlobalVariable *, 4> SPs;
- CollectDebugInfoAnchors(M, CUs, GVs, SPs);
+ DebugInfoFinder DbgFinder;
+ DbgFinder.processModule(M);
+
// These anchors use LinkOnce linkage so that the optimizer does not
// remove them accidently. Set InternalLinkage for all these debug
// info anchors.
- for (SmallVector<GlobalVariable *, 2>::iterator I = CUs.begin(),
- E = CUs.end(); I != E; ++I)
+ for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
+ E = DbgFinder.compile_unit_end(); I != E; ++I)
(*I)->setLinkage(GlobalValue::InternalLinkage);
- for (SmallVector<GlobalVariable *, 4>::iterator I = GVs.begin(),
- E = GVs.end(); I != E; ++I)
+ for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(),
+ E = DbgFinder.global_variable_end(); I != E; ++I)
(*I)->setLinkage(GlobalValue::InternalLinkage);
- for (SmallVector<GlobalVariable *, 4>::iterator I = SPs.begin(),
- E = SPs.end(); I != E; ++I)
+ for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
+ E = DbgFinder.subprogram_end(); I != E; ++I)
(*I)->setLinkage(GlobalValue::InternalLinkage);
More information about the llvm-commits
mailing list