summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-05 02:19:28 +0000
committerChris Lattner <sabre@nondot.org>2010-04-05 02:19:28 +0000
commit7cfa70e9b33a5a6c352fe71d668a7f3c12224a91 (patch)
treebaee5a1cddbeefde55068bdc657fe35f9afbac0e /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent0b8adb06523caccd16efb8917b0f9cad9f5ceaa5 (diff)
downloadbcm5719-llvm-7cfa70e9b33a5a6c352fe71d668a7f3c12224a91.tar.gz
bcm5719-llvm-7cfa70e9b33a5a6c352fe71d668a7f3c12224a91.zip
fastisel doesn't need DwarfWriter, remove some tendricles.
llvm-svn: 100381
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 539eba0133f..3d86bf6fc91 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1793,24 +1793,39 @@ void DwarfDebug::constructSubprogramDIE(MDNode *N) {
void DwarfDebug::beginModule(Module *M) {
if (!Asm->MAI->doesSupportDebugInformation())
return;
+
+ MMI = Asm->MMI;
TimeRegion Timer(DebugTimer);
-
+
DebugInfoFinder DbgFinder;
DbgFinder.processModule(*M);
+ bool HasDebugInfo = false;
+
+ // Scan all the compile-units to see if there are any marked as the main unit.
+ // if not, we do not generate debug info.
+ for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
+ E = DbgFinder.compile_unit_end(); I != E; ++I) {
+ if (DICompileUnit(*I).isMain()) {
+ HasDebugInfo = true;
+ break;
+ }
+ }
+
+ if (!HasDebugInfo) return;
+
+ // Tell MMI that we have debug info.
+ MMI->setDebugInfoAvailability(true);
+
// Emit initial sections.
- if (DbgFinder.compile_unit_begin() != DbgFinder.compile_unit_end())
- EmitSectionLabels();
+ EmitSectionLabels();
// Create all the compile unit DIEs.
for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
E = DbgFinder.compile_unit_end(); I != E; ++I)
constructCompileUnit(*I);
- if (!ModuleCU)
- return;
-
// Create DIEs for each subprogram.
for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
E = DbgFinder.subprogram_end(); I != E; ++I)
@@ -1821,10 +1836,6 @@ void DwarfDebug::beginModule(Module *M) {
E = DbgFinder.global_variable_end(); I != E; ++I)
constructGlobalVariableDIE(*I);
- MMI = Asm->MMI;
- shouldEmit = true;
- MMI->setDebugInfoAvailability(true);
-
// Prime section data.
SectionMap.insert(Asm->getObjFileLowering().getTextSection());
OpenPOWER on IntegriCloud