Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:

-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

llvm-svn: 71132
This commit is contained in:
Argyrios Kyrtzidis 2009-05-07 00:16:31 +00:00
parent f08aa62c80
commit baf3fee885
4 changed files with 24 additions and 23 deletions

View File

@ -106,11 +106,11 @@ public:
bool ShouldEmitDwarfDebug() const; bool ShouldEmitDwarfDebug() const;
//// RecordInlinedFnStart - Indicate the start of a inlined function. //// RecordInlinedFnStart - Indicate the start of a inlined function.
void RecordInlinedFnStart(Instruction *I, DISubprogram &SP, unsigned LabelID, unsigned RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU,
DICompileUnit CU, unsigned Line, unsigned Col); unsigned Line, unsigned Col);
/// RecordInlinedFnEnd - Indicate the end of inlined subroutine. /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
unsigned RecordInlinedFnEnd(DISubprogram &SP); unsigned RecordInlinedFnEnd(DISubprogram SP);
/// RecordVariableScope - Record scope for the variable declared by /// RecordVariableScope - Record scope for the variable declared by
/// DeclareMI. DeclareMI must describe TargetInstrInfo::DECLARE. /// DeclareMI. DeclareMI must describe TargetInstrInfo::DECLARE.

View File

@ -3487,10 +3487,12 @@ public:
} }
//// RecordInlinedFnStart - Indicate the start of inlined subroutine. //// RecordInlinedFnStart - Indicate the start of inlined subroutine.
void RecordInlinedFnStart(Instruction *FSI, DISubprogram &SP, unsigned LabelID, unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU,
DICompileUnit CU, unsigned Line, unsigned Col) { unsigned Line, unsigned Col) {
unsigned LabelID = MMI->NextLabelID();
if (!TAI->doesDwarfUsesInlineInfoSection()) if (!TAI->doesDwarfUsesInlineInfoSection())
return; return LabelID;
if (TimePassesIsEnabled) if (TimePassesIsEnabled)
DebugTimer->startTimer(); DebugTimer->startTimer();
@ -3520,6 +3522,8 @@ public:
if (TimePassesIsEnabled) if (TimePassesIsEnabled)
DebugTimer->stopTimer(); DebugTimer->stopTimer();
return LabelID;
} }
/// RecordInlinedFnEnd - Indicate the end of inlined subroutine. /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
@ -4749,14 +4753,13 @@ bool DwarfWriter::ShouldEmitDwarfDebug() const {
//// RecordInlinedFnStart - Global variable GV is inlined at the location marked //// RecordInlinedFnStart - Global variable GV is inlined at the location marked
//// by LabelID label. //// by LabelID label.
void DwarfWriter::RecordInlinedFnStart(Instruction *I, DISubprogram &SP, unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU,
unsigned LabelID, DICompileUnit CU, unsigned Line, unsigned Col) {
unsigned Line, unsigned Col) { return DD->RecordInlinedFnStart(SP, CU, Line, Col);
DD->RecordInlinedFnStart(I, SP, LabelID, CU, Line, Col);
} }
/// RecordInlinedFnEnd - Indicate the end of inlined subroutine. /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
unsigned DwarfWriter::RecordInlinedFnEnd(DISubprogram &SP) { unsigned DwarfWriter::RecordInlinedFnEnd(DISubprogram SP) {
return DD->RecordInlinedFnEnd(SP); return DD->RecordInlinedFnEnd(SP);
} }

View File

@ -397,14 +397,13 @@ bool FastISel::SelectCall(User *I) {
CompileUnit.getGV(), Line, 0))); CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) { if (DW && DW->ShouldEmitDwarfDebug()) {
unsigned LabelID = MMI->NextLabelID(); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
DICompileUnit(PrevLocTpl.CompileUnit),
PrevLocTpl.Line,
PrevLocTpl.Col);
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(LabelID); BuildMI(MBB, DL, II).addImm(LabelID);
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
DW->RecordInlinedFnStart(FSI, Subprogram, LabelID,
DICompileUnit(PrevLocTpl.CompileUnit),
PrevLocTpl.Line,
PrevLocTpl.Col);
} }
} else { } else {
// Record the source line. // Record the source line.

View File

@ -3981,14 +3981,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0))); MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) { if (DW && DW->ShouldEmitDwarfDebug()) {
unsigned LabelID = DAG.getMachineModuleInfo()->NextLabelID(); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
DICompileUnit(PrevLocTpl.CompileUnit),
PrevLocTpl.Line,
PrevLocTpl.Col);
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), LabelID)); getRoot(), LabelID));
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
DW->RecordInlinedFnStart(&FSI, Subprogram, LabelID,
DICompileUnit(PrevLocTpl.CompileUnit),
PrevLocTpl.Line,
PrevLocTpl.Col);
} }
} else { } else {
// Record the source line. // Record the source line.