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:
Timur Iskhodzhanov
2014-01-28 21:33:27 +00:00
parent 6cccb32fb0
commit 38afdbea2c
13 changed files with 1531 additions and 33 deletions

View File

@ -70,6 +70,26 @@ void DebugLoc::getScopeAndInlinedAt(MDNode *&Scope, MDNode *&IA,
IA = Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].second.get();
}
MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const {
if (MDNode *InlinedAt = getInlinedAt(Ctx))
return DebugLoc::getFromDILocation(InlinedAt).getScopeNode(Ctx);
return getScope(Ctx);
}
DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) {
const MDNode *Scope = getScopeNode(Ctx);
DISubprogram SP = getDISubprogram(Scope);
if (SP.isSubprogram()) {
// Check for number of operands since the compatibility is
// cheap here. FIXME: Name the magic constant.
if (SP->getNumOperands() > 19)
return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
else
return DebugLoc::get(SP.getLineNumber(), 0, SP);
}
return DebugLoc();
}
DebugLoc DebugLoc::get(unsigned Line, unsigned Col,
MDNode *Scope, MDNode *InlinedAt) {