From ae5ead6df47f03c115edbc3d49f463b41183ca0b Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 6 Aug 2009 20:53:06 +0000 Subject: [PATCH] Use DebugInfoFinder. llvm-svn: 78333 --- llvm/lib/Transforms/IPO/StripSymbols.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp index 1bbda3cd22db..b498211b3fda 100644 --- a/llvm/lib/Transforms/IPO/StripSymbols.cpp +++ b/llvm/lib/Transforms/IPO/StripSymbols.cpp @@ -207,21 +207,20 @@ bool StripDebugInfo(Module &M) { findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues); findUsedValues(M.getGlobalVariable("llvm.compiler.used"), llvmUsedValues); - SmallVector CUs; - SmallVector GVs; - SmallVector 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::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::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::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);