Skip to content

Commit cdcf4bd

Browse files
committed
Fix PowerPC
1 parent cd16029 commit cdcf4bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

llvm/include/llvm/CodeGen/TargetRegisterInfo.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ class TargetSuperClassIterator
5555

5656
using iterator_adaptor_base::operator++;
5757

58+
bool operator==(const TargetSuperClassIterator &Other) const {
59+
// End can be represented either with a nullptr or with a ptr to
60+
// a sentinel value of ~0U. They must compare equal.
61+
bool SelfIsEnd = !I || *I == ~0U;
62+
bool OtherIsEnd = !Other.I || *Other.I == ~0U;
63+
if (SelfIsEnd && OtherIsEnd)
64+
return true;
65+
66+
return I == Other.I;
67+
}
68+
5869
/// Returns true if this iterator is not yet at the end.
5970
bool isValid() const { return I && *I != ~0U; }
6071
};

0 commit comments

Comments
 (0)