-Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.

-Depend on DebugLocs for source line info.

(Comes with Regression-Be-Gone(tm))

llvm-svn: 70871
This commit is contained in:
Argyrios Kyrtzidis 2009-05-04 16:23:49 +00:00
parent 863f68aa06
commit 9ae29b2d8f
5 changed files with 13 additions and 19 deletions

View File

@ -3262,11 +3262,12 @@ public:
// 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());
DebugLoc FDL = MF->getDefaultDebugLoc();
if (!FDL.isUnknown()) {
DebugLocTuple DLT = MF->getDebugLocTuple(FDL);
unsigned LabelID = RecordSourceLine(DLT.Line, DLT.Col,
DICompileUnit(DLT.CompileUnit));
Asm->printLabel(LabelID);
}
if (TimePassesIsEnabled)

View File

@ -333,11 +333,6 @@ bool FastISel::SelectCall(User *I) {
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;
}
@ -402,7 +397,7 @@ bool FastISel::SelectCall(User *I) {
CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
unsigned LabelID = DW->RecordSourceLine(Line, 0, CompileUnit);
unsigned LabelID = MMI->NextLabelID();
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(LabelID);
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@ -414,10 +409,9 @@ bool FastISel::SelectCall(User *I) {
} else {
// Record the source line.
unsigned Line = Subprogram.getLineNumber();
setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
MF.setDefaultDebugLoc(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()));
}

View File

@ -3980,7 +3980,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) {
unsigned LabelID = DW->RecordSourceLine(Line, 0, CompileUnit);
unsigned LabelID = DAG.getMachineModuleInfo()->NextLabelID();
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), LabelID));
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@ -3992,10 +3992,9 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
} else {
// Record the source line.
unsigned Line = Subprogram.getLineNumber();
setCurDebugLoc(DebugLoc::get(
MF.setDefaultDebugLoc(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()));
}

View File

@ -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 }

View File

@ -650,12 +650,12 @@ void AsmWriterEmitter::run(std::ostream &O) {
O << "\";\n\n";
O << " if (TAI->doesSupportDebugInformation() &&\n"
<< " DW->ShouldEmitDwarfDebug() && OptLevel != CodeGenOpt::None) {\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 (PrevDLT.CompileUnit != 0 && PrevDLT != CurDLT)\n"
<< " if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT)\n"
<< " printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,\n"
<< " DICompileUnit(CurDLT.CompileUnit)));\n\n"
<< " PrevDLT = CurDLT;\n"