From 1c6269d3f574465892c1a100dfda81f4e3dba1ab Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Fri, 5 Jul 2013 10:57:42 +0000 Subject: aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect. 2013-07-05 Hristian Kirtchev * aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect. * aspects.ads: Add an entry for SPARK_Mode in tables Aspect_Id, Aspect_Argument, Aspect_Names. * atree.adb (Node32): New routine. (Set_Node32): New routine. * atree.ads (Node32): New routine. (Set_Node32): New routine. * einfo.adb: Node32 is now used as SPARK_Mode_Pragmas. (Set_SPARK_Mode_Pragmas): New routine. (SPARK_Mode_Pragmas): New routine. (Write_Field32_Name): Add and entry for SPARK_Modes. * einfo.ads: Add attribute SPARK_Mode_Pragmas along with usage in various entities. (Set_SPARK_Mode_Pragmas): New routine and pragma Inline. (SPARK_Mode_Pragmas): New routine and pragma Inline. * gnat_rm.texi: Add sections explaining the syntax and semantics of aspect/pragma SPARK_Mode. * gnat_ugn.texi: Add pragma SPARK_Mode to the list of configuration pragmas. * lib.adb (Set_SPARK_Mode_Pragma): New routine. (SPARK_Mode_Pragma): New routine. * lib.ads: Alphabetize the comments on fields of record Unit_Record. Add new field SPARK_Mode_Pragma along with comment on its usage. Update the layout of record Unit_Record. (Set_SPARK_Mode_Pragma): New routine and pragma Inline. (SPARK_Mode_Pragma): New routine and pragma Inline. * lib-load.adb (Create_Dummy_Package_Unit): Initialize field SPARK_Mode_Pragma. (Load_Main_Source): Initialize field SPARK_Mode_Pragma. (Load_Unit): Initialize field SPARK_Mode_Pragma. * lib-writ.adb (Add_Preprocessing_Dependency): Initialize field SPARK_Mode_Pragma. (Ensure_System_Dependency): Initialize field SPARK_Mode_Pragma. * opt.ads: Alphabetize verification flags. Store the compilation-wide SPARK mode in variable Global_SPARK_Mode. * par-prag.adb: Pragma SPARK_Mode does not need special processing by the parser. * sem_ch13.adb (Analyze_Aspect_Specifications): Convert aspect SPARK_Mode into a pragma. (Check_Aspect_At_Freeze_Point): Aspect SPARK_Mode does not need delayed processing. * sem_prag.adb: Add an entry for SPARK_Mode in table Sig_Flags. (Analyze_Pragma): Add processing for pragma SPARK_Mode. (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sem_prag.ads (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sinfo.ads: Update the comment on the usage of field Next_Pragma. * snames.ads-tmpl: Add new predefined name for SPARK_Mode and Auto. Add new pragma Id for SPARK_Mode. * types.ads: Add new type SPARK_Mode_Id. From-SVN: r200711 --- gcc/ada/sem_prag.ads | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/ada/sem_prag.ads') diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index 3b8a3bc..fcbe988 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -113,6 +113,9 @@ package Sem_Prag is -- True have their analysis delayed until after the main program is parsed -- and analyzed. + function Get_SPARK_Mode_Id (N : Node_Id) return SPARK_Mode_Id; + -- Given a pragma SPARK_Mode node, return the corresponding mode id + procedure Initialize; -- Initializes data structures used for pragma processing. Must be called -- before analyzing each new main source program. @@ -127,6 +130,10 @@ package Sem_Prag is -- length, and then returns True. If it is not of the correct form, then an -- appropriate error message is posted, and False is returned. + function Is_Elaboration_SPARK_Mode (N : Node_Id) return Boolean; + -- Determine whether pragma SPARK_Mode appears in the statement part of a + -- package body. + function Is_Non_Significant_Pragma_Reference (N : Node_Id) return Boolean; -- The node N is a node for an entity and the issue is whether the -- occurrence is a reference for the purposes of giving warnings about @@ -143,6 +150,10 @@ package Sem_Prag is -- False is returned, then the argument is treated as an entity reference -- to the operator. + function Is_Private_SPARK_Mode (N : Node_Id) return Boolean; + -- Determine whether pragma SPARK_Mode appears in the private part of a + -- package. + function Is_Valid_Assertion_Kind (Nam : Name_Id) return Boolean; -- Returns True if Nam is one of the names recognized as a valid assertion -- kind by the Assertion_Policy pragma. Note that the 'Class cases are -- cgit v1.1