aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scos.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-01-06 10:30:31 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-01-06 10:30:31 +0100
commit0566484a15d36465693a4afb06538d63925579b4 (patch)
treeff4fe4260a64b68180a5c1b4cb5184120bf30148 /gcc/ada/scos.ads
parent72eaa365121eec76a29a0a231c4edfff28f2a250 (diff)
downloadgcc-0566484a15d36465693a4afb06538d63925579b4.zip
gcc-0566484a15d36465693a4afb06538d63925579b4.tar.gz
gcc-0566484a15d36465693a4afb06538d63925579b4.tar.bz2
[multiple changes]
2015-01-06 Pierre-Marie Derodat <derodat@adacore.com> * scos.ads: Update documentation about the SCO table build process and about table records format. * par_sco.ads (SCO_Record): Rename to SCO_Record_Raw. (SCO_Record_Filtered): New procedure. (Set_SCO_Logical_Operator): New procedure. (dsco): Update documentation. * par_sco.adb: Update library-level comments. (SCO_Generation_State_Type): New type. (SCO_Generation_State): New variable. (SCO_Raw_Table): New package instanciation. (Condition_Pragma_Hash_Table): Rename to SCO_Raw_Hash_Table. ("<"): New. (Tristate): New type. (Is_Logical_Operator): Return Tristate and update documentation. (Has_Decision): Update call to Is_Logical_Operator and complete documentation. (Set_Table_Entry): Rename to Set_Raw_Table_Entry, update comment, add an assertion for state checking and change references to SCO_Table into SCO_Raw_Table. (dsco): Refactor to dump the raw and the filtered tables. (Process_Decisions.Output_Decision_Operand): Handle putative short-circuit operators. (Process_Decisions.Output_Element): Update references to Set_Table_Entry and to Condition_Pragma_Hash_Table. (Process_Decisions.Process_Decision_Operand): Update call to Is_Logical_Operator. (Process_Decisions.Process_Node): Handle putative short-circuit operators and change references to SCO_Table into SCO_Raw_Table. (SCO_Output): Add an assertion for state checking and remove code that used to stamp out SCO entries. (SCO_Pragma_Disabled): Change reference to SCO_Table into SCO_Raw_Table. (SCO_Record): Rename to SCO_Record_Raw, add an assertion for state checking and change references to SCO_Table into SCO_Raw_Table. (Set_SCO_Condition): Add an assertion for state checking, update references to Condition_Pragma_Hash_Table and change references to SCO_Table into SCO_Raw_Table. (Set_SCO_Pragma_Enabled): Add an assertion for state checking and change references to SCO_Table into SCO_Raw_Table. (Set_SCO_Logical_Operator): New procedure. (Traverse_Declarations_Or_Statements.Set_Statement_Entry): Update references to Set_Table_Entry and to Condition_Pragma_Hash_Table. (SCO_Record_Fildered): New procedure. * gnat1drv.adb (Gnat1drv): Invoke the SCO filtering pass. * lib-writ.adb (Write_ALI): Invoke the SCO filtering pass and output SCOs. * par-load.adb (Load): Update reference to SCO_Record. * par.adb (Par): Update reference to SCO_Record. * put_scos.adb (Put_SCOs): Add an assertion to check that no putative SCO condition reaches this end. * sem_ch10.adb (Analyze_Proper_Body): Update reference to SCO_Record. * sem_res.adb (Resolve_Logical_Op): Validate putative SCOs when corresponding to an "and"/"or" operator affected by the Short_Circuit_And_Or pragma. 2015-01-06 Robert Dewar <dewar@adacore.com> * sem_ch8.adb (Analyze_Use_Package): Give more specific error msg for attempted USE of generic subprogram or subprogram. From-SVN: r219234
Diffstat (limited to 'gcc/ada/scos.ads')
-rw-r--r--gcc/ada/scos.ads14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads
index 0758f48..4f5bb57 100644
--- a/gcc/ada/scos.ads
+++ b/gcc/ada/scos.ads
@@ -443,8 +443,8 @@ 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). This is achieved by setting C1 to NUL for all
- -- SCO entries of the decision.
+ -- statement entries): this filtering is achieved during the second pass
+ -- of SCO generation (Par_SCO.SCO_Record_Filtered).
-- Decision (ASPECT)
-- C1 = 'A'
@@ -467,7 +467,7 @@ package SCOs is
-- Operator
-- C1 = '!', '&', '|'
- -- C2 = ' '
+ -- C2 = ' '/'?'/ (Logical operator/Putative one)
-- From = location of NOT/AND/OR token
-- To = No_Source_Location
-- Last = False
@@ -511,6 +511,14 @@ package SCOs is
To : Nat;
-- Ending index in SCO_Table of SCO information for this unit
+
+ -- Warning: SCOs generation (in Par_SCO) is done in two passes, which
+ -- communicate through an intermediate table (Par_SCO.SCO_Raw_Table).
+ -- Before the second pass executes, From and To actually reference index
+ -- in the internal table: SCO_Table is empty. Then, at the end of the
+ -- second pass, these indexes are updated in order to reference indexes
+ -- in SCO_Table.
+
end record;
package SCO_Unit_Table is new GNAT.Table (