[Ada] AI12-0311 New checks for language-defined units

Message ID 20200610133540.GA80805@adacore.com
State New
Headers show
Series
  • [Ada] AI12-0311 New checks for language-defined units
Related show

Commit Message

Pierre-Marie de Rodat June 10, 2020, 1:35 p.m.
This Ada 202x AI defines among other things new check names.  Recognize
them as no-ops for now.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-10  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* snames.ads-tmpl (Name_Characters_Assertion_Check,
	Name_Containers_Assertion_Check,
	Name_Interfaces_Assertion_Check, Name_IO_Assertion_Check,
	Name_Numerics_Assertion_Check, Name_Strings_Assertion_Check,
	Name_System_Assertion_Check): New constants.
	* types.ads (Characters_Assertion_Check,
	Containers_Assertion_Check, Interfaces_Assertion_Check,
	IO_Assertion_Check, Numerics_Assertion_Check,
	Strings_Assertion_Check, System_Assertion_Check): New constants.
	(All_Checks): Update accordingly.

Patch

--- gcc/ada/snames.ads-tmpl
+++ gcc/ada/snames.ads-tmpl
@@ -1206,21 +1206,28 @@  package Snames is
    Name_Alignment_Check                : constant Name_Id := N + $; -- GNAT
    Name_Allocation_Check               : constant Name_Id := N + $;
    Name_Atomic_Synchronization         : constant Name_Id := N + $; -- GNAT
+   Name_Characters_Assertion_Check     : constant Name_Id := N + $;
+   Name_Containers_Assertion_Check     : constant Name_Id := N + $;
    Name_Discriminant_Check             : constant Name_Id := N + $;
    Name_Division_Check                 : constant Name_Id := N + $;
    Name_Duplicated_Tag_Check           : constant Name_Id := N + $; -- GNAT
    Name_Elaboration_Check              : constant Name_Id := N + $;
    Name_Index_Check                    : constant Name_Id := N + $;
+   Name_Interfaces_Assertion_Check     : constant Name_Id := N + $;
+   Name_IO_Assertion_Check             : constant Name_Id := N + $;
    Name_Length_Check                   : constant Name_Id := N + $;
+   Name_Numerics_Assertion_Check       : constant Name_Id := N + $;
    Name_Overflow_Check                 : constant Name_Id := N + $;
    Name_Predicate_Check                : constant Name_Id := N + $; -- GNAT
+   Name_Program_Error_Check            : constant Name_Id := N + $;
    Name_Range_Check                    : constant Name_Id := N + $;
    Name_Storage_Check                  : constant Name_Id := N + $;
+   Name_Strings_Assertion_Check        : constant Name_Id := N + $;
+   Name_System_Assertion_Check         : constant Name_Id := N + $;
    Name_Tag_Check                      : constant Name_Id := N + $;
    Name_Validity_Check                 : constant Name_Id := N + $; -- GNAT
    Name_Container_Checks               : constant Name_Id := N + $; -- GNAT
    Name_Tampering_Check                : constant Name_Id := N + $; -- GNAT
-   Name_Program_Error_Check            : constant Name_Id := N + $;
    Name_Tasking_Check                  : constant Name_Id := N + $;
    Name_All_Checks                     : constant Name_Id := N + $;
    Last_Check_Name                     : constant Name_Id := N + $;

--- gcc/ada/types.ads
+++ gcc/ada/types.ads
@@ -668,32 +668,39 @@  package Types is
    No_Check_Id : constant := 0;
    --  Check_Id value used to indicate no check
 
-   Access_Check           : constant :=  1;
-   Accessibility_Check    : constant :=  2;
-   Alignment_Check        : constant :=  3;
-   Allocation_Check       : constant :=  4;
-   Atomic_Synchronization : constant :=  5;
-   Discriminant_Check     : constant :=  6;
-   Division_Check         : constant :=  7;
-   Duplicated_Tag_Check   : constant :=  8;
-   Elaboration_Check      : constant :=  9;
-   Index_Check            : constant := 10;
-   Length_Check           : constant := 11;
-   Overflow_Check         : constant := 12;
-   Predicate_Check        : constant := 13;
-   Range_Check            : constant := 14;
-   Storage_Check          : constant := 15;
-   Tag_Check              : constant := 16;
-   Validity_Check         : constant := 17;
-   Container_Checks       : constant := 18;
-   Tampering_Check        : constant := 19;
-   Program_Error_Check    : constant := 20;
-   Tasking_Check          : constant := 21;
+   Access_Check               : constant :=  1;
+   Accessibility_Check        : constant :=  2;
+   Alignment_Check            : constant :=  3;
+   Allocation_Check           : constant :=  4;
+   Atomic_Synchronization     : constant :=  5;
+   Characters_Assertion_Check : constant :=  6;
+   Containers_Assertion_Check : constant :=  7;
+   Discriminant_Check         : constant :=  8;
+   Division_Check             : constant :=  9;
+   Duplicated_Tag_Check       : constant := 10;
+   Elaboration_Check          : constant := 11;
+   Index_Check                : constant := 12;
+   Interfaces_Assertion_Check : constant := 13;
+   IO_Assertion_Check         : constant := 14;
+   Length_Check               : constant := 15;
+   Numerics_Assertion_Check   : constant := 16;
+   Overflow_Check             : constant := 17;
+   Predicate_Check            : constant := 18;
+   Program_Error_Check        : constant := 19;
+   Range_Check                : constant := 20;
+   Storage_Check              : constant := 21;
+   Strings_Assertion_Check    : constant := 22;
+   System_Assertion_Check     : constant := 23;
+   Tag_Check                  : constant := 24;
+   Validity_Check             : constant := 25;
+   Container_Checks           : constant := 26;
+   Tampering_Check            : constant := 27;
+   Tasking_Check              : constant := 28;
    --  Values used to represent individual predefined checks (including the
    --  setting of Atomic_Synchronization, which is implemented internally using
    --  a "check" whose name is Atomic_Synchronization).
 
-   All_Checks : constant := 22;
+   All_Checks : constant := 29;
    --  Value used to represent All_Checks value
 
    subtype Predefined_Check_Id is Check_Id range 1 .. All_Checks;
@@ -717,7 +724,8 @@  package Types is
    --  To add a new check type to GNAT, the following steps are required:
 
    --    1.  Add an entry to Snames spec for the new name
-   --    2.  Add an entry to the definition of Check_Id above
+   --    2.  Add an entry to the definition of Check_Id above (very important:
+   --        these definitions should be in the same order in Snames and here)
    --    3.  Add a new function to Checks to handle the new check test
    --    4.  Add a new Do_xxx_Check flag to Sinfo (if required)
    --    5.  Add appropriate checks for the new test