]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Add support for 'Object_Size to pragma Compile_Time_{Warning,Error}
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 1 Mar 2024 10:26:32 +0000 (11:26 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 17 May 2024 08:20:58 +0000 (10:20 +0200)
commitd7d49b2d58c709f15d51651119e325d8a56b5950
tree70326580ae0780e71405c3fde9b899717fcdf40d
parentb7483de99536c05983129d9ca28b53b575861078
ada: Add support for 'Object_Size to pragma Compile_Time_{Warning,Error}

With the same level as for 'Size, that is to say, full evaluation of the
boolean expressions it may be contained in and handling of private types.

gcc/ada/

* sem_attr.adb (Analyze_Attribute) <Attribute_Size>: Remove special
processing for pragma Compile_Time_{Warning,Error}.
(Eval_Attribute.Compile_Time_Known_Attribute): Set Is_Static on the
resulting value if In_Compile_Time_Warning_Or_Error is set.
(Eval_Attribute.Full_Type): New helper function.
(Eval_Attribute): Call Full_Type for type attributes.  Add handling
of Object_Size and adjust that of Max_Size_In_Storage_Elements in
the non-static case.
gcc/ada/sem_attr.adb