diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-23 17:59:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-23 17:59:02 +0000 |
commit | f1ac9f6a7f70508c824c373e9d3d652a6e7bc418 (patch) | |
tree | 0d77a07a72eb9797843ecd5dca4a9b23fb3d0fc5 /include/llvm/Analysis | |
parent | dedcc76fdaec2dbbf8de27b8b1dce2e18d20fc59 (diff) | |
download | external_llvm-f1ac9f6a7f70508c824c373e9d3d652a6e7bc418.zip external_llvm-f1ac9f6a7f70508c824c373e9d3d652a6e7bc418.tar.gz external_llvm-f1ac9f6a7f70508c824c373e9d3d652a6e7bc418.tar.bz2 |
Allow comparison against null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/DataStructure.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h index 5c981ce..57bf0eb 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 5c981ce..57bf0eb 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; } |