[PATCH] D152655: [MC] Merge MC[Sub,Super]RegIterator with mc_[sub,super]_reg_iterator

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 16:51:13 PDT 2023


barannikov88 added inline comments.


================
Comment at: llvm/include/llvm/MC/MCRegisterInfo.h:539
 class MCSubRegIndexIterator {
-  MCSubRegIterator SRIter;
+  MCSubRegIterator SRIter, SREndIter;
   const uint16_t *SRIndex;
----------------
dblaikie wrote:
> You could still expose `isValid` through `MCSubRegIterator` & avoid needing to add the second iterator here? No big deal either way, I guess.
I tried to make them look like the usual iterators, that don't usually provide such kind of methods. But I guess having this method here won't hurt, will add.

It would be nice if we had an adaptation of default_sentinel_t from C++20, then this method could be rutned into operator==. 



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152655



More information about the llvm-commits mailing list