/// 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
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;
}
}
Parent->AddScope(Slot);
else
// First function is top level function.
- // FIXME - Dpatel - What is FunctionDbgScope ?
if (!FunctionDbgScope)
FunctionDbgScope = Slot;
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);
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);
+}
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: {