Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between...
authorDevang Patel <dpatel@apple.com>
Tue, 13 Jan 2009 23:02:17 +0000 (23:02 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 13 Jan 2009 23:02:17 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62191 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineModuleInfo.h
lib/CodeGen/AsmPrinter/DwarfWriter.cpp
lib/CodeGen/MachineModuleInfo.cpp

index 1f4c534f8f8db214d4bee6bd28117ac9c8d71d85..347254d125e14bf9d9aa3d0f235c9c16a7df99df 100644 (file)
@@ -1041,6 +1041,10 @@ private:
 
   bool CallsEHReturn;
   bool CallsUnwindInit;
+  /// DbgInfoAvailable - True if debugging information is available
+  /// in this module.
+  bool DbgInfoAvailable;
 public:
   static char ID; // Pass identification, replacement for typeid
 
@@ -1082,8 +1086,9 @@ public:
   
   /// hasDebugInfo - Returns true if valid debug info is present.
   ///
-  bool hasDebugInfo() const { return !CompileUnits.empty(); }
-  
+  bool hasDebugInfo() const { return DbgInfoAvailable; }
+  void setDebugInfoAvailability(bool avail) { DbgInfoAvailable = true; }
+
   bool callsEHReturn() const { return CallsEHReturn; }
   void setCallsEHReturn(bool b) { CallsEHReturn = b; }
 
index 0687fd899c0563288add0d8b2437de1823360cde..e17dd527c5e6d377ea2fac89e3375eba4bd5ff39 100644 (file)
@@ -3604,6 +3604,7 @@ public:
 
       MMI = mmi;
       shouldEmit = true;
+      MMI->setDebugInfoAvailability(true);
 
       // Create DIEs for each of the externally visible global variables.
       ConstructGlobalVariableDIEs();
index f93f27c934df677d779dcc46cec3197736590357..5fe59d4e5a7eb8437583e55feeb9db14635457e4 100644 (file)
@@ -1630,6 +1630,7 @@ MachineModuleInfo::MachineModuleInfo()
 , Personalities()
 , CallsEHReturn(0)
 , CallsUnwindInit(0)
+, DbgInfoAvailable(false)
 {
   // Always emit "no personality" info
   Personalities.push_back(NULL);