mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-02 02:22:31 +00:00
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:
parent
097967f645
commit
fcec9152da
@ -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(); }
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user