[llvm-commits] [llvm] r61709 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Devang Patel dpatel at apple.com
Mon Jan 5 09:44:11 PST 2009


Author: dpatel
Date: Mon Jan  5 11:44:11 2009
New Revision: 61709

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

subsume ConstructBasicType().

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=61709&r1=61708&r2=61709&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan  5 11:44:11 2009
@@ -1437,20 +1437,13 @@
   void AddBasicType(DIE *Entity, CompileUnit *Unit,
                     const std::string &Name,
                     unsigned Encoding, unsigned Size) {
-    DIE *Die = ConstructBasicType(Unit, Name, Encoding, Size);
-    AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, Die);
-  }
 
-  /// ConstructBasicType - Construct a new basic type.
-  ///
-  DIE *ConstructBasicType(CompileUnit *Unit,
-                          const std::string &Name,
-                          unsigned Encoding, unsigned Size) {
     DIE Buffer(DW_TAG_base_type);
     AddUInt(&Buffer, DW_AT_byte_size, 0, Size);
     AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, Encoding);
     if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
-    return Unit->AddDie(Buffer);
+    DIE *BasicTypeDie = Unit->AddDie(Buffer);
+    AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, BasicTypeDie);
   }
 
   /// AddPointerType - Add a new pointer type attribute to the specified entity.
@@ -1555,8 +1548,10 @@
         Size = 0;
 
         // Construct an anonymous type for index type.
-        DIE *IndexTy = ConstructBasicType(Unit, "", DW_ATE_signed,
-                                          sizeof(int32_t));
+        DIE Buffer(DW_TAG_base_type);
+        AddUInt(&Buffer, DW_AT_byte_size, 0, sizeof(int32_t));
+        AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
+        DIE *IndexTy = Unit->AddDie(Buffer);
 
         // Add subranges to array type.
         for (unsigned i = 0, N = Elements.size(); i < N; ++i) {





More information about the llvm-commits mailing list