From 2251666d445a8acf12b5c812c433730337dec143 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 6 Aug 2009 20:53:24 +0000 Subject: [PATCH] Use DebugInfoFinder git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78334 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PIC16/PIC16DebugInfo.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/Target/PIC16/PIC16DebugInfo.cpp b/lib/Target/PIC16/PIC16DebugInfo.cpp index fd0d309e141..0a44bfe2a5d 100644 --- a/lib/Target/PIC16/PIC16DebugInfo.cpp +++ b/lib/Target/PIC16/PIC16DebugInfo.cpp @@ -200,13 +200,11 @@ short PIC16DbgInfo::getStorageClass(DIGlobalVariable DIGV) { /// required initializations. void PIC16DbgInfo::BeginModule(Module &M) { // Emit file directive for module. - SmallVector CUs; - SmallVector GVs; - SmallVector SPs; - CollectDebugInfoAnchors(M, CUs, GVs, SPs); - if (!CUs.empty()) { + DebugInfoFinder DbgFinder; + DbgFinder.processModule(M); + if (DbgFinder.compile_unit_count() != 0) { // FIXME : What if more then one CUs are present in a module ? - GlobalVariable *CU = CUs[0]; + GlobalVariable *CU = *DbgFinder.compile_unit_begin(); EmitDebugDirectives = true; SwitchToCU(CU); } @@ -431,15 +429,11 @@ void PIC16DbgInfo::EmitSymbol(std::string Name, short Class, unsigned short /// EmitVarDebugInfo - Emit debug information for all variables. /// void PIC16DbgInfo::EmitVarDebugInfo(Module &M) { - SmallVector CUs; - SmallVector GVs; - SmallVector SPs; - CollectDebugInfoAnchors(M, CUs, GVs, SPs); - if (GVs.empty()) - return; + DebugInfoFinder DbgFinder; + DbgFinder.processModule(M); - 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) { DIGlobalVariable DIGV(*I); DIType Ty = DIGV.getType(); unsigned short TypeNo = 0;