[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 15:41:37 PDT 2024


efriedma-quic wrote:

Because we're dealing specifically with integers, which are a pretty limited class, you could consider introducing new types into the type system instead.  Similar to how ext_vector_type works.  That's maybe easier than qualifiers in the sense that the code already deals with a bunch of arithmetic types... but you probably still have to touch a lot of places to get everything working.

Attributes on typedefs that don't correspond to a canonical type, like noderef/aligned/may_alias, are a constant source of issues; the user can't really tell if the attribute is actually working, or the compiler silently ate it.  My team spent a lot of time dealing with a user having trouble with the aligned attribute... they way they were using it was completely broken, but they didn't know it was broken until a new compiler started optimizing more aggressively.

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


More information about the cfe-commits mailing list