[llvm-commits] [llvm] r71156 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp utils/TableGen/AsmWriterEmitter.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Thu May 7 06:55:56 PDT 2009
Author: akirtzidis
Date: Thu May 7 08:55:51 2009
New Revision: 71156
URL: http://llvm.org/viewvc/llvm-project?rev=71156&view=rev
Log:
Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=71156&r1=71155&r2=71156&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu May 7 08:55:51 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/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=71156&r1=71155&r2=71156&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu May 7 08:55:51 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"
@@ -1305,6 +1306,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/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=71156&r1=71155&r2=71156&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Thu May 7 08:55:51 2009
@@ -649,18 +649,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-commits
mailing list