[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 09:40:05 PDT 2023


erichkeane wrote:

>>I'm still thinking my way through a non_storable attribute, but on its face, it seems like it could be overkill. I suspect (but haven't measured!) that there is way more code out there that maps enumerations to bit-fields that expect all members of the enumeration to be possible to store than there is code that has a sentinel value not expected to be used. I kind of wonder if the correct answer to those more exceptional situations is "don't use this attribute, you're not doing a straight mapping in this case." Would it perhaps make sense to handle the common path first, see what usage experience finds in the wild, and then consider non_storable in the future?

This is my feeling on it too, and I think the 'proper' way ahead.  I am unopposed to a `non_storable` attribute, but I'd want to see more uses where it would be needed. 

https://github.com/llvm/llvm-project/pull/69104


More information about the cfe-commits mailing list