Just pass the DIComposite type by value instead of by pointer.
authorEric Christopher <echristo@gmail.com>
Mon, 11 Nov 2013 18:52:31 +0000 (18:52 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 11 Nov 2013 18:52:31 +0000 (18:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194398 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h

index 37eef4111ed554079da73954dcdb9f0a75d8ef33..282b69cd6ad3f27db57a775e981053b9a0b6928a 100644 (file)
@@ -1133,7 +1133,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
 
   switch (Tag) {
   case dwarf::DW_TAG_array_type:
-    constructArrayTypeDIE(Buffer, &CTy);
+    constructArrayTypeDIE(Buffer, CTy);
     break;
   case dwarf::DW_TAG_enumeration_type: {
     DIArray Elements = CTy.getTypeArray();
@@ -1687,12 +1687,12 @@ void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
 }
 
 /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
-void CompileUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType *CTy) {
-  if (CTy->isVector())
+void CompileUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy) {
+  if (CTy.isVector())
     addFlag(&Buffer, dwarf::DW_AT_GNU_vector);
 
   // Emit the element type.
-  addType(&Buffer, resolve(CTy->getTypeDerivedFrom()));
+  addType(&Buffer, resolve(CTy.getTypeDerivedFrom()));
 
   // Get an anonymous type for index type.
   // FIXME: This type should be passed down from the front end
@@ -1709,7 +1709,7 @@ void CompileUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType *CTy) {
   }
 
   // Add subranges to array type.
-  DIArray Elements = CTy->getTypeArray();
+  DIArray Elements = CTy.getTypeArray();
   for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
     DIDescriptor Element = Elements.getElement(i);
     if (Element.getTag() == dwarf::DW_TAG_subrange_type)
index a177d1910ba6c8cfecdbf930871ef8e7afa73d71..ba84164db3c76e81f604a1c25cc31a44cdd27356 100644 (file)
@@ -348,7 +348,7 @@ private:
   void constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy);
 
   /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
-  void constructArrayTypeDIE(DIE &Buffer, DICompositeType *CTy);
+  void constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy);
 
   /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator.
   void constructEnumTypeDIE(DIE &Buffer, DIEnumerator ETy);