Skip to content

Commit

Permalink
allow != to compare PointerUnion, we already support ==.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188582 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 16, 2013
1 parent d861b90 commit b282085
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/llvm/ADT/PointerUnion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit b282085

Please sign in to comment.