summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/ADT/DenseMap.h2
-rw-r--r--llvm/include/llvm/ADT/PriorityWorklist.h2
-rw-r--r--llvm/include/llvm/ADT/ScopeExit.h4
-rw-r--r--llvm/include/llvm/ADT/SetVector.h2
-rw-r--r--llvm/include/llvm/ADT/SmallPtrSet.h2
-rw-r--r--llvm/include/llvm/ADT/SmallSet.h2
-rw-r--r--llvm/include/llvm/ADT/SmallVector.h4
-rw-r--r--llvm/include/llvm/ADT/simple_ilist.h4
8 files changed, 11 insertions, 11 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index f3910b1fb9f..1eb9abcbf12 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -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(); }
diff --git a/llvm/include/llvm/ADT/PriorityWorklist.h b/llvm/include/llvm/ADT/PriorityWorklist.h
index 9dd575fa96b..511606b1fd8 100644
--- a/llvm/include/llvm/ADT/PriorityWorklist.h
+++ b/llvm/include/llvm/ADT/PriorityWorklist.h
@@ -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;
diff --git a/llvm/include/llvm/ADT/ScopeExit.h b/llvm/include/llvm/ADT/ScopeExit.h
index 28a1124773d..4e64352c77d 100644
--- a/llvm/include/llvm/ADT/ScopeExit.h
+++ b/llvm/include/llvm/ADT/ScopeExit.h
@@ -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));
}
diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h
index 01d38a8f3b9..455f8a89e10 100644
--- a/llvm/include/llvm/ADT/SetVector.h
+++ b/llvm/include/llvm/ADT/SetVector.h
@@ -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;
diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h
index eaed6aa05dc..1f8571a851e 100644
--- a/llvm/include/llvm/ADT/SmallPtrSet.h
+++ b/llvm/include/llvm/ADT/SmallPtrSet.h
@@ -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() {
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index aaa5ff0ae93..07bdf0c33df 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -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();
}
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 94035797e57..996f56f0f54 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -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;
diff --git a/llvm/include/llvm/ADT/simple_ilist.h b/llvm/include/llvm/ADT/simple_ilist.h
index 9235bad6ab3..a1ab5917084 100644
--- a/llvm/include/llvm/ADT/simple_ilist.h
+++ b/llvm/include/llvm/ADT/simple_ilist.h
@@ -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());
}
OpenPOWER on IntegriCloud