aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.ads
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2013-04-23 09:56:06 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-23 11:56:06 +0200
commit20a65dcba9a95dd40a8794324e833d5ff9f07544 (patch)
tree52f36a03473183940fba9d55f750c77e3fe696b1 /gcc/ada/sem_prag.ads
parent2e86f67917967e048d40e25579bf49414a85d8d9 (diff)
downloadgcc-20a65dcba9a95dd40a8794324e833d5ff9f07544.zip
gcc-20a65dcba9a95dd40a8794324e833d5ff9f07544.tar.gz
gcc-20a65dcba9a95dd40a8794324e833d5ff9f07544.tar.bz2
exp_prag.adb (Expand_Pragma_Check): Check for Assert rather than Assertion.
2013-04-23 Robert Dewar <dewar@adacore.com> * exp_prag.adb (Expand_Pragma_Check): Check for Assert rather than Assertion. * sem_prag.adb (Is_Valid_Assertion_Kind): Moved to spec (Effective_Name): New function (Analyze_Pragma, case Check): Disallow [Statement_]Assertions (Check_Kind): Implement Statement_Assertions (Check_Applicable_Policy): Use Effective_Name (Is_Valid_Assertion_Kind): Allow Statement_Assertions. * sem_prag.ads (Is_Valid_Assertion_Kind): Moved here from body (Effective_Name): New function. * sem_res.adb: Minor reformatting. * snames.ads-tmpl (Name_Statement_Assertions): New entry. * gnat_rm.texi: Add documentation of new assertion kind Statement_Assertions. From-SVN: r198187
Diffstat (limited to 'gcc/ada/sem_prag.ads')
-rw-r--r--gcc/ada/sem_prag.ads35
1 files changed, 26 insertions, 9 deletions
diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads
index 860005e..54ddc43 100644
--- a/gcc/ada/sem_prag.ads
+++ b/gcc/ada/sem_prag.ads
@@ -104,10 +104,30 @@ package Sem_Prag is
-- True have their analysis delayed until after the main program is parsed
-- and analyzed.
+ function Effective_Name (N : Node_Id) return Name_Id;
+ -- N is a pragma node or aspect specification node. This function returns
+ -- the name of the pragma or aspect, taking into account possible rewrites,
+ -- and also cases where a pragma comes from an attribute (in such cases,
+ -- the name can be different from the pragma name, e.g. Pre generates
+ -- a Precondition pragma. This also deals with the presence of 'Class
+ -- which results in one of the special names Name_uPre, Name_uPost,
+ -- Name_uInvariant, or Name_uType_Invariant being returned to represent
+ -- the corresponding aspects with x'Class names.
+
procedure Initialize;
-- Initializes data structures used for pragma processing. Must be called
-- before analyzing each new main source program.
+ function Is_Config_Static_String (Arg : Node_Id) return Boolean;
+ -- This is called for a configuration pragma that requires either string
+ -- literal or a concatenation of string literals. We cannot use normal
+ -- static string processing because it is too early in the case of the
+ -- pragma appearing in a configuration pragmas file. If Arg is of an
+ -- appropriate form, then this call obtains the string (doing any necessary
+ -- concatenations) and places it in Name_Buffer, setting Name_Len to its
+ -- 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_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
@@ -124,15 +144,12 @@ package Sem_Prag is
-- False is returned, then the argument is treated as an entity reference
-- to the operator.
- function Is_Config_Static_String (Arg : Node_Id) return Boolean;
- -- This is called for a configuration pragma that requires either string
- -- literal or a concatenation of string literals. We cannot use normal
- -- static string processing because it is too early in the case of the
- -- pragma appearing in a configuration pragmas file. If Arg is of an
- -- appropriate form, then this call obtains the string (doing any necessary
- -- concatenations) and places it in Name_Buffer, setting Name_Len to its
- -- 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_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
+ -- represented by the corresponding special names Name_uPre, Name_uPost,
+ -- Name_uInviarnat, and Name_uType_Invariant (_Pre, _Post, _Invariant,
+ -- and _Type_Invariant).
procedure Make_Aspect_For_PPC_In_Gen_Sub_Decl (Decl : Node_Id);
-- This routine makes aspects from precondition or postcondition pragmas