From: Devang Patel Date: Mon, 12 Jan 2009 23:09:42 +0000 (+0000) Subject: Emit debug info, only if at least one compile unit is seen. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3f7833a27364f112d7d54fd3b98517cd82433415;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index acbec3c66cd..2ec07f8d8b9 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();