aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2022-09-01 01:27:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-09-01 01:27:53 +0000
commit988e11cca1a101d346b5ad28a47c4bf1d9b5b32e (patch)
tree7c19dbf0509f14fdabc9ff45228b7c39c667a691
parentd9e814594978ab4380dda8cd462c8dae3e7587e2 (diff)
parent840588271f36e5a82467282afbf69e7b8ce2b591 (diff)
downloadllvm-988e11cca1a101d346b5ad28a47c4bf1d9b5b32e.tar.gz
Merge "Remove use of std::unary_function and std::binary_function" am: 07ef32e13a am: c04f8f956d am: 663a853484 am: 840588271f
Original change: https://android-review.googlesource.com/c/platform/external/llvm/+/2202076 Change-Id: I06761329153bb4190ba40fd8a2dcd03593fd8988 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--include/llvm/ADT/STLExtras.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h
index abd39dacc671..a032efa5cee2 100644
--- a/include/llvm/ADT/STLExtras.h
+++ b/include/llvm/ADT/STLExtras.h
@@ -36,7 +36,11 @@ namespace llvm {
//===----------------------------------------------------------------------===//
template<class Ty>
-struct identity : public std::unary_function<Ty, Ty> {
+struct identity {
+ // Android: In upstream LLVM, identity used to inherit from
+ // std::unary_function<Ty, Ty>, so use Ty here instead of Ty&.
+ using argument_type = Ty;
+ using result_type = Ty;
Ty &operator()(Ty &self) const {
return self;
}
@@ -46,14 +50,24 @@ struct identity : public std::unary_function<Ty, Ty> {
};
template<class Ty>
-struct less_ptr : public std::binary_function<Ty, Ty, bool> {
+struct less_ptr {
+ // Android: In upstream LLVM, less_ptr used to inherit from
+ // std::binary_function<Ty, Ty, bool>, so use Ty here instead of const Ty*.
+ using first_argument_type = Ty;
+ using second_argument_type = Ty;
+ using result_type = bool;
bool operator()(const Ty* left, const Ty* right) const {
return *left < *right;
}
};
template<class Ty>
-struct greater_ptr : public std::binary_function<Ty, Ty, bool> {
+struct greater_ptr {
+ // Android: In upstream LLVM, greater_ptr used to inherit from
+ // std::binary_function<Ty, Ty, bool>, so use Ty here instead of const Ty*.
+ using first_argument_type = Ty;
+ using second_argument_type = Ty;
+ using result_type = bool;
bool operator()(const Ty* left, const Ty* right) const {
return *right < *left;
}