mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Add line table debug info to COFF files when using a win32 triple.
Reviewed at http://llvm-reviews.chandlerc.com/D2232 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1525,30 +1525,6 @@ void DwarfDebug::identifyScopeMarkers() {
|
||||
}
|
||||
}
|
||||
|
||||
// Get MDNode for DebugLoc's scope.
|
||||
static MDNode *getScopeNode(DebugLoc DL, const LLVMContext &Ctx) {
|
||||
if (MDNode *InlinedAt = DL.getInlinedAt(Ctx))
|
||||
return getScopeNode(DebugLoc::getFromDILocation(InlinedAt), Ctx);
|
||||
return DL.getScope(Ctx);
|
||||
}
|
||||
|
||||
// Walk up the scope chain of given debug loc and find line number info
|
||||
// for the function.
|
||||
static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext &Ctx) {
|
||||
const MDNode *Scope = getScopeNode(DL, Ctx);
|
||||
DISubprogram SP = getDISubprogram(Scope);
|
||||
if (SP.isSubprogram()) {
|
||||
// Check for number of operands since the compatibility is
|
||||
// cheap here.
|
||||
if (SP->getNumOperands() > 19)
|
||||
return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
|
||||
else
|
||||
return DebugLoc::get(SP.getLineNumber(), 0, SP);
|
||||
}
|
||||
|
||||
return DebugLoc();
|
||||
}
|
||||
|
||||
// Gather pre-function debug information. Assumes being called immediately
|
||||
// after the function entry point has been emitted.
|
||||
void DwarfDebug::beginFunction(const MachineFunction *MF) {
|
||||
@ -1743,7 +1719,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
|
||||
// Record beginning of function.
|
||||
if (!PrologEndLoc.isUnknown()) {
|
||||
DebugLoc FnStartDL =
|
||||
getFnDebugLoc(PrologEndLoc, MF->getFunction()->getContext());
|
||||
PrologEndLoc.getFnDebugLoc(MF->getFunction()->getContext());
|
||||
recordSourceLine(
|
||||
FnStartDL.getLine(), FnStartDL.getCol(),
|
||||
FnStartDL.getScope(MF->getFunction()->getContext()),
|
||||
|
Reference in New Issue
Block a user