[Clang] Limit FunctionTypeExtraBitfields::NumExceptionType to 16 bits.
authorSander de Smalen <sander.desmalen@arm.com>
Mon, 5 Jun 2023 14:34:25 +0000 (14:34 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Tue, 6 Jun 2023 12:07:43 +0000 (12:07 +0000)
commit7013a751f170d829b35e7bb153d3334d144d5d54
tree7d054edbf5b154e9eac0e04d701b81e2af636391
parentb2817d22bb53e7fb8f1b7afa960b941f53e02591
[Clang] Limit FunctionTypeExtraBitfields::NumExceptionType to 16 bits.

In https://reviews.llvm.org/D127762#4102578 @erichkeane suggested to
limit size of this field to 16bits, such that the field that encodes the
SME attributes for a function fall within the alignment of the struct for
32bit platforms.

Standard implimits defines the minimum handlers per try block to 256,
which suggests that 16bits should be more than sufficient for most
programs. Erich also pointed out that exception specs are being
deprecated and are rarely used, so hopefully this change is safe to make.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D152140
clang/include/clang/AST/Type.h
clang/lib/AST/Type.cpp