mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 13:36:28 +00:00
Add support to handle debug info attached to an instruction.
This is not yet enabled. llvm-svn: 83400
This commit is contained in:
parent
560feba5c2
commit
1639c0e45a
@ -110,9 +110,10 @@ public:
|
||||
|
||||
/// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
|
||||
unsigned RecordInlinedFnEnd(DISubprogram SP);
|
||||
void SetDbgScopeBeginLabels(const MachineInstr *MI, unsigned L);
|
||||
void SetDbgScopeEndLabels(const MachineInstr *MI, unsigned L);
|
||||
};
|
||||
|
||||
|
||||
} // end llvm namespace
|
||||
|
||||
#endif
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user