[PATCH] D68827: [DDG] Data Dependence Graph - Pi Block
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 13:09:28 PST 2019
Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/include/llvm/ADT/EnumeratedArray.h:21
+template <typename ValueType, typename Enumeration,
+ Enumeration LargestEnum = Enumeration::Count,
+ typename IndexType = int,
----------------
bmahjour wrote:
> Meinersbur wrote:
> > Thanks a lot!
> >
> > Could we change `Enumeration::Count` to `Enumaration::Last`? The reason is that `::Count` introduces a new element that compilers warn about if unhanded in switch statements. That is, instead of
> > ```
> > enum class E {
> > One,
> > Two,
> > Count
> > };
> >
> > switch (e) {
> > case E::One:
> > case E::Two:
> > break;
> > }
> > ```
> > `warning: enumerator 'E::Count' in switch of enum 'E' is not handled`
> >
> > use
> >
> > ```
> > enum class E {
> > One,
> > Two,
> > Last = Two
> > };
> >
> > switch (e) {
> > case E::One:
> > case E::Two:
> > break;
> > }
> > ```
> Sure, will do.
@jdoerfert made me aware of the existence of `IndexedMap`. In contrast to `EnumeratedArray` it uses a SmallVector as storage (but 0 inline-storage), so I think `EnumeratedArray` has its own use-case.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68827/new/
https://reviews.llvm.org/D68827
More information about the llvm-commits
mailing list