From b2820859240b8b8ad03384207ce896da60702f98 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 16 Aug 2013 22:09:02 +0000 Subject: [PATCH] allow != to compare PointerUnion, we already support ==. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188582 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/PointerUnion.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h index c1a6d744128..045cf2bd2ed 100644 --- a/include/llvm/ADT/PointerUnion.h +++ b/include/llvm/ADT/PointerUnion.h @@ -177,10 +177,17 @@ namespace llvm { }; template - bool operator==(PointerUnion lhs, PointerUnion rhs) { + static bool operator==(PointerUnion lhs, + PointerUnion rhs) { return lhs.getOpaqueValue() == rhs.getOpaqueValue(); } - + + template + static bool operator!=(PointerUnion lhs, + PointerUnion rhs) { + return lhs.getOpaqueValue() == rhs.getOpaqueValue(); + } + // Teach SmallPtrSet that PointerUnion is "basically a pointer", that has // # low bits available = min(PT1bits,PT2bits)-1. template -- 2.34.1