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
This commit is contained in:
Justin Bogner 2016-10-16 20:42:34 +00:00
parent 097967f645
commit fcec9152da
8 changed files with 11 additions and 11 deletions

View File

@ -77,7 +77,7 @@ public:
return const_iterator(getBucketsEnd(), getBucketsEnd(), *this, true);
}
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
LLVM_NODISCARD bool empty() const {
return getNumEntries() == 0;
}
unsigned size() const { return getNumEntries(); }

View File

@ -116,7 +116,7 @@ public:
} while (!V.empty() && V.back() == T());
}
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
LLVM_NODISCARD T pop_back_val() {
T Ret = back();
pop_back();
return Ret;

View File

@ -43,8 +43,8 @@ public:
//
// Interface is specified by p0052r2.
template <typename Callable>
detail::scope_exit<typename std::decay<Callable>::type>
LLVM_ATTRIBUTE_UNUSED_RESULT make_scope_exit(Callable &&F) {
LLVM_NODISCARD detail::scope_exit<typename std::decay<Callable>::type>
make_scope_exit(Callable &&F) {
return detail::scope_exit<typename std::decay<Callable>::type>(
std::forward<Callable>(F));
}

View File

@ -212,7 +212,7 @@ public:
vector_.pop_back();
}
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
LLVM_NODISCARD T pop_back_val() {
T Ret = back();
pop_back();
return Ret;

View File

@ -84,7 +84,7 @@ protected:
public:
typedef unsigned size_type;
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return size() == 0; }
LLVM_NODISCARD bool empty() const { return size() == 0; }
size_type size() const { return NumNonEmpty - NumTombstones; }
void clear() {

View File

@ -47,7 +47,7 @@ public:
typedef size_t size_type;
SmallSet() {}
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
LLVM_NODISCARD bool empty() const {
return Vector.empty() && Set.empty();
}

View File

@ -54,7 +54,7 @@ public:
return size_t((char*)CapacityX - (char*)BeginX);
}
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return BeginX == EndX; }
LLVM_NODISCARD bool empty() const { return BeginX == EndX; }
};
template <typename T, unsigned N> struct SmallVectorStorage;
@ -376,7 +376,7 @@ public:
this->grow(N);
}
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
LLVM_NODISCARD T pop_back_val() {
T Result = ::std::move(this->back());
this->pop_back();
return Result;

View File

@ -124,10 +124,10 @@ public:
}
/// Check if the list is empty in constant time.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return Sentinel.empty(); }
LLVM_NODISCARD bool empty() const { return Sentinel.empty(); }
/// Calculate the size of the list in linear time.
size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const {
LLVM_NODISCARD size_type size() const {
return std::distance(begin(), end());
}