diff options
author | Devang Patel <dpatel@apple.com> | 2009-01-12 23:09:42 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-01-12 23:09:42 +0000 |
commit | 243b4add9a1e60eeae53968526cce09a27814d32 (patch) | |
tree | 66839eb4f7ec7832e30d421569c2e2945ea3c6cf /llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | |
parent | 6dfeb558979b44bc32a74a9849b39bdbdac96eb7 (diff) | |
download | bcm5719-llvm-243b4add9a1e60eeae53968526cce09a27814d32.tar.gz bcm5719-llvm-243b4add9a1e60eeae53968526cce09a27814d32.zip |
Emit debug info, only if at least one compile unit is seen.
llvm-svn: 62118
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index acbec3c66cd..2ec07f8d8b9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/llvm/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(); |