[PATCH] D103900: [llvm] Add enum iteration to Sequence

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 04:39:02 PDT 2021


gchatelet marked an inline comment as done.
gchatelet added inline comments.


================
Comment at: llvm/include/llvm/ADT/Sequence.h:159
+      // This assertion forbids overflow of `PastEndValue`.
+      assert(End != std::numeric_limits<raw_type>::max() &&
+             "Forbidden End value for seq_inclusive.");
----------------
courbet wrote:
> So you can't `iota_range` and enum with `uint8_t` underlying type and 256 values ? That seems a bit artificial.
> Maybe we could always use `intmax_t` (resp. `uintmax_t` for unsigned underlying types) as raw_type ?
> So you can't `iota_range` and enum with `uint8_t` underlying type and 256 values ? That seems a bit artificial.
> Maybe we could always use `intmax_t` (resp. `uintmax_t` for unsigned underlying types) as raw_type ?

Fair enough. I'm slightly concerned about integer promotion/conversion rules but it //should be safe// (famous last words).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103900



More information about the llvm-commits mailing list