allow != to compare PointerUnion, we already support ==.
authorChris Lattner <sabre@nondot.org>
Fri, 16 Aug 2013 22:09:02 +0000 (22:09 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Aug 2013 22:09:02 +0000 (22:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188582 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerUnion.h

index c1a6d74412874606209f5488e441118e49f6eaec..045cf2bd2ed577e60a80bc5e28a8f6ce71daa9fd 100644 (file)
@@ -177,10 +177,17 @@ namespace llvm {
   };
 
   template<typename PT1, typename PT2>
-  bool operator==(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+  static bool operator==(PointerUnion<PT1, PT2> lhs,
+                         PointerUnion<PT1, PT2> rhs) {
     return lhs.getOpaqueValue() == rhs.getOpaqueValue();
   }
-  
+
+  template<typename PT1, typename PT2>
+  static bool operator!=(PointerUnion<PT1, PT2> lhs,
+                         PointerUnion<PT1, PT2> rhs) {
+    return lhs.getOpaqueValue() == rhs.getOpaqueValue();
+  }
+
   // Teach SmallPtrSet that PointerUnion is "basically a pointer", that has
   // # low bits available = min(PT1bits,PT2bits)-1.
   template<typename PT1, typename PT2>