From f1ac9f6a7f70508c824c373e9d3d652a6e7bc418 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 23 Jul 2002 17:59:02 +0000 Subject: [PATCH] Allow comparison against null git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3009 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/DataStructure.h | 3 +++ include/llvm/Analysis/DataStructure/DataStructure.h | 3 +++ 2 files changed, 6 insertions(+) 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; }