From: Owen Anderson Date: Tue, 24 Jun 2008 21:44:59 +0000 (+0000) Subject: Use SmallVector instead of std::vector for a minor compile time improvement. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=873e1b56427eee7879168b50cca8a85b04f18093;p=oota-llvm.git Use SmallVector instead of std::vector for a minor compile time improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52689 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 086786bcab3..cc5cf4d89ad 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -140,7 +140,7 @@ private: /// Data - Raw data bytes for abbreviation. /// - std::vector Data; + SmallVector Data; public: @@ -155,7 +155,7 @@ public: unsigned getTag() const { return Tag; } unsigned getNumber() const { return Number; } unsigned getChildrenFlag() const { return ChildrenFlag; } - const std::vector &getData() const { return Data; } + const SmallVector &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 @@ protected: /// Attributes values. /// - std::vector Values; + SmallVector Values; public: explicit DIE(unsigned Tag) @@ -240,7 +240,7 @@ public: unsigned getOffset() const { return Offset; } unsigned getSize() const { return Size; } const std::vector &getChildren() const { return Children; } - std::vector &getValues() { return Values; } + SmallVector &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 @@ private: ":0x" + utohexstr(Die->getSize()) + " " + TagString(Abbrev->getTag()))); - std::vector &Values = Die->getValues(); - const std::vector &AbbrevData = Abbrev->getData(); + SmallVector &Values = Die->getValues(); + const SmallVector &AbbrevData = Abbrev->getData(); // Emit the DIE attribute values. for (unsigned i = 0, N = Values.size(); i < N; ++i) { @@ -2139,8 +2139,8 @@ private: // Start the size with the size of abbreviation code. Offset += Asm->SizeULEB128(AbbrevNumber); - const std::vector &Values = Die->getValues(); - const std::vector &AbbrevData = Abbrev->getData(); + const SmallVector &Values = Die->getValues(); + const SmallVector &AbbrevData = Abbrev->getData(); // Size the DIE attribute values. for (unsigned i = 0, N = Values.size(); i < N; ++i) { @@ -3726,7 +3726,7 @@ void DIEntry::EmitValue(DwarfDebug &DD, unsigned Form) { /// unsigned DIEBlock::ComputeSize(DwarfDebug &DD) { if (!Size) { - const std::vector &AbbrevData = Abbrev.getData(); + const SmallVector &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 @@ void DIEBlock::EmitValue(DwarfDebug &DD, unsigned Form) { default: assert(0 && "Improper form for block"); break; } - const std::vector &AbbrevData = Abbrev.getData(); + const SmallVector &AbbrevData = Abbrev.getData(); for (unsigned i = 0, N = Values.size(); i < N; ++i) { DD.getAsm()->EOL(); @@ -3819,7 +3819,7 @@ void DIE::print(std::ostream &O, unsigned IncIndent) { } O << "\n"; - const std::vector &Data = Abbrev.getData(); + const SmallVector &Data = Abbrev.getData(); IndentCount += 2; for (unsigned i = 0, N = Data.size(); i < N; ++i) {