aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-30 18:56:46 +0000
committerDevang Patel <dpatel@apple.com>2009-07-30 18:56:46 +0000
commitfda766d66b73e1fad51864bfaa616e1c6ab6d272 (patch)
treed559c4fb08926353e273f335729c9714505bc884
parente7a0ea260f985f738512e504598e13b0f1c6c1a4 (diff)
downloadexternal_llvm-fda766d66b73e1fad51864bfaa616e1c6ab6d272.zip
external_llvm-fda766d66b73e1fad51864bfaa616e1c6ab6d272.tar.gz
external_llvm-fda766d66b73e1fad51864bfaa616e1c6ab6d272.tar.bz2
Start using DebugInfoFinder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77621 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index fea00f4..afcd44a 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1283,14 +1283,12 @@ void DwarfDebug::BeginModule(Module *M, MachineModuleInfo *mmi) {
if (TimePassesIsEnabled)
DebugTimer->startTimer();
- SmallVector<GlobalVariable *, 2> CUs;
- SmallVector<GlobalVariable *, 4> GVs;
- SmallVector<GlobalVariable *, 4> SPs;
- CollectDebugInfoAnchors(*M, CUs, GVs, SPs);
+ DebugInfoFinder DbgFinder;
+ DbgFinder.processModule(*M);
// Create all the compile unit DIEs.
- 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)
ConstructCompileUnit(*I);
if (CompileUnits.empty()) {
@@ -1307,21 +1305,21 @@ void DwarfDebug::BeginModule(Module *M, MachineModuleInfo *mmi) {
// If there is not any debug info available for any global variables and any
// subprograms then there is not any debug info to emit.
- if (GVs.empty() && SPs.empty()) {
+ if (DbgFinder.global_variable_count() == 0
+ && DbgFinder.subprogram_count() == 0) {
if (TimePassesIsEnabled)
DebugTimer->stopTimer();
-
return;
}
-
+
// Create DIEs for each of the externally visible global variables.
- 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)
ConstructGlobalVariableDIE(*I);
// Create DIEs for each of the externally visible subprograms.
- 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)
ConstructSubprogram(*I);
MMI = mmi;