llvm.org GIT mirror llvm / 07d86e2
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 Benjamin Kramer 3 years ago
7 changed file(s) with 12 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
5555 // Extra additions to
5656 //===----------------------------------------------------------------------===//
5757
58 template
59 struct identity : public std::unary_function {
58 template struct identity {
59 using argument_type = Ty;
6060 Ty &operator()(Ty &self) const {
6161 return self;
6262 }
6565 }
6666 };
6767
68 template
69 struct less_ptr : public std::binary_function {
68 template struct less_ptr {
7069 bool operator()(const Ty* left, const Ty* right) const {
7170 return *left < *right;
7271 }
7372 };
7473
75 template
76 struct greater_ptr : public std::binary_function {
74 template struct greater_ptr {
7775 bool operator()(const Ty* left, const Ty* right) const {
7876 return *right < *left;
7977 }
2121 class LatencyPriorityQueue;
2222
2323 /// Sorting functions for the Available queue.
24 struct latency_sort : public std::binary_function {
24 struct latency_sort {
2525 LatencyPriorityQueue *PQ;
2626 explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}
2727
761761 raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
762762
763763 // This is useful when building IndexedMaps keyed on basic block pointers.
764 struct MBB2NumberFunctor :
765 public std::unary_function {
764 struct MBB2NumberFunctor {
765 using argument_type = const MachineBasicBlock *;
766766 unsigned operator()(const MachineBasicBlock *MBB) const {
767767 return MBB->getNumber();
768768 }
2727 class ResourcePriorityQueue;
2828
2929 /// Sorting functions for the Available queue.
30 struct resource_sort : public std::binary_function {
30 struct resource_sort {
3131 ResourcePriorityQueue *PQ;
3232 explicit resource_sort(ResourcePriorityQueue *pq) : PQ(pq) {}
3333
11231123 };
11241124
11251125 // This is useful when building IndexedMaps keyed on virtual registers
1126 struct VirtReg2IndexFunctor : public std::unary_function {
1126 struct VirtReg2IndexFunctor {
1127 using argument_type = unsigned;
11271128 unsigned operator()(unsigned Reg) const {
11281129 return TargetRegisterInfo::virtReg2Index(Reg);
11291130 }
15741574 namespace {
15751575 class RegReductionPQBase;
15761576
1577 struct queue_sort : public std::binary_function {
1577 struct queue_sort {
15781578 bool isReady(SUnit* SU, unsigned CurCycle) const { return true; }
15791579 };
15801580
3636
3737 // Define a comparator for SeqT that sorts a suffix immediately before a
3838 // sequence with that suffix.
39 struct SeqLess : public std::binary_function {
39 struct SeqLess {
4040 Less L;
4141 bool operator()(const SeqT &A, const SeqT &B) const {
4242 return std::lexicographical_compare(A.rbegin(), A.rend(),