[llvm] r369675 - Retire llvm::less_ptr. llvm::deref is much more flexible.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 10:32:16 PDT 2019


Author: d0k
Date: Thu Aug 22 10:32:16 2019
New Revision: 369675

URL: http://llvm.org/viewvc/llvm-project?rev=369675&view=rev
Log:
Retire llvm::less_ptr. llvm::deref is much more flexible.

Modified:
    llvm/trunk/include/llvm/ADT/STLExtras.h
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/include/llvm/ADT/STLExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=369675&r1=369674&r2=369675&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/STLExtras.h Thu Aug 22 10:32:16 2019
@@ -95,18 +95,6 @@ template <class Ty> struct identity {
   }
 };
 
-template <class Ty> struct less_ptr {
-  bool operator()(const Ty* left, const Ty* right) const {
-    return *left < *right;
-  }
-};
-
-template <class Ty> struct greater_ptr {
-  bool operator()(const Ty* left, const Ty* right) const {
-    return *right < *left;
-  }
-};
-
 /// An efficient, type-erasing, non-owning reference to a callable. This is
 /// intended for use as the type of a function parameter that is not used
 /// after the function in question returns.

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=369675&r1=369674&r2=369675&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Thu Aug 22 10:32:16 2019
@@ -1439,7 +1439,7 @@ void AsmMatcherInfo::buildOperandMatchIn
 
   /// Map containing a mask with all operands indices that can be found for
   /// that class inside a instruction.
-  typedef std::map<ClassInfo *, unsigned, less_ptr<ClassInfo>> OpClassMaskTy;
+  typedef std::map<ClassInfo *, unsigned, deref<std::less<>>> OpClassMaskTy;
   OpClassMaskTy OpClassMask;
 
   for (const auto &MI : Matchables) {




More information about the llvm-commits mailing list