aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-12 23:09:42 +0000
committerDevang Patel <dpatel@apple.com>2009-01-12 23:09:42 +0000
commit3f7833a27364f112d7d54fd3b98517cd82433415 (patch)
treecf37f4d87e3d584838c69ae3d13fdef264dc53df /lib/CodeGen/AsmPrinter/DwarfWriter.cpp
parent72b663575f670050f329b78ac0de34476fbae66f (diff)
Emit debug info, only if at least one compile unit is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index acbec3c66c..2ec07f8d8b 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -3596,10 +3596,16 @@ public:
/// SetDebugInfo - Create global DIEs and emit initial debug info sections.
/// This is inovked by the target AsmPrinter.
- void SetDebugInfo() {
- // FIXME - Check if the module has debug info or not.
+ void SetDebugInfo(MachineModuleInfo *mmi) {
+
// Create all the compile unit DIEs.
ConstructCompileUnits();
+
+ if (DW_CUs.empty())
+ return;
+
+ MMI = mmi;
+ shouldEmit = true;
// Create DIEs for each of the externally visible global variables.
ConstructGlobalVariableDIEs();