[llvm-commits] [llvm] r83348 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Mon Oct 5 17:03:14 PDT 2009


Author: dpatel
Date: Mon Oct  5 19:03:14 2009
New Revision: 83348

URL: http://llvm.org/viewvc/llvm-project?rev=83348&view=rev
Log:
Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Oct  5 19:03:14 2009
@@ -1671,15 +1671,6 @@
   if (!ModuleCU)
     ModuleCU = CompileUnits[0];
 
-  // If there is not any debug info available for any global variables and any
-  // subprograms then there is not any debug info to emit.
-  if (DbgFinder.global_variable_count() == 0
-      && DbgFinder.subprogram_count() == 0) {
-    if (TimePassesIsEnabled)
-      DebugTimer->stopTimer();
-    return;
-  }
-
   // Create DIEs for each of the externally visible global variables.
   for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(),
          E = DbgFinder.global_variable_end(); I != E; ++I) {
@@ -1728,7 +1719,7 @@
 /// EndModule - Emit all Dwarf sections that should come after the content.
 ///
 void DwarfDebug::EndModule() {
-  if (!ShouldEmitDwarfDebug())
+  if (!ModuleCU)
     return;
 
   if (TimePassesIsEnabled)





More information about the llvm-commits mailing list