[llvm-branch-commits] [llvm-branch] r71178 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp utils/TableGen/AsmWriterEmitter.cpp

Bill Wendling isanbard at gmail.com
Thu May 7 13:19:39 PDT 2009


Author: void
Date: Thu May  7 15:19:23 2009
New Revision: 71178

URL: http://llvm.org/viewvc/llvm-project?rev=71178&view=rev
Log:
--- Merging r71156 into '.':
U    include/llvm/CodeGen/AsmPrinter.h
U    utils/TableGen/AsmWriterEmitter.cpp
U    lib/CodeGen/AsmPrinter/AsmPrinter.cpp


Modified:
    llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
    llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp

Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h?rev=71178&r1=71177&r2=71178&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h Thu May  7 15:19:23 2009
@@ -18,7 +18,6 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Target/TargetMachine.h"
 #include <set>
@@ -342,6 +341,10 @@
     void EmitGlobalConstant(const Constant* CV, unsigned AddrSpace = 0);
 
     virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
+
+    /// processDebugLoc - Processes the debug information of each machine
+    /// instruction's DebugLoc.
+    void processDebugLoc(DebugLoc DL);
     
     /// printInlineAsm - This method formats and prints the specified machine
     /// instruction that is an inline asm.

Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=71178&r1=71177&r2=71178&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu May  7 15:19:23 2009
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Support/raw_ostream.h"
@@ -1304,6 +1305,22 @@
   }    
 }
 
+/// processDebugLoc - Processes the debug information of each machine
+/// instruction's DebugLoc.
+void AsmPrinter::processDebugLoc(DebugLoc DL) {
+  if (TAI->doesSupportDebugInformation() && DW->ShouldEmitDwarfDebug()) {
+    if (!DL.isUnknown()) {
+      static DebugLocTuple PrevDLT(0, ~0U, ~0U);
+      DebugLocTuple CurDLT = MF->getDebugLocTuple(DL);
+
+      if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT)
+        printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
+                                        DICompileUnit(CurDLT.CompileUnit)));
+
+      PrevDLT = CurDLT;
+    }
+  }
+}
 
 /// printInlineAsm - This method formats and prints the specified machine
 /// instruction that is an inline asm.

Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp?rev=71178&r1=71177&r2=71178&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp Thu May  7 15:19:23 2009
@@ -651,18 +651,7 @@
   }
   O << "\";\n\n";
 
-  O << "  if (TAI->doesSupportDebugInformation() &&\n"
-    << "      DW->ShouldEmitDwarfDebug()) {\n"
-    << "    DebugLoc CurDL = MI->getDebugLoc();\n\n"
-    << "    if (!CurDL.isUnknown()) {\n"
-    << "      static DebugLocTuple PrevDLT(0, ~0U, ~0U);\n"
-    << "      DebugLocTuple CurDLT = MF->getDebugLocTuple(CurDL);\n\n"
-    << "      if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT)\n"
-    << "        printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,\n"
-    << "                               DICompileUnit(CurDLT.CompileUnit)));\n\n"
-    << "      PrevDLT = CurDLT;\n"
-    << "    }\n"
-    << "  }\n\n";
+  O << "  processDebugLoc(MI->getDebugLoc());\n\n";
 
   O << "  if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
     << "    O << \"\\t\";\n"





More information about the llvm-branch-commits mailing list