Allow comparison against null
authorChris Lattner <sabre@nondot.org>
Tue, 23 Jul 2002 17:59:02 +0000 (17:59 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 23 Jul 2002 17:59:02 +0000 (17:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3009 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DataStructure.h

index 5c981ce8fef5343ea686c8e91207302996f3a34c..57bf0eb31a7a14eb33f0e02139238cf27d4414c9 100644 (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; }
index 5c981ce8fef5343ea686c8e91207302996f3a34c..57bf0eb31a7a14eb33f0e02139238cf27d4414c9 100644 (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; }