summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-09-14 18:33:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-09-14 18:33:25 +0000
commit591aac7cdfa2f536c3bd7161c2c638fa38b4f913 (patch)
treef37d2ee85e884d46fd100cbd02b2a21826c4f73d /llvm
parent1f4cdcfec93e3c6fa7d9ccd552c6b48fab6831cc (diff)
downloadbcm5719-llvm-591aac7cdfa2f536c3bd7161c2c638fa38b4f913.tar.gz
bcm5719-llvm-591aac7cdfa2f536c3bd7161c2c638fa38b4f913.zip
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 :) llvm-svn: 313287
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/STLExtras.h10
-rw-r--r--llvm/include/llvm/CodeGen/LatencyPriorityQueue.h2
-rw-r--r--llvm/include/llvm/CodeGen/MachineBasicBlock.h4
-rw-r--r--llvm/include/llvm/CodeGen/ResourcePriorityQueue.h2
-rw-r--r--llvm/include/llvm/Target/TargetRegisterInfo.h3
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp2
-rw-r--r--llvm/utils/TableGen/SequenceToOffsetTable.h2
7 files changed, 12 insertions, 13 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 83f289c42a2..6c238df284a 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -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;
}
diff --git a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
index f347f66e098..988e6d6cb3a 100644
--- a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
@@ -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) {}
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
index 17c88a3e590..51a0d96deda 100644
--- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
@@ -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();
}
diff --git a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
index 9c8f5f487d3..1a4f994259d 100644
--- a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
@@ -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) {}
diff --git a/llvm/include/llvm/Target/TargetRegisterInfo.h b/llvm/include/llvm/Target/TargetRegisterInfo.h
index bd0c6032d53..afa6a89a890 100644
--- a/llvm/include/llvm/Target/TargetRegisterInfo.h
+++ b/llvm/include/llvm/Target/TargetRegisterInfo.h
@@ -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);
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index 83324f869fb..53ef28e473a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -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; }
};
diff --git a/llvm/utils/TableGen/SequenceToOffsetTable.h b/llvm/utils/TableGen/SequenceToOffsetTable.h
index e026b1c9fbf..2b8f66a3bf3 100644
--- a/llvm/utils/TableGen/SequenceToOffsetTable.h
+++ b/llvm/utils/TableGen/SequenceToOffsetTable.h
@@ -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(),
OpenPOWER on IntegriCloud