Document ADT/PackedVector.h in "Programmer's Manual" doc.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 15 Jun 2011 19:56:01 +0000 (19:56 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 15 Jun 2011 19:56:01 +0000 (19:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133077 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ProgrammersManual.html

index 3bec325d6ce078240c539eeb4491b0a12e3644fc..49a76ee414767692a614a0b7e6bc69ba031eaa56 100644 (file)
@@ -64,6 +64,7 @@ option</a></li>
       <li><a href="#dss_deque">&lt;deque&gt;</a></li>
       <li><a href="#dss_list">&lt;list&gt;</a></li>
       <li><a href="#dss_ilist">llvm/ADT/ilist.h</a></li>
+      <li><a href="#dss_packedvector">llvm/ADT/PackedVector.h</a></li>
       <li><a href="#dss_other">Other Sequential Container Options</a></li>
     </ul></li>
     <li><a href="#ds_set">Set-Like Containers (std::set, SmallSet, SetVector, etc)</a>
@@ -1067,6 +1068,44 @@ Related classes of interest are explained in the following subsections:
     </ul>
 </div>
 
+<!-- _______________________________________________________________________ -->
+<h4>
+  <a name="dss_packedvector">llvm/ADT/PackedVector.h</a>
+</h4>
+
+<div>
+<p>
+Useful for storing a vector of values using only a few number of bits for each
+value. Apart from the standard operations of a vector-like container, it can
+also perform an 'or' set operation. 
+</p>
+
+<p>For example:</p>
+
+<div class="doc_code">
+<pre>
+enum State {
+    None = 0x0,
+    FirstCondition = 0x1,
+    SecondCondition = 0x2,
+    Both = 0x3
+};
+
+State get() {
+    PackedVector&lt;State, 2&gt; Vec1;
+    Vec1.push_back(FirstCondition);
+
+    PackedVector&lt;State, 2&gt; Vec2;
+    Vec2.push_back(SecondCondition);
+
+    Vec1 |= Vec2;
+    return Vec1[0]; // returns 'Both'.
+}
+</pre>
+</div>
+
+</div>
+
 <!-- _______________________________________________________________________ -->
 <h4>
   <a name="dss_ilist_traits">ilist_traits</a>