summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-09 22:14:49 +0000
committerDevang Patel <dpatel@apple.com>2011-05-09 22:14:49 +0000
commit589845d8878e62166e27b697f7975ea89e8e5231 (patch)
treeadff865e03705e7004a39ed165de030449acd19e /llvm/lib/CodeGen/AsmPrinter
parente359d9b771d8524b64a874bcb86ebac4c1a127be (diff)
downloadbcm5719-llvm-589845d8878e62166e27b697f7975ea89e8e5231.tar.gz
bcm5719-llvm-589845d8878e62166e27b697f7975ea89e8e5231.zip
Do not ignore InlinedAt while walking up scope chain to find subprogram node.
llvm-svn: 131106
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index ed545d3d16d..8e0ace3abb4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud