[PATCH] D81597: Overload != operator, make overloaded - operator const, for libunwind::EHABISectionIterator.

Chad Duffin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 13:21:44 PDT 2020


chadduffin updated this revision to Diff 269958.
chadduffin added a comment.

Full context is now provided with the diff, and the recommended change of updating the overloaded - operator instead of overloading it again has been made.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81597/new/

https://reviews.llvm.org/D81597

Files:
  libunwind/src/UnwindCursor.hpp


Index: libunwind/src/UnwindCursor.hpp
===================================================================
--- libunwind/src/UnwindCursor.hpp
+++ libunwind/src/UnwindCursor.hpp
@@ -1275,7 +1275,7 @@
   _Self operator+(size_t a) { _Self out = *this; out._i += a; return out; }
   _Self operator-(size_t a) { assert(_i >= a); _Self out = *this; out._i -= a; return out; }
 
-  size_t operator-(const _Self& other) { return _i - other._i; }
+  size_t operator-(const _Self& other) const { return _i - other._i; }
 
   bool operator==(const _Self& other) const {
     assert(_addressSpace == other._addressSpace);
@@ -1283,6 +1283,12 @@
     return _i == other._i;
   }
 
+  bool operator!=(const _Self& other) const {
+    assert(_addressSpace == other._addressSpace);
+    assert(_sects == other._sects);
+    return _i != other._i;
+  }
+
   typename A::pint_t operator*() const { return functionAddress(); }
 
   typename A::pint_t functionAddress() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81597.269958.patch
Type: text/x-patch
Size: 957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200610/ac3aca43/attachment.bin>


More information about the llvm-commits mailing list