[llvm-commits] [llvm] r62118 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Devang Patel dpatel at apple.com
Mon Jan 12 15:09:42 PST 2009


Author: dpatel
Date: Mon Jan 12 17:09:42 2009
New Revision: 62118

URL: http://llvm.org/viewvc/llvm-project?rev=62118&view=rev
Log:
Emit debug info, only if at least one compile unit is seen.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62118&r1=62117&r2=62118&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 17:09:42 2009
@@ -3596,10 +3596,16 @@
 
   /// 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();





More information about the llvm-commits mailing list