[llvm-commits] [llvm] r133077 - /llvm/trunk/docs/ProgrammersManual.html
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jun 15 12:56:01 PDT 2011
Author: akirtzidis
Date: Wed Jun 15 14:56:01 2011
New Revision: 133077
URL: http://llvm.org/viewvc/llvm-project?rev=133077&view=rev
Log:
Document ADT/PackedVector.h in "Programmer's Manual" doc.
Modified:
llvm/trunk/docs/ProgrammersManual.html
Modified: llvm/trunk/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=133077&r1=133076&r2=133077&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Wed Jun 15 14:56:01 2011
@@ -64,6 +64,7 @@
<li><a href="#dss_deque"><deque></a></li>
<li><a href="#dss_list"><list></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>
@@ -1069,6 +1070,44 @@
<!-- _______________________________________________________________________ -->
<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<State, 2> Vec1;
+ Vec1.push_back(FirstCondition);
+
+ PackedVector<State, 2> Vec2;
+ Vec2.push_back(SecondCondition);
+
+ Vec1 |= Vec2;
+ return Vec1[0]; // returns 'Both'.
+}
+</pre>
+</div>
+
+</div>
+
+<!-- _______________________________________________________________________ -->
+<h4>
<a name="dss_ilist_traits">ilist_traits</a>
</h4>
More information about the llvm-commits
mailing list