llvm.org GIT mirror llvm / fcec915
ADT: Prefer the LLVM_NODISCARD spelling Update functions annotated with LLVM_ATTRIBUTE_UNUSED_RESULT to use LLVM_NODISCARD instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284343 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 3 years ago
8 changed file(s) with 11 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
7676 return const_iterator(getBucketsEnd(), getBucketsEnd(), *this, true);
7777 }
7878
79 bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
79 LLVM_NODISCARD bool empty() const {
8080 return getNumEntries() == 0;
8181 }
8282 unsigned size() const { return getNumEntries(); }
115115 } while (!V.empty() && V.back() == T());
116116 }
117117
118 T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
118 LLVM_NODISCARD T pop_back_val() {
119119 T Ret = back();
120120 pop_back();
121121 return Ret;
4242 //
4343 // Interface is specified by p0052r2.
4444 template
45 detail::scope_exit::type>
46 LLVM_ATTRIBUTE_UNUSED_RESULT make_scope_exit(Callable &&F) {
45 LLVM_NODISCARD detail::scope_exit::type>
46 make_scope_exit(Callable &&F) {
4747 return detail::scope_exit::type>(
4848 std::forward(F));
4949 }
211211 vector_.pop_back();
212212 }
213213
214 T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
214 LLVM_NODISCARD T pop_back_val() {
215215 T Ret = back();
216216 pop_back();
217217 return Ret;
8383
8484 public:
8585 typedef unsigned size_type;
86 bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return size() == 0; }
86 LLVM_NODISCARD bool empty() const { return size() == 0; }
8787 size_type size() const { return NumNonEmpty - NumTombstones; }
8888
8989 void clear() {
4646 typedef size_t size_type;
4747 SmallSet() {}
4848
49 bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
49 LLVM_NODISCARD bool empty() const {
5050 return Vector.empty() && Set.empty();
5151 }
5252
5353 return size_t((char*)CapacityX - (char*)BeginX);
5454 }
5555
56 bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return BeginX == EndX; }
56 LLVM_NODISCARD bool empty() const { return BeginX == EndX; }
5757 };
5858
5959 template struct SmallVectorStorage;
375375 this->grow(N);
376376 }
377377
378 T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
378 LLVM_NODISCARD T pop_back_val() {
379379 T Result = ::std::move(this->back());
380380 this->pop_back();
381381 return Result;
123123 }
124124
125125 /// Check if the list is empty in constant time.
126 bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return Sentinel.empty(); }
126 LLVM_NODISCARD bool empty() const { return Sentinel.empty(); }
127127
128128 /// Calculate the size of the list in linear time.
129 size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const {
129 LLVM_NODISCARD size_type size() const {
130130 return std::distance(begin(), end());
131131 }
132132