DebugInfo: Remove DwarfDebug::CurrentFnArguments since we have to handle argument...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfCompileUnit.cpp
index e14ac5ac7f6c0aadc246e20296996161bc5bb462..f1ee52da8d480d3bc748ef585cd3c0ca70cfad0a 100644 (file)
@@ -556,31 +556,21 @@ void DwarfCompileUnit::constructSubprogramScopeDIE(LexicalScope *Scope) {
 
   DIE &ScopeDIE = updateSubprogramScopeDIE(Sub);
 
-  // Collect arguments for current function.
-  DIE *ObjectPointer = nullptr;
-  for (DbgVariable *ArgDV : DD->getCurrentFnArguments())
-    if (ArgDV)
-      ScopeDIE.addChild(constructVariableDIE(*ArgDV, *Scope, ObjectPointer));
-
   // If this is a variadic function, add an unspecified parameter.
   DITypeArray FnArgs = Sub.getType().getTypeArray();
+
+  // Collect lexical scope children first.
+  // ObjectPointer might be a local (non-argument) local variable if it's a
+  // block's synthetic this pointer.
+  if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, ScopeDIE))
+    addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
+
   // If we have a single element of null, it is a function that returns void.
   // If we have more than one elements and the last one is null, it is a
   // variadic function.
   if (FnArgs.getNumElements() > 1 &&
       !FnArgs.getElement(FnArgs.getNumElements() - 1))
     ScopeDIE.addChild(make_unique<DIE>(dwarf::DW_TAG_unspecified_parameters));
-
-  // Collect lexical scope children first.
-  // ObjectPointer might be a local (non-argument) local variable if it's a
-  // block's synthetic this pointer.
-  if (DIE *BlockObjPtr = createAndAddScopeChildren(Scope, ScopeDIE)) {
-    assert(!ObjectPointer && "multiple object pointers can't be described");
-    ObjectPointer = BlockObjPtr;
-  }
-
-  if (ObjectPointer)
-    addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
 }
 
 DIE *DwarfCompileUnit::createAndAddScopeChildren(LexicalScope *Scope,