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; }