Depends on D25614
Details
Diff Detail
- Build Status
Buildable 1322 Build 1322: arc lint + arc unit
Event Timeline
utils/TableGen/Types.cpp | ||
---|---|---|
18 | Get rid of that if. | |
23 | Adapt the assert to the MaxSize. | |
utils/TableGen/Types.h | ||
20 | I would move a bit differently with the implementation. I would say that MaxSize is just for static assert and that it must be smaller or equal to 64. |
utils/TableGen/Types.cpp | ||
---|---|---|
18 | ||
utils/TableGen/Types.h | ||
20 | The MaxSize argument is only there to avoid a functional change in this particular change. Two of the getMinimalTypeForRange() implementations (RegisterInfoEmitter.cpp and AsmWriterEmitter.cpp) didn't allow uint64_t while the third did allow it. I suspect the only reason the limitation was there is that the relevant enums haven't grown large enough to warrant uint64_t yet. I was thinking that a follow-up patch could lift this limitation and remove the MaxSize argument but I didn't want to make that functional change a prerequisite of D25618. If you prefer, then I can make all three callers allow uint64_t in this change and remove MaxSize. |
utils/TableGen/Types.h | ||
---|---|---|
20 | I know :). |
utils/TableGen/Types.h | ||
---|---|---|
20 | I think I see what you're saying now. You're looking for something like this: assert((MaxSize == 64 ? Range <= 0xFFFFFFFFFFFFFFFFULL : Range <= 0xFFFFFFFFULL) && "Enum too large"); if (Range > 0xFFFFFFFFULL) return "uint64_t"; if (Range > 0xFFFF) return "uint32_t"; if (Range > 0xFF) return "uint16_t"; return "uint8_t"; |
LGTM
One nitpick.
Thanks Daniel!
utils/TableGen/Types.h | ||
---|---|---|
20 | Yep, that's it. |
I would move a bit differently with the implementation.
I would say that MaxSize is just for static assert and that it must be smaller or equal to 64.