aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scos.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 12:15:35 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 12:15:35 +0100
commit06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec (patch)
treec11a325254c0fff96f54a201f14e401c959ece35 /gcc/ada/scos.ads
parentaf31bd57502fd7fef4891658c74cb5fdb3c160e4 (diff)
downloadgcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.zip
gcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.tar.gz
gcc-06ad40d3ec3ec2333701f18f6dc6bbf0b9a023ec.tar.bz2
[multiple changes]
2012-12-05 Thomas Quinot <quinot@adacore.com> * par_sco.adb, scos.ads, put_scos.adb, put_scos.ads, get_scos.adb: Generation of SCOs for aspects. 2012-12-05 Thomas Quinot <quinot@adacore.com> * sem_prag.adb (Check_Precondition_Postcondition): Remove redundant call to Set_SCO_Pragma_Enabled (the pragma will be rewritten into a pragma Check later on, and the call will be made when processing the rewritten pragma). (Analyze_Pragma, case Pragma_Check): Omit call to Set_SCO_Pragma_Enabled if Split_PPC is set. 2012-12-05 Olivier Hainque <hainque@adacore.com> * tracebak.c: Add partial support for Lynx178. 2012-12-05 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Improve the error message related to loop assertions. 2012-12-05 Gary Dismukes <dismukes@adacore.com> * atree.ads: Minor reformatting. From-SVN: r194211
Diffstat (limited to 'gcc/ada/scos.ads')
-rw-r--r--gcc/ada/scos.ads52
1 files changed, 36 insertions, 16 deletions
diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads
index 076a66e..0082099 100644
--- a/gcc/ada/scos.ads
+++ b/gcc/ada/scos.ads
@@ -28,11 +28,8 @@
-- the ALI file, and by Get_SCO/Put_SCO to read and write the text form that
-- is used in the ALI file.
-with Snames; use Snames;
--- Note: used for Pragma_Id only, no other feature from Snames should be used,
--- as a simplified version is maintained in Xcov.
-
-with Types; use Types;
+with Namet; use Namet;
+with Types; use Types;
with GNAT.Table;
@@ -248,18 +245,21 @@ package SCOs is
-- C* sloc expression
- -- Here * is one of the following characters:
+ -- Here * is one of the following:
- -- E decision in EXIT WHEN statement
- -- G decision in entry guard
- -- I decision in IF statement or if expression
- -- P decision in pragma Assert/Check/Pre_Condition/Post_Condition
- -- W decision in WHILE iteration scheme
- -- X decision appearing in some other expression context
+ -- E decision in EXIT WHEN statement
+ -- G decision in entry guard
+ -- I decision in IF statement or if expression
+ -- P decision in pragma Assert / Check / Pre/Post_Condition
+ -- A[name] decision in aspect Pre/Post (aspect name optional)
+ -- W decision in WHILE iteration scheme
+ -- X decision in some other expression context
-- For E, G, I, P, W, sloc is the source location of the EXIT, ENTRY, IF,
-- PRAGMA or WHILE token, respectively
+ -- For A sloc is the source location of the aspect identifier
+
-- For X, sloc is omitted
-- The expression is a prefix polish form indicating the structure of
@@ -369,10 +369,12 @@ package SCOs is
Pragma_Sloc : Source_Ptr := No_Location;
-- For the statement SCO for a pragma, or for any expression SCO nested
-- in a pragma Debug/Assert/PPC, location of PRAGMA token (used for
- -- control of SCO output, value not recorded in ALI file).
+ -- control of SCO output, value not recorded in ALI file). For the
+ -- decision SCO for an aspect, or for any expression SCO nested in an
+ -- aspect, location of aspect identifier token (likewise).
- Pragma_Name : Pragma_Id := Unknown_Pragma;
- -- For the statement SCO for a pragma, gives the pragma name
+ Pragma_Aspect_Name : Name_Id := No_Name;
+ -- For the SCO for a pragma/aspect, gives the pragma/apsect name
end record;
package SCO_Table is new GNAT.Table (
@@ -382,6 +384,11 @@ package SCOs is
Table_Initial => 500,
Table_Increment => 300);
+ Is_Decision : constant array (Character) of Boolean :=
+ ('E' | 'G' | 'I' | 'P' | 'A' | 'W' | 'X' => True,
+ others => False);
+ -- Indicates which C1 values correspond to decisions
+
-- The SCO_Table_Entry values appear as follows:
-- Statements
@@ -432,7 +439,20 @@ package SCOs is
-- SCO contexts, the only pragmas with decisions are Assert, Check,
-- dyadic Debug, Precondition and Postcondition). These entries will
-- be omitted in output if the pragma is disabled (see comments for
- -- statement entries).
+ -- statement entries). This is achieved by setting C1 to NUL for all
+ -- SCO entries of the decision.
+
+ -- Decision (ASPECT)
+ -- C1 = 'A'
+ -- C2 = ' '
+ -- From = aspect identifier
+ -- To = No_Source_Location
+ -- Last = unused
+
+ -- Note: when the parse tree is first scanned, we unconditionally build a
+ -- pragma decision entry for any decision in an aspect (Pre/Post/
+ -- [Type_]Invariant/[Static_|Dynamic_]Predicate). Entries for disabled
+ -- Pre/Post aspects will be omitted from output.
-- Decision (Expression)
-- C1 = 'X'