mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-01 16:22:41 +00:00
Remove usages of deprecated std::unary_function and std::binary_function.
These are removed in C++17. We still have some users of unary_function::argument_type, so just spell that typedef out. No functionality change intended. Note that many of the argument types are actually wrong :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d43fa8b05
commit
07d86e274d
@ -56,8 +56,8 @@ using ValueOfRange = typename std::remove_reference<decltype(
|
||||
// Extra additions to <functional>
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
template<class Ty>
|
||||
struct identity : public std::unary_function<Ty, Ty> {
|
||||
template <class Ty> struct identity {
|
||||
using argument_type = Ty;
|
||||
Ty &operator()(Ty &self) const {
|
||||
return self;
|
||||
}
|
||||
@ -66,15 +66,13 @@ struct identity : public std::unary_function<Ty, Ty> {
|
||||
}
|
||||
};
|
||||
|
||||
template<class Ty>
|
||||
struct less_ptr : public std::binary_function<Ty, Ty, bool> {
|
||||
template <class Ty> struct less_ptr {
|
||||
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> {
|
||||
template <class Ty> struct greater_ptr {
|
||||
bool operator()(const Ty* left, const Ty* right) const {
|
||||
return *right < *left;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace llvm {
|
||||
class LatencyPriorityQueue;
|
||||
|
||||
/// Sorting functions for the Available queue.
|
||||
struct latency_sort : public std::binary_function<SUnit*, SUnit*, bool> {
|
||||
struct latency_sort {
|
||||
LatencyPriorityQueue *PQ;
|
||||
explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}
|
||||
|
||||
|
@ -762,8 +762,8 @@ private:
|
||||
raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
|
||||
|
||||
// This is useful when building IndexedMaps keyed on basic block pointers.
|
||||
struct MBB2NumberFunctor :
|
||||
public std::unary_function<const MachineBasicBlock*, unsigned> {
|
||||
struct MBB2NumberFunctor {
|
||||
using argument_type = const MachineBasicBlock *;
|
||||
unsigned operator()(const MachineBasicBlock *MBB) const {
|
||||
return MBB->getNumber();
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace llvm {
|
||||
class ResourcePriorityQueue;
|
||||
|
||||
/// Sorting functions for the Available queue.
|
||||
struct resource_sort : public std::binary_function<SUnit*, SUnit*, bool> {
|
||||
struct resource_sort {
|
||||
ResourcePriorityQueue *PQ;
|
||||
explicit resource_sort(ResourcePriorityQueue *pq) : PQ(pq) {}
|
||||
|
||||
|
@ -1124,7 +1124,8 @@ public:
|
||||
};
|
||||
|
||||
// This is useful when building IndexedMaps keyed on virtual registers
|
||||
struct VirtReg2IndexFunctor : public std::unary_function<unsigned, unsigned> {
|
||||
struct VirtReg2IndexFunctor {
|
||||
using argument_type = unsigned;
|
||||
unsigned operator()(unsigned Reg) const {
|
||||
return TargetRegisterInfo::virtReg2Index(Reg);
|
||||
}
|
||||
|
@ -1575,7 +1575,7 @@ void ScheduleDAGRRList::ListScheduleBottomUp() {
|
||||
namespace {
|
||||
class RegReductionPQBase;
|
||||
|
||||
struct queue_sort : public std::binary_function<SUnit*, SUnit*, bool> {
|
||||
struct queue_sort {
|
||||
bool isReady(SUnit* SU, unsigned CurCycle) const { return true; }
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ class SequenceToOffsetTable {
|
||||
|
||||
// Define a comparator for SeqT that sorts a suffix immediately before a
|
||||
// sequence with that suffix.
|
||||
struct SeqLess : public std::binary_function<SeqT, SeqT, bool> {
|
||||
struct SeqLess {
|
||||
Less L;
|
||||
bool operator()(const SeqT &A, const SeqT &B) const {
|
||||
return std::lexicographical_compare(A.rbegin(), A.rend(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user