[llvm-commits] [llvm] r62184 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Devang Patel dpatel at apple.com
Tue Jan 13 13:25:00 PST 2009


Author: dpatel
Date: Tue Jan 13 15:25:00 2009
New Revision: 62184

URL: http://llvm.org/viewvc/llvm-project?rev=62184&view=rev
Log:
Use dwarf writer to decide whether the module has debug info or not.

Modified:
    llvm/trunk/include/llvm/CodeGen/DwarfWriter.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62184&r1=62183&r2=62184&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Jan 13 15:25:00 2009
@@ -93,6 +93,9 @@
   /// getRecordSourceLineCount - Count source lines.
   unsigned getRecordSourceLineCount();
 
+  /// hasDebugInfo - Return true if debug info intrinsics are seen in 
+  /// this module.
+  bool hasDebugInfo();
 };
 
 

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

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 15:25:00 2009
@@ -4984,3 +4984,9 @@
 unsigned DwarfWriter::getRecordSourceLineCount() {
   return DD->getRecordSourceLineCount();
 }
+
+/// hasDebugInfo - Return true if debug info intrinsics are seen in 
+/// this module.
+bool DwarfWriter::hasDebugInfo() {
+  return DD && DD->ShouldEmitDwarf();
+}

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62184&r1=62183&r2=62184&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 13 15:25:00 2009
@@ -23,6 +23,7 @@
 #include "llvm/CodeGen/MachineConstantPool.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/DwarfWriter.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Target/TargetData.h"
@@ -2040,8 +2041,8 @@
   if (GA->getOffset() != 0) return false;
   GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal());
   if (!GV) return false;
-  MachineModuleInfo *MMI = getMachineModuleInfo();
-  return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV);
+  DwarfWriter *DW = getDwarfWriter();
+  return DW && DW->hasDebugInfo();
 }
 
 





More information about the llvm-commits mailing list