See rational here: https://reviews.llvm.org/D71847#1922648
Thanks, yes, this is what I had in mind.
LLVM doesn't use the all uppercase naming style for enums, I'd use something like Count, Num, or Max.
One technique you could use to avoid the sentinel enum is to make an alias for the last enum, as is done for builtin types here:
This is the same instantiation, so we don't get any savings unless the same technique is applied here. I started by trying to change this type, but it was challenging, so I raised the issue to see if you'd be OK with it.
Worth fixing this formatting nit