[llvm-commits] [llvm] r102661 - in /llvm/trunk/lib: Analysis/DebugInfo.cpp CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Devang Patel dpatel at apple.com
Thu Apr 29 13:40:37 PDT 2010


Author: dpatel
Date: Thu Apr 29 15:40:36 2010
New Revision: 102661

URL: http://llvm.org/viewvc/llvm-project?rev=102661&view=rev
Log:
Refactor.

Modified:
    llvm/trunk/lib/Analysis/DebugInfo.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=102661&r1=102660&r2=102661&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Thu Apr 29 15:40:36 2010
@@ -402,6 +402,17 @@
   return getSizeInBits();
 }
 
+/// isInlinedFnArgument - Return trule if this variable provides debugging
+/// information for an inlined function arguments.
+bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
+  assert(CurFn && "Invalid function");
+  if (!getContext().isSubprogram())
+    return false;
+  // This variable is not inlined function argument if its scope 
+  // does not describe current function.
+  return !(DISubprogram(getContext().getNode()).describes(CurFn));
+}
+
 /// describes - Return true if this subprogram provides debugging
 /// information for the function F.
 bool DISubprogram::describes(const Function *F) {

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=102661&r1=102660&r2=102661&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Apr 29 15:40:36 2010
@@ -3691,14 +3691,12 @@
   if (!isa<Argument>(V))
     return false;
 
+  MachineFunction &MF = DAG.getMachineFunction();
   // Ignore inlined function arguments here.
   DIVariable DV(Variable);
-  if (DV.getContext().isSubprogram()
-      && DISubprogram(DV.getContext().getNode()).getLinkageName()
-      != cast<Argument>(V)->getParent()->getName())
+  if (DV.isInlinedFnArgument(MF.getFunction()))
     return false;
 
-  MachineFunction &MF = DAG.getMachineFunction();
   MachineBasicBlock *MBB = FuncInfo.MBBMap[DI.getParent()];
   if (MBB != &MF.front())
     return false;





More information about the llvm-commits mailing list