[lld] r259431 - Add operator== for DefinedAtom::reference_iterator. NFC.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 1 15:05:21 PST 2016
Author: pete
Date: Mon Feb 1 17:05:20 2016
New Revision: 259431
URL: http://llvm.org/viewvc/llvm-project?rev=259431&view=rev
Log:
Add operator== for DefinedAtom::reference_iterator. NFC.
This will be used by a future commit which wanted to compare iterators
for equality.
Also changed operator!= to be in terms of the new operator==
Modified:
lld/trunk/include/lld/Core/DefinedAtom.h
Modified: lld/trunk/include/lld/Core/DefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/DefinedAtom.h?rev=259431&r1=259430&r2=259431&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/DefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/DefinedAtom.h Mon Feb 1 17:05:20 2016
@@ -308,8 +308,12 @@ public:
return _atom.derefIterator(_it);
}
+ bool operator==(const reference_iterator &other) const {
+ return _it == other._it;
+ }
+
bool operator!=(const reference_iterator &other) const {
- return _it != other._it;
+ return !(*this == other);
}
reference_iterator &operator++() {
More information about the llvm-commits
mailing list