aboutsummaryrefslogtreecommitdiffstats
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
commit91d27b09b7ed922f52d79ed69513debc258cd7ea (patch)
treecf37f4d87e3d584838c69ae3d13fdef264dc53df
parent6eae283d4962b1c38d3c6fa0100c0d605f6f4100 (diff)
downloadexternal_llvm-91d27b09b7ed922f52d79ed69513debc258cd7ea.zip
external_llvm-91d27b09b7ed922f52d79ed69513debc258cd7ea.tar.gz
external_llvm-91d27b09b7ed922f52d79ed69513debc258cd7ea.tar.bz2
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
-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 acbec3c..2ec07f8 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();