summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ValueHandle.h
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-04-27 20:32:07 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-04-27 20:32:07 +0000
commit487fa01673a1d13331b7173e9e6812e72dd4361e (patch)
treebb40029cbd300931ba6a6ef01952c7bbe4939bde /include/llvm/Support/ValueHandle.h
parent01ecca20bf0f35d1fb464f098ac4bacbfeb06735 (diff)
downloadllvm-487fa01673a1d13331b7173e9e6812e72dd4361e.tar.gz
llvm-487fa01673a1d13331b7173e9e6812e72dd4361e.tar.bz2
llvm-487fa01673a1d13331b7173e9e6812e72dd4361e.tar.xz
Add tests for WeakVH and AssertingVH. These pointed out that the overloads for
the comparison operators were not only unnecessary in the presence of the implicit conversion; they caused ambiguous overload errors. So I deleted them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ValueHandle.h')
-rw-r--r--include/llvm/Support/ValueHandle.h44
1 files changed, 2 insertions, 42 deletions
diff --git a/include/llvm/Support/ValueHandle.h b/include/llvm/Support/ValueHandle.h
index a594e3a276..d003b0263c 100644
--- a/include/llvm/Support/ValueHandle.h
+++ b/include/llvm/Support/ValueHandle.h
@@ -39,7 +39,7 @@ public:
class ValueHandleBase {
friend class Value;
protected:
- /// HandleBaseKind - This indicates what base class the handle actually is.
+ /// HandleBaseKind - This indicates what sub class the handle actually is.
/// This is to avoid having a vtable for the light-weight handle pointers. The
/// fully generally Callback version does have a vtable.
enum HandleBaseKind {
@@ -87,20 +87,7 @@ public:
Value *operator->() const { return getValPtr(); }
Value &operator*() const { return *getValPtr(); }
-
- bool operator==(const Value *RHS) const { return VP == RHS; }
- bool operator==(const ValueHandleBase &RHS) const { return VP == RHS.VP; }
- bool operator!=(const Value *RHS) const { return VP != RHS; }
- bool operator!=(const ValueHandleBase &RHS) const { return VP != RHS.VP; }
- bool operator<(const Value *RHS) const { return VP < RHS; }
- bool operator<(const ValueHandleBase &RHS) const { return VP < RHS.VP; }
- bool operator>(const Value *RHS) const { return VP > RHS; }
- bool operator>(const ValueHandleBase &RHS) const { return VP > RHS.VP; }
- bool operator<=(const Value *RHS) const { return VP <= RHS; }
- bool operator<=(const ValueHandleBase &RHS) const { return VP <= RHS.VP; }
- bool operator>=(const Value *RHS) const { return VP >= RHS; }
- bool operator>=(const ValueHandleBase &RHS) const { return VP >= RHS.VP; }
-
+
protected:
Value *getValPtr() const { return VP; }
private:
@@ -198,33 +185,6 @@ public:
ValueTy *operator->() const { return getValPtr(); }
ValueTy &operator*() const { return *getValPtr(); }
-
- // Duplicate these from the base class so that they work when assertions are
- // off.
- bool operator==(const Value *RHS) const { return getValPtr() == RHS; }
- bool operator!=(const Value *RHS) const { return getValPtr() != RHS; }
- bool operator<(const Value *RHS) const { return getValPtr() < RHS; }
- bool operator>(const Value *RHS) const { return getValPtr() > RHS; }
- bool operator<=(const Value *RHS) const { return getValPtr() <= RHS; }
- bool operator>=(const Value *RHS) const { return getValPtr() >= RHS; }
- bool operator==(const AssertingVH &RHS) const {
- return getValPtr() == RHS.getValPtr();
- }
- bool operator!=(const AssertingVH &RHS) const {
- return getValPtr() != RHS.getValPtr();
- }
- bool operator<(const AssertingVH &RHS) const {
- return getValPtr() < RHS.getValPtr();
- }
- bool operator>(const AssertingVH &RHS) const {
- return getValPtr() > RHS.getValPtr();
- }
- bool operator<=(const AssertingVH &RHS) const {
- return getValPtr() <= RHS.getValPtr();
- }
- bool operator>=(const AssertingVH &RHS) const {
- return getValPtr() >= RHS.getValPtr();
- }
};
} // End llvm namespace