From: Chris Lattner Date: Tue, 23 Jul 2002 17:59:02 +0000 (+0000) Subject: Allow comparison against null X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f1ac9f6a7f70508c824c373e9d3d652a6e7bc418;p=oota-llvm.git Allow comparison against null git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3009 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h index 5c981ce8fef..57bf0eb31a7 100644 --- a/include/llvm/Analysis/DataStructure.h +++ b/include/llvm/Analysis/DataStructure.h @@ -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; } diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 5c981ce8fef..57bf0eb31a7 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -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; }