diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-09 22:14:49 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-09 22:14:49 +0000 |
commit | a3f486762f943136da84bfe590e7153fd434c7ad (patch) | |
tree | 233f19c0d1bc512acf1e807dd93c8736580f8b5f /lib | |
parent | f5bf3cf7e2a0ff1ca884a83a8b56b5a57f8a5c80 (diff) | |
download | external_llvm-a3f486762f943136da84bfe590e7153fd434c7ad.zip external_llvm-a3f486762f943136da84bfe590e7153fd434c7ad.tar.gz external_llvm-a3f486762f943136da84bfe590e7153fd434c7ad.tar.bz2 |
Do not ignore InlinedAt while walking up scope chain to find subprogram node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index ed545d3..8e0ace3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1815,6 +1815,13 @@ static DebugLoc FindFirstDebugLoc(const MachineFunction *MF) { return DebugLoc(); } +/// getScopeNode - 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); +} + /// beginFunction - Gather pre-function debug information. Assumes being /// emitted immediately after the function entry point. void DwarfDebug::beginFunction(const MachineFunction *MF) { @@ -1831,7 +1838,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { DebugLoc FDL = FindFirstDebugLoc(MF); if (FDL.isUnknown()) return; - const MDNode *Scope = FDL.getScope(MF->getFunction()->getContext()); + const MDNode *Scope = getScopeNode(FDL, MF->getFunction()->getContext()); const MDNode *TheScope = 0; DISubprogram SP = getDISubprogram(Scope); |