Implement support to debug inlined functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86748 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-11-10 23:06:00 +00:00
parent 0a26870d92
commit 53bb5c95af
14 changed files with 664 additions and 586 deletions
+18 -19
View File
@@ -1357,32 +1357,31 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) const {
/// instruction's DebugLoc.
void AsmPrinter::processDebugLoc(const MachineInstr *MI,
bool BeforePrintingInsn) {
if (!MAI || !DW)
if (!MAI || !DW || !MAI->doesSupportDebugInformation()
|| !DW->ShouldEmitDwarfDebug())
return;
DebugLoc DL = MI->getDebugLoc();
if (MAI->doesSupportDebugInformation() && DW->ShouldEmitDwarfDebug()) {
if (!DL.isUnknown()) {
DebugLocTuple CurDLT = MF->getDebugLocTuple(DL);
if (BeforePrintingInsn) {
if (CurDLT.Scope != 0 && PrevDLT != CurDLT) {
unsigned L = DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
CurDLT.Scope);
printLabel(L);
O << '\n';
#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
}
}
if (DL.isUnknown())
return;
DebugLocTuple CurDLT = MF->getDebugLocTuple(DL);
if (CurDLT.Scope == 0)
return;
if (BeforePrintingInsn) {
if (CurDLT != PrevDLT) {
unsigned L = DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
CurDLT.Scope);
printLabel(L);
DW->BeginScope(MI, L);
PrevDLT = CurDLT;
}
} else {
// After printing instruction
DW->EndScope(MI);
}
}
/// printInlineAsm - This method formats and prints the specified machine
/// instruction that is an inline asm.
void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {