[llvm-commits] [llvm] r70811 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/DebugInfo/2009-01-29-HeaderLocation.ll utils/TableGen/AsmWriterEmitter.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Sun May 3 16:27:21 PDT 2009
Author: akirtzidis
Date: Sun May 3 18:27:19 2009
New Revision: 70811
URL: http://llvm.org/viewvc/llvm-project?rev=70811&view=rev
Log:
Revert r70803 for now, it causes a regression.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll
llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=70811&r1=70810&r2=70811&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Sun May 3 18:27:19 2009
@@ -3262,6 +3262,13 @@
// Assumes in correct section after the entry point.
EmitLabel("func_begin", ++SubprogramCount);
+ // Emit label for the implicitly defined dbg.stoppoint at the start of
+ // the function.
+ if (!Lines.empty()) {
+ const SrcLineInfo &LineInfo = Lines[0];
+ Asm->printLabel(LineInfo.getLabelID());
+ }
+
if (TimePassesIsEnabled)
DebugTimer->stopTimer();
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=70811&r1=70810&r2=70811&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Sun May 3 18:27:19 2009
@@ -333,6 +333,11 @@
unsigned Col = SPI->getColumn();
unsigned Idx = MF.getOrCreateDebugLocID(CU.getGV(), Line, Col);
setCurDebugLoc(DebugLoc::get(Idx));
+ if (DW && DW->ShouldEmitDwarfDebug()) {
+ unsigned ID = DW->RecordSourceLine(Line, Col, CU);
+ const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
+ BuildMI(MBB, DL, II).addImm(ID);
+ }
}
return true;
}
@@ -397,7 +402,7 @@
CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
- unsigned LabelID = MMI->NextLabelID();
+ unsigned LabelID = DW->RecordSourceLine(Line, 0, CompileUnit);
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(LabelID);
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@@ -412,6 +417,7 @@
setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
+ DW->RecordSourceLine(Line, 0, CompileUnit);
// llvm.dbg.func_start also defines beginning of function scope.
DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()));
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=70811&r1=70810&r2=70811&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Sun May 3 18:27:19 2009
@@ -3980,7 +3980,7 @@
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
- unsigned LabelID = DAG.getMachineModuleInfo()->NextLabelID();
+ unsigned LabelID = DW->RecordSourceLine(Line, 0, CompileUnit);
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), LabelID));
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@@ -3995,6 +3995,7 @@
setCurDebugLoc(DebugLoc::get(
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
+ DW->RecordSourceLine(Line, 0, CompileUnit);
// llvm.dbg.func_start also defines beginning of function scope.
DW->RecordRegionStart(cast<GlobalVariable>(FSI.getSubprogram()));
}
Modified: llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll?rev=70811&r1=70810&r2=70811&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (original)
+++ llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll Sun May 3 18:27:19 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc | grep "\\"m.h\\"" | count 1
+; RUN: llvm-as < %s | llc | grep "m.h" | count 1
target triple = "i386-apple-darwin9.6"
%llvm.dbg.anchor.type = type { i32, i32 }
%llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=70811&r1=70810&r2=70811&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Sun May 3 18:27:19 2009
@@ -650,12 +650,12 @@
O << "\";\n\n";
O << " if (TAI->doesSupportDebugInformation() &&\n"
- << " DW->ShouldEmitDwarfDebug()) {\n"
+ << " DW->ShouldEmitDwarfDebug() && OptLevel != CodeGenOpt::None) {\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"
+ << " if (PrevDLT.CompileUnit != 0 && PrevDLT != CurDLT)\n"
<< " printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,\n"
<< " DICompileUnit(CurDLT.CompileUnit)));\n\n"
<< " PrevDLT = CurDLT;\n"
More information about the llvm-commits
mailing list