llvm.org GIT mirror llvm / 5d37976
Clean up these doxygen comments to follow the proposed new style. This also makes it more consistent with Clang and several passes' doxygen style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165064 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 7 years ago
1 changed file(s) with 22 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
2626
2727 namespace llvm {
2828
29 /// \brief A vector that has set insertion semantics.
30 ///
2931 /// This adapter class provides a way to keep a set of things that also has the
3032 /// property of a deterministic iteration order. The order of iteration is the
3133 /// order of insertion.
32 /// @brief A vector that has set insertion semantics.
3334 template ,
3435 typename Set = SmallSet >
3536 class SetVector {
4445 typedef typename vector_type::const_iterator const_iterator;
4546 typedef typename vector_type::size_type size_type;
4647
47 /// @brief Construct an empty SetVector
48 /// \brief Construct an empty SetVector
4849 SetVector() {}
4950
50 /// @brief Initialize a SetVector with a range of elements
51 /// \brief Initialize a SetVector with a range of elements
5152 template
5253 SetVector(It Start, It End) {
5354 insert(Start, End);
5455 }
5556
56 /// @brief Determine if the SetVector is empty or not.
57 /// \brief Determine if the SetVector is empty or not.
5758 bool empty() const {
5859 return vector_.empty();
5960 }
6061
61 /// @brief Determine the number of elements in the SetVector.
62 /// \brief Determine the number of elements in the SetVector.
6263 size_type size() const {
6364 return vector_.size();
6465 }
6566
66 /// @brief Get an iterator to the beginning of the SetVector.
67 /// \brief Get an iterator to the beginning of the SetVector.
6768 iterator begin() {
6869 return vector_.begin();
6970 }
7071
71 /// @brief Get a const_iterator to the beginning of the SetVector.
72 /// \brief Get a const_iterator to the beginning of the SetVector.
7273 const_iterator begin() const {
7374 return vector_.begin();
7475 }
7576
76 /// @brief Get an iterator to the end of the SetVector.
77 /// \brief Get an iterator to the end of the SetVector.
7778 iterator end() {
7879 return vector_.end();
7980 }
8081
81 /// @brief Get a const_iterator to the end of the SetVector.
82 /// \brief Get a const_iterator to the end of the SetVector.
8283 const_iterator end() const {
8384 return vector_.end();
8485 }
8586
86 /// @brief Return the last element of the SetVector.
87 /// \brief Return the last element of the SetVector.
8788 const T &back() const {
8889 assert(!empty() && "Cannot call back() on empty SetVector!");
8990 return vector_.back();
9091 }
9192
92 /// @brief Index into the SetVector.
93 /// \brief Index into the SetVector.
9394 const_reference operator[](size_type n) const {
9495 assert(n < vector_.size() && "SetVector access out of range!");
9596 return vector_[n];
9697 }
9798
98 /// @returns true iff the element was inserted into the SetVector.
99 /// @brief Insert a new element into the SetVector.
99 /// \brief Insert a new element into the SetVector.
100 /// \returns true iff the element was inserted into the SetVector.
100101 bool insert(const value_type &X) {
101102 bool result = set_.insert(X);
102103 if (result)
104105 return result;
105106 }
106107
107 /// @brief Insert a range of elements into the SetVector.
108 /// \brief Insert a range of elements into the SetVector.
108109 template
109110 void insert(It Start, It End) {
110111 for (; Start != End; ++Start)
112113 vector_.push_back(*Start);
113114 }
114115
115 /// @brief Remove an item from the set vector.
116 /// \brief Remove an item from the set vector.
116117 bool remove(const value_type& X) {
117118 if (set_.erase(X)) {
118119 typename vector_type::iterator I =
125126 }
126127
127128
128 /// @returns 0 if the element is not in the SetVector, 1 if it is.
129 /// @brief Count the number of elements of a given key in the SetVector.
129 /// \brief Count the number of elements of a given key in the SetVector.
130 /// \returns 0 if the element is not in the SetVector, 1 if it is.
130131 size_type count(const key_type &key) const {
131132 return set_.count(key);
132133 }
133134
134 /// @brief Completely clear the SetVector
135 /// \brief Completely clear the SetVector
135136 void clear() {
136137 set_.clear();
137138 vector_.clear();
138139 }
139140
140 /// @brief Remove the last element of the SetVector.
141 /// \brief Remove the last element of the SetVector.
141142 void pop_back() {
142143 assert(!empty() && "Cannot remove an element from an empty SetVector!");
143144 set_.erase(back());
163164 vector_type vector_; ///< The vector.
164165 };
165166
166 /// SmallSetVector - A SetVector that performs no allocations if smaller than
167 /// \brief A SetVector that performs no allocations if smaller than
167168 /// a certain size.
168169 template
169170 class SmallSetVector : public SetVector, SmallSet > {
170171 public:
171172 SmallSetVector() {}
172173
173 /// @brief Initialize a SmallSetVector with a range of elements
174 /// \brief Initialize a SmallSetVector with a range of elements
174175 template
175176 SmallSetVector(It Start, It End) {
176177 this->insert(Start, End);