summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-05-07 13:55:51 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-05-07 13:55:51 +0000
commit58f38113007cb729622ba6b960e3f1aab6ed3a4c (patch)
treefd2ab52209ec1325bf081db290d75b15f33a44d0 /llvm/lib/CodeGen/AsmPrinter
parentae1e53c87b6f267a3bde0044602fe39331d13b52 (diff)
downloadbcm5719-llvm-58f38113007cb729622ba6b960e3f1aab6ed3a4c.tar.gz
bcm5719-llvm-58f38113007cb729622ba6b960e3f1aab6ed3a4c.zip
Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change. llvm-svn: 71156
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 319bbdbe655..0d9d77762b7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -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 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) const {
}
}
+/// 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.
OpenPOWER on IntegriCloud