[llvm-commits] [llvm] r131106 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Mon May 9 15:14:49 PDT 2011


Author: dpatel
Date: Mon May  9 17:14:49 2011
New Revision: 131106

URL: http://llvm.org/viewvc/llvm-project?rev=131106&view=rev
Log:
Do not ignore InlinedAt while walking up scope chain to find subprogram node. 

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=131106&r1=131105&r2=131106&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon May  9 17:14:49 2011
@@ -1815,6 +1815,13 @@
   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 @@
   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);





More information about the llvm-commits mailing list