summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-06 18:37:31 +0000
committerDevang Patel <dpatel@apple.com>2009-10-06 18:37:31 +0000
commit4598eb6214ae4b0278ddab17f20caf75542b37a3 (patch)
tree6003c3cb930e780b03878de53ba51b1024d68090 /llvm/lib/CodeGen
parent5d90d627010e1ed2d3622bf74b3820e6d610de48 (diff)
downloadbcm5719-llvm-4598eb6214ae4b0278ddab17f20caf75542b37a3.tar.gz
bcm5719-llvm-4598eb6214ae4b0278ddab17f20caf75542b37a3.zip
Add support to handle debug info attached to an instruction.
This is not yet enabled. llvm-svn: 83400
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp16
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp6
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp2
4 files changed, 25 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index f149f10f3b4..3a7fe0e24e8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1363,12 +1363,18 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI,
DebugLocTuple CurDLT = MF->getDebugLocTuple(DL);
if (BeforePrintingInsn) {
if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT) {
- printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
- CurDLT.CompileUnit));
- O << '\n';
+ unsigned L = DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
+ CurDLT.CompileUnit);
+ printLabel(L);
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ DW->SetDbgScopeBeginLabels(MI, L);
+#endif
+ } else {
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ DW->SetDbgScopeEndLabels(MI, 0);
+#endif
}
- }
-
+ }
PrevDLT = CurDLT;
}
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index cd4fd768ba9..5b3f3cee39f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1322,7 +1322,6 @@ DbgScope *DwarfDebug::getDbgScope(MDNode *N, const MachineInstr *MI) {
Parent->AddScope(Slot);
else
// First function is top level function.
- // FIXME - Dpatel - What is FunctionDbgScope ?
if (!FunctionDbgScope)
FunctionDbgScope = Slot;
@@ -1901,6 +1900,12 @@ void DwarfDebug::BeginFunction(MachineFunction *MF) {
if (TimePassesIsEnabled)
DebugTimer->startTimer();
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ if (!ExtractScopeInformation(MF))
+ return;
+ CollectVariableInfo();
+#endif
+
// Begin accumulating function debug information.
MMI->BeginFunction(MF);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index bebf8e07997..0638d356854 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -119,3 +119,9 @@ unsigned DwarfWriter::RecordInlinedFnEnd(DISubprogram SP) {
return DD->RecordInlinedFnEnd(SP);
}
+void DwarfWriter::SetDbgScopeBeginLabels(const MachineInstr *MI, unsigned L) {
+ DD->SetDbgScopeEndLabels(MI, L);
+}
+void DwarfWriter::SetDbgScopeEndLabels(const MachineInstr *MI, unsigned L) {
+ DD->SetDbgScopeBeginLabels(MI, L);
+}
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 0bec2cf9b1f..bccff160ce9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -425,7 +425,9 @@ bool FastISel::SelectCall(User *I) {
if (AllocaLocation)
MMI->setVariableDbgInfo(DI->getVariable(), AllocaLocation, FI);
}
+#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
DW->RecordVariable(DI->getVariable(), FI);
+#endif
return true;
}
case Intrinsic::eh_exception: {
OpenPOWER on IntegriCloud