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

Owen Anderson resistor at mac.com
Tue Jun 24 14:45:00 PDT 2008


Author: resistor
Date: Tue Jun 24 16:44:59 2008
New Revision: 52689

URL: http://llvm.org/viewvc/llvm-project?rev=52689&view=rev
Log:
Use SmallVector instead of std::vector for a minor compile time improvement.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Tue Jun 24 16:44:59 2008
@@ -140,7 +140,7 @@
 
   /// Data - Raw data bytes for abbreviation.
   ///
-  std::vector<DIEAbbrevData> Data;
+  SmallVector<DIEAbbrevData, 8> Data;
 
 public:
 
@@ -155,7 +155,7 @@
   unsigned getTag()                           const { return Tag; }
   unsigned getNumber()                        const { return Number; }
   unsigned getChildrenFlag()                  const { return ChildrenFlag; }
-  const std::vector<DIEAbbrevData> &getData() const { return Data; }
+  const SmallVector<DIEAbbrevData, 8> &getData() const { return Data; }
   void setTag(unsigned T)                           { Tag = T; }
   void setChildrenFlag(unsigned CF)                 { ChildrenFlag = CF; }
   void setNumber(unsigned N)                        { Number = N; }
@@ -219,7 +219,7 @@
   
   /// Attributes values.
   ///
-  std::vector<DIEValue *> Values;
+  SmallVector<DIEValue*, 32> Values;
   
 public:
   explicit DIE(unsigned Tag)
@@ -240,7 +240,7 @@
   unsigned getOffset()                       const { return Offset; }
   unsigned getSize()                         const { return Size; }
   const std::vector<DIE *> &getChildren()    const { return Children; }
-  std::vector<DIEValue *> &getValues()       { return Values; }
+  SmallVector<DIEValue*, 32> &getValues()       { return Values; }
   void setTag(unsigned Tag)                  { Abbrev.setTag(Tag); }
   void setOffset(unsigned O)                 { Offset = O; }
   void setSize(unsigned S)                   { Size = S; }
@@ -2081,8 +2081,8 @@
              ":0x" + utohexstr(Die->getSize()) + " " +
              TagString(Abbrev->getTag())));
     
-    std::vector<DIEValue *> &Values = Die->getValues();
-    const std::vector<DIEAbbrevData> &AbbrevData = Abbrev->getData();
+    SmallVector<DIEValue*, 32> &Values = Die->getValues();
+    const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();
     
     // Emit the DIE attribute values.
     for (unsigned i = 0, N = Values.size(); i < N; ++i) {
@@ -2139,8 +2139,8 @@
     // Start the size with the size of abbreviation code.
     Offset += Asm->SizeULEB128(AbbrevNumber);
     
-    const std::vector<DIEValue *> &Values = Die->getValues();
-    const std::vector<DIEAbbrevData> &AbbrevData = Abbrev->getData();
+    const SmallVector<DIEValue*, 32> &Values = Die->getValues();
+    const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();
 
     // Size the DIE attribute values.
     for (unsigned i = 0, N = Values.size(); i < N; ++i) {
@@ -3726,7 +3726,7 @@
 ///
 unsigned DIEBlock::ComputeSize(DwarfDebug &DD) {
   if (!Size) {
-    const std::vector<DIEAbbrevData> &AbbrevData = Abbrev.getData();
+    const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();
     
     for (unsigned i = 0, N = Values.size(); i < N; ++i) {
       Size += Values[i]->SizeOf(DD, AbbrevData[i].getForm());
@@ -3746,7 +3746,7 @@
   default: assert(0 && "Improper form for block");          break;
   }
   
-  const std::vector<DIEAbbrevData> &AbbrevData = Abbrev.getData();
+  const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();
 
   for (unsigned i = 0, N = Values.size(); i < N; ++i) {
     DD.getAsm()->EOL();
@@ -3819,7 +3819,7 @@
   }
   O << "\n";
 
-  const std::vector<DIEAbbrevData> &Data = Abbrev.getData();
+  const SmallVector<DIEAbbrevData, 8> &Data = Abbrev.getData();
   
   IndentCount += 2;
   for (unsigned i = 0, N = Data.size(); i < N; ++i) {





More information about the llvm-commits mailing list