<div dir="ltr">On Fri, Mar 29, 2013 at 1:23 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank" class="cremed">echristo@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br>
Date: Fri Mar 29 15:23:06 2013<br>
New Revision: 178366<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178366&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=178366&view=rev</a><br>
Log:<br>
Use 12 as the magic number</blockquote><div><br></div><div style>of inline elements in the small vectors</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 for our abbreviation data and our<br>
die values. A lot of DIEs have 10 attributes in C++ code (example<br>
clang), none had more than 12. Seems like a good default. </blockquote><div><br></div><div style>There, fixed that commit log for ya. ;] Seriously, i thought you were writing "12" into the debug output at first.</div>
<div style><br></div><div style>Also, should this maybe be a constant with a name somewhere for the day when we need it to be 16?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=178366&r1=178365&r2=178366&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=178366&r1=178365&r2=178366&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Fri Mar 29 15:23:06 2013<br>
@@ -144,7 +144,7 @@ void DIE::print(raw_ostream &O, unsigned<br>
     O << "Size: " << Size << "\n";<br>
   }<br>
<br>
-  const SmallVector<DIEAbbrevData, 8> &Data = Abbrev.getData();<br>
+  const SmallVector<DIEAbbrevData, 12> &Data = Abbrev.getData();<br>
<br>
   IndentCount += 2;<br>
   for (unsigned i = 0, N = Data.size(); i < N; ++i) {<br>
@@ -324,7 +324,7 @@ void DIEEntry::print(raw_ostream &O) {<br>
 ///<br>
 unsigned DIEBlock::ComputeSize(AsmPrinter *AP) {<br>
   if (!Size) {<br>
-    const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();<br>
+    const SmallVector<DIEAbbrevData, 12> &AbbrevData = Abbrev.getData();<br>
     for (unsigned i = 0, N = Values.size(); i < N; ++i)<br>
       Size += Values[i]->SizeOf(AP, AbbrevData[i].getForm());<br>
   }<br>
@@ -343,7 +343,7 @@ void DIEBlock::EmitValue(AsmPrinter *Asm<br>
   case dwarf::DW_FORM_block:  Asm->EmitULEB128(Size); break;<br>
   }<br>
<br>
-  const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();<br>
+  const SmallVector<DIEAbbrevData, 12> &AbbrevData = Abbrev.getData();<br>
   for (unsigned i = 0, N = Values.size(); i < N; ++i)<br>
     Values[i]->EmitValue(Asm, AbbrevData[i].getForm());<br>
 }<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h?rev=178366&r1=178365&r2=178366&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h?rev=178366&r1=178365&r2=178366&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h Fri Mar 29 15:23:06 2013<br>
@@ -66,7 +66,7 @@ namespace llvm {<br>
<br>
     /// Data - Raw data bytes for abbreviation.<br>
     ///<br>
-    SmallVector<DIEAbbrevData, 8> Data;<br>
+    SmallVector<DIEAbbrevData, 12> Data;<br>
<br>
   public:<br>
     DIEAbbrev(uint16_t T, uint16_t C) : Tag(T), ChildrenFlag(C), Data() {}<br>
@@ -75,7 +75,7 @@ namespace llvm {<br>
     uint16_t getTag() const { return Tag; }<br>
     unsigned getNumber() const { return Number; }<br>
     uint16_t getChildrenFlag() const { return ChildrenFlag; }<br>
-    const SmallVector<DIEAbbrevData, 8> &getData() const { return Data; }<br>
+    const SmallVector<DIEAbbrevData, 12> &getData() const { return Data; }<br>
     void setTag(uint16_t T) { Tag = T; }<br>
     void setChildrenFlag(uint16_t CF) { ChildrenFlag = CF; }<br>
     void setNumber(unsigned N) { Number = N; }<br>
@@ -133,7 +133,7 @@ namespace llvm {<br>
<br>
     /// Attribute values.<br>
     ///<br>
-    SmallVector<DIEValue*, 32> Values;<br>
+    SmallVector<DIEValue*, 12> Values;<br>
<br>
     // Private data for print()<br>
     mutable unsigned IndentCount;<br>
@@ -150,7 +150,7 @@ namespace llvm {<br>
     unsigned getOffset() const { return Offset; }<br>
     unsigned getSize() const { return Size; }<br>
     const std::vector<DIE *> &getChildren() const { return Children; }<br>
-    const SmallVector<DIEValue*, 32> &getValues() const { return Values; }<br>
+    const SmallVector<DIEValue*, 12> &getValues() const { return Values; }<br>
     DIE *getParent() const { return Parent; }<br>
     /// Climb up the parent chain to get the compile unit DIE this DIE belongs<br>
     /// to.<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=178366&r1=178365&r2=178366&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=178366&r1=178365&r2=178366&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Mar 29 15:23:06 2013<br>
@@ -1672,8 +1672,8 @@ DwarfUnits::computeSizeAndOffset(DIE *Di<br>
   // Start the size with the size of abbreviation code.<br>
   Offset += MCAsmInfo::getULEB128Size(AbbrevNumber);<br>
<br>
-  const SmallVector<DIEValue*, 32> &Values = Die->getValues();<br>
-  const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();<br>
+  const SmallVector<DIEValue*, 12> &Values = Die->getValues();<br>
+  const SmallVector<DIEAbbrevData, 12> &AbbrevData = Abbrev->getData();<br>
<br>
   // Size the DIE attribute values.<br>
   for (unsigned i = 0, N = Values.size(); i < N; ++i)<br>
@@ -1767,8 +1767,8 @@ void DwarfDebug::emitDIE(DIE *Die, std::<br>
                                 dwarf::TagString(Abbrev->getTag()));<br>
   Asm->EmitULEB128(AbbrevNumber);<br>
<br>
-  const SmallVector<DIEValue*, 32> &Values = Die->getValues();<br>
-  const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();<br>
+  const SmallVector<DIEValue*, 12> &Values = Die->getValues();<br>
+  const SmallVector<DIEAbbrevData, 12> &AbbrevData = Abbrev->getData();<br>
<br>
   // Emit the DIE attribute values.<br>
   for (unsigned i = 0, N = Values.size(); i < N; ++i) {<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>