<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 14, 2017 at 11:34 AM Benjamin Kramer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Thu Sep 14 11:33:25 2017<br>
New Revision: 313287<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313287&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=313287&view=rev</a><br>
Log:<br>
Remove usages of deprecated std::unary_function and std::binary_function.<br>
<br>
These are removed in C++17. We still have some users of<br>
unary_function::argument_type, so just spell that typedef out. No<br>
functionality change intended.<br></blockquote><div><br>Given the point of the deprecation was to remove the use/need for these typedefs, it'd be good to remove that usage - anything that's relying on the typedefs won't be compatible with standard library functors which no longer provide them.<br><br>Are you planning to remove them?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Note that many of the argument types are actually wrong :)<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/ADT/STLExtras.h<br>
    llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h<br>
    llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h<br>
    llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h<br>
    llvm/trunk/include/llvm/Target/TargetRegisterInfo.h<br>
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp<br>
    llvm/trunk/utils/TableGen/SequenceToOffsetTable.h<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/STLExtras.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/STLExtras.h Thu Sep 14 11:33:25 2017<br>
@@ -56,8 +56,8 @@ using ValueOfRange = typename std::remov<br>
 //     Extra additions to <functional><br>
 //===----------------------------------------------------------------------===//<br>
<br>
-template<class Ty><br>
-struct identity : public std::unary_function<Ty, Ty> {<br>
+template <class Ty> struct identity {<br>
+  using argument_type = Ty;<br>
   Ty &operator()(Ty &self) const {<br>
     return self;<br>
   }<br>
@@ -66,15 +66,13 @@ struct identity : public std::unary_func<br>
   }<br>
 };<br>
<br>
-template<class Ty><br>
-struct less_ptr : public std::binary_function<Ty, Ty, bool> {<br>
+template <class Ty> struct less_ptr {<br>
   bool operator()(const Ty* left, const Ty* right) const {<br>
     return *left < *right;<br>
   }<br>
 };<br>
<br>
-template<class Ty><br>
-struct greater_ptr : public std::binary_function<Ty, Ty, bool> {<br>
+template <class Ty> struct greater_ptr {<br>
   bool operator()(const Ty* left, const Ty* right) const {<br>
     return *right < *left;<br>
   }<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/LatencyPriorityQueue.h Thu Sep 14 11:33:25 2017<br>
@@ -22,7 +22,7 @@ namespace llvm {<br>
   class LatencyPriorityQueue;<br>
<br>
   /// Sorting functions for the Available queue.<br>
-  struct latency_sort : public std::binary_function<SUnit*, SUnit*, bool> {<br>
+  struct latency_sort {<br>
     LatencyPriorityQueue *PQ;<br>
     explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Thu Sep 14 11:33:25 2017<br>
@@ -762,8 +762,8 @@ private:<br>
 raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);<br>
<br>
 // This is useful when building IndexedMaps keyed on basic block pointers.<br>
-struct MBB2NumberFunctor :<br>
-  public std::unary_function<const MachineBasicBlock*, unsigned> {<br>
+struct MBB2NumberFunctor {<br>
+  using argument_type = const MachineBasicBlock *;<br>
   unsigned operator()(const MachineBasicBlock *MBB) const {<br>
     return MBB->getNumber();<br>
   }<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/ResourcePriorityQueue.h Thu Sep 14 11:33:25 2017<br>
@@ -28,7 +28,7 @@ namespace llvm {<br>
   class ResourcePriorityQueue;<br>
<br>
   /// Sorting functions for the Available queue.<br>
-  struct resource_sort : public std::binary_function<SUnit*, SUnit*, bool> {<br>
+  struct resource_sort {<br>
     ResourcePriorityQueue *PQ;<br>
     explicit resource_sort(ResourcePriorityQueue *pq) : PQ(pq) {}<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original)<br>
+++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Thu Sep 14 11:33:25 2017<br>
@@ -1124,7 +1124,8 @@ public:<br>
 };<br>
<br>
 // This is useful when building IndexedMaps keyed on virtual registers<br>
-struct VirtReg2IndexFunctor : public std::unary_function<unsigned, unsigned> {<br>
+struct VirtReg2IndexFunctor {<br>
+  using argument_type = unsigned;<br>
   unsigned operator()(unsigned Reg) const {<br>
     return TargetRegisterInfo::virtReg2Index(Reg);<br>
   }<br>
<br>
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Sep 14 11:33:25 2017<br>
@@ -1575,7 +1575,7 @@ void ScheduleDAGRRList::ListScheduleBott<br>
 namespace {<br>
 class RegReductionPQBase;<br>
<br>
-struct queue_sort : public std::binary_function<SUnit*, SUnit*, bool> {<br>
+struct queue_sort {<br>
   bool isReady(SUnit* SU, unsigned CurCycle) const { return true; }<br>
 };<br>
<br>
<br>
Modified: llvm/trunk/utils/TableGen/SequenceToOffsetTable.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SequenceToOffsetTable.h?rev=313287&r1=313286&r2=313287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SequenceToOffsetTable.h?rev=313287&r1=313286&r2=313287&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/utils/TableGen/SequenceToOffsetTable.h (original)<br>
+++ llvm/trunk/utils/TableGen/SequenceToOffsetTable.h Thu Sep 14 11:33:25 2017<br>
@@ -37,7 +37,7 @@ class SequenceToOffsetTable {<br>
<br>
   // Define a comparator for SeqT that sorts a suffix immediately before a<br>
   // sequence with that suffix.<br>
-  struct SeqLess : public std::binary_function<SeqT, SeqT, bool> {<br>
+  struct SeqLess {<br>
     Less L;<br>
     bool operator()(const SeqT &A, const SeqT &B) const {<br>
       return std::lexicographical_compare(A.rbegin(), A.rend(),<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>