[llvm-commits] [llvm] r100563 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfDebug.h test/FrontendC++/2010-02-17-DbgArtificialArg.cpp

Stuart Hastings stuart at apple.com
Tue Apr 6 14:38:29 PDT 2010


Author: stuart
Date: Tue Apr  6 16:38:29 2010
New Revision: 100563

URL: http://llvm.org/viewvc/llvm-project?rev=100563&view=rev
Log:
Reverting 100530 & 100531 due to regressions in the GDB test suite.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=100563&r1=100562&r2=100563&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Apr  6 16:38:29 2010
@@ -800,26 +800,12 @@
   } else if (Context.isNameSpace()) {
     DIE *ContextDIE = getOrCreateNameSpace(DINameSpace(Context.getNode()));
     ContextDIE->addChild(Die);
-  } else if (Context.isSubprogram()) {
-    DIE *ContextDIE = createSubprogramDIE(DISubprogram(Context.getNode()),
-                                          /*MakeDecl=*/false);
-    ContextDIE->addChild(Die);
   } else if (DIE *ContextDIE = ModuleCU->getDIE(Context.getNode()))
     ContextDIE->addChild(Die);
   else 
     ModuleCU->addDie(Die);
 }
 
-/// isFunctionContext - True if given Context is nested within a function. 
-bool DwarfDebug::isFunctionContext(DIE *context) {
-  if (context == (DIE *)0)
-    return false;
-  if (context->getTag() == dwarf::DW_TAG_subprogram)
-    return true;
-  else
-    return isFunctionContext(context->getParent());
-}
-
 /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
 /// given DIType.
 DIE *DwarfDebug::getOrCreateTypeDIE(DIType Ty) {
@@ -1001,10 +987,6 @@
     if (DIDescriptor(ContainingType.getNode()).isCompositeType())
       addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4, 
                   getOrCreateTypeDIE(DIType(ContainingType.getNode())));
-    else {
-      DIDescriptor Context = CTy.getContext();
-      addToContextOwner(&Buffer, Context);
-    }
     break;
   }
   default:
@@ -1820,15 +1802,19 @@
 void DwarfDebug::constructSubprogramDIE(MDNode *N) {
   DISubprogram SP(N);
 
+  // Check for pre-existence.
+  if (ModuleCU->getDIE(N))
+    return;
+
   if (!SP.isDefinition())
     // This is a method declaration which will be handled while constructing
     // class type.
     return;
 
-  // Check for pre-existence.
-  DIE *SubprogramDie = ModuleCU->getDIE(N);
-  if (!SubprogramDie)
-    SubprogramDie = createSubprogramDIE(SP);
+  DIE *SubprogramDie = createSubprogramDIE(SP);
+
+  // Add to map.
+  ModuleCU->insertDIE(N, SubprogramDie);
 
   // Add to context owner.
   addToContextOwner(SubprogramDie, SP.getContext());

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=100563&r1=100562&r2=100563&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Apr  6 16:38:29 2010
@@ -332,9 +332,6 @@
   /// addToContextOwner - Add Die into the list of its context owner's children.
   void addToContextOwner(DIE *Die, DIDescriptor Context);
 
-  /// isFunctionContext - True if given Context is nested within a function. 
-  bool isFunctionContext(DIE *context);
-
   /// addType - Add a new type attribute to the specified entity.
   void addType(DIE *Entity, DIType Ty);
 

Modified: llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-02-17-DbgArtificialArg.cpp?rev=100563&r1=100562&r2=100563&view=diff
==============================================================================
--- llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp (original)
+++ llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp Tue Apr  6 16:38:29 2010
@@ -1,4 +1,4 @@
-// RUN: %llvmgcc -g -S %s -o - | FileCheck %s
+// RUN: %llvmgcc -g -S %s -o - | grep DW_TAG_pointer_type |  grep "i32 524303, metadata .., metadata ..., metadata .., i32 ., i64 .., i64 .., i64 0, i32 64, metadata ..."
 // Here, second to last argument "i32 64" indicates that artificial type is set.                                               
 // Test to artificial attribute attahed to "this" pointer type.
 // Radar 7655792 and 7655002
@@ -10,7 +10,5 @@
 
 int foo() {
   A a;
-  // Matching "i32 64, metadata !<number>} ; [ DW_TAG_pointer_type ]"
-  // CHECK: i32 64, metadata {{![0-9]+\} ; \[ DW_TAG_pointer_type \]}}
   return a.fn1(1);
 }





More information about the llvm-commits mailing list