From: Argyrios Kyrtzidis Date: Wed, 15 Jun 2011 19:56:01 +0000 (+0000) Subject: Document ADT/PackedVector.h in "Programmer's Manual" doc. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=81df089f860eebb4e1e44d089a441d62e4ff668b;p=oota-llvm.git Document ADT/PackedVector.h in "Programmer's Manual" doc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133077 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 3bec325d6ce..49a76ee4147 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -64,6 +64,7 @@ option
  • <deque>
  • <list>
  • llvm/ADT/ilist.h
  • +
  • llvm/ADT/PackedVector.h
  • Other Sequential Container Options
  • Set-Like Containers (std::set, SmallSet, SetVector, etc) @@ -1067,6 +1068,44 @@ Related classes of interest are explained in the following subsections: + +

    + llvm/ADT/PackedVector.h +

    + +
    +

    +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. +

    + +

    For example:

    + +
    +
    +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'.
    +}
    +
    +
    + +
    +

    ilist_traits