From: Chris Lattner Date: Fri, 16 Aug 2013 22:09:02 +0000 (+0000) Subject: allow != to compare PointerUnion, we already support ==. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b2820859240b8b8ad03384207ce896da60702f98;p=oota-llvm.git allow != to compare PointerUnion, we already support ==. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188582 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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