Allow comparison against null

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3009 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-07-23 17:59:02 +00:00
parent dedcc76fda
commit f1ac9f6a7f
2 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,9 @@ public:
bool operator==(const DSNode *Node) const { return N == Node; }
bool operator!=(const DSNode *Node) const { return N != Node; }
// Avoid having comparisons to null cause errors...
bool operator==(int X) const { return operator==((DSNode*)X); }
// Allow explicit conversion to DSNode...
DSNode *get() { return N; }
const DSNode *get() const { return N; }

View File

@ -57,6 +57,9 @@ public:
bool operator==(const DSNode *Node) const { return N == Node; }
bool operator!=(const DSNode *Node) const { return N != Node; }
// Avoid having comparisons to null cause errors...
bool operator==(int X) const { return operator==((DSNode*)X); }
// Allow explicit conversion to DSNode...
DSNode *get() { return N; }
const DSNode *get() const { return N; }