Index: include/llvm/ADT/STLExtras.h =================================================================== --- include/llvm/ADT/STLExtras.h +++ include/llvm/ADT/STLExtras.h @@ -57,7 +57,10 @@ //===----------------------------------------------------------------------===// template -struct identity : public std::unary_function { +struct identity { + using argument_type = Ty; + using result_type = Ty; + Ty &operator()(Ty &self) const { return self; } @@ -67,14 +70,22 @@ }; template -struct less_ptr : public std::binary_function { +struct less_ptr { + 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 -struct greater_ptr : public std::binary_function { +struct greater_ptr { + 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; } Index: include/llvm/CodeGen/LatencyPriorityQueue.h =================================================================== --- include/llvm/CodeGen/LatencyPriorityQueue.h +++ include/llvm/CodeGen/LatencyPriorityQueue.h @@ -22,7 +22,11 @@ class LatencyPriorityQueue; /// Sorting functions for the Available queue. - struct latency_sort : public std::binary_function { + struct latency_sort { + using first_argument_type = SUnit*; + using second_argument_type = SUnit*; + using result_Type = bool; + LatencyPriorityQueue *PQ; explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {} Index: include/llvm/CodeGen/MachineBasicBlock.h =================================================================== --- include/llvm/CodeGen/MachineBasicBlock.h +++ include/llvm/CodeGen/MachineBasicBlock.h @@ -762,8 +762,10 @@ 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 { +struct MBB2NumberFunctor { + using argument_type = const MachineBasicBlock*; + using result_type = unsigned; + unsigned operator()(const MachineBasicBlock *MBB) const { return MBB->getNumber(); } Index: include/llvm/CodeGen/ResourcePriorityQueue.h =================================================================== --- include/llvm/CodeGen/ResourcePriorityQueue.h +++ include/llvm/CodeGen/ResourcePriorityQueue.h @@ -28,7 +28,11 @@ class ResourcePriorityQueue; /// Sorting functions for the Available queue. - struct resource_sort : public std::binary_function { + struct resource_sort { + using first_argument_type = SUnit*; + using second_argument_type = SUnit*; + using result_type = bool; + ResourcePriorityQueue *PQ; explicit resource_sort(ResourcePriorityQueue *pq) : PQ(pq) {} Index: include/llvm/IR/Instructions.h =================================================================== --- include/llvm/IR/Instructions.h +++ include/llvm/IR/Instructions.h @@ -4195,11 +4195,10 @@ } public: - using DerefFnTy = std::pointer_to_unary_function; + using DerefFnTy = BasicBlock* (*)(Value *); using handler_iterator = mapped_iterator; using handler_range = iterator_range; - using ConstDerefFnTy = - std::pointer_to_unary_function; + using ConstDerefFnTy = const BasicBlock* (*)(const Value *); using const_handler_iterator = mapped_iterator; using const_handler_range = iterator_range; Index: include/llvm/Target/TargetRegisterInfo.h =================================================================== --- include/llvm/Target/TargetRegisterInfo.h +++ include/llvm/Target/TargetRegisterInfo.h @@ -1114,7 +1114,10 @@ }; // This is useful when building IndexedMaps keyed on virtual registers -struct VirtReg2IndexFunctor : public std::unary_function { +struct VirtReg2IndexFunctor { + using argument_type = unsigned; + using result_type = unsigned; + unsigned operator()(unsigned Reg) const { return TargetRegisterInfo::virtReg2Index(Reg); } Index: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp =================================================================== --- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1563,7 +1563,11 @@ namespace { class RegReductionPQBase; -struct queue_sort : public std::binary_function { +struct queue_sort { + using first_argument_type = SUnit*; + using second_argument_type = SUnit*; + using result_type = bool; + bool isReady(SUnit* SU, unsigned CurCycle) const { return true; } }; Index: utils/TableGen/SequenceToOffsetTable.h =================================================================== --- utils/TableGen/SequenceToOffsetTable.h +++ utils/TableGen/SequenceToOffsetTable.h @@ -37,7 +37,11 @@ // Define a comparator for SeqT that sorts a suffix immediately before a // sequence with that suffix. - struct SeqLess : public std::binary_function { + struct SeqLess { + using first_argument_type = SeqT; + using second_argument_type = SeqT; + using result_type = bool; + Less L; bool operator()(const SeqT &A, const SeqT &B) const { return std::lexicographical_compare(A.rbegin(), A.rend(),