summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-26 13:29:46 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-26 13:29:46 +0000
commit3a4c6bc7a7d149b818db253716dcde2f22ed6914 (patch)
treec2ac09216cbd9c982a2daebb7d4a7b50e5df5d2e /gcc/ada
parent997f78fd68ddb86fc195922ecbc0ef4fc077715f (diff)
downloadgcc-3a4c6bc7a7d149b818db253716dcde2f22ed6914.tar.gz
2010-01-26 Robert Dewar <dewar@adacore.com>
* par_sco.adb (Traverse_Declarations_Or_Statements): Separate F/W qualifiers for FOR/WHILE loops * scos.ads: Use separate type letters F/W for for/while loops git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156245 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/par_sco.adb17
-rw-r--r--gcc/ada/scos.ads12
3 files changed, 27 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f8261fbea73..0cb26f2e40b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2010-01-26 Robert Dewar <dewar@adacore.com>
+ * par_sco.adb (Traverse_Declarations_Or_Statements): Separate F/W
+ qualifiers for FOR/WHILE loops
+ * scos.ads: Use separate type letters F/W for for/while loops
+
+2010-01-26 Robert Dewar <dewar@adacore.com>
+
* get_scos.adb (Get_SCOs): Implement new form of CS entries (multiple
entries per line, one for each statement in the sequence).
* par_sco.adb (Traverse_Declarations_Or_Statements): Increase array
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb
index e0e9318076c..e9ed4b3a51c 100644
--- a/gcc/ada/par_sco.adb
+++ b/gcc/ada/par_sco.adb
@@ -938,7 +938,7 @@ package body Par_SCO is
-- any decisions in the exit statement expression.
when N_Exit_Statement =>
- Extend_Statement_Sequence (N, ' ');
+ Extend_Statement_Sequence (N, 'E');
Set_Statement_Entry;
Process_Decisions (Condition (N), 'E');
@@ -1043,16 +1043,25 @@ package body Par_SCO is
when N_Loop_Statement =>
if Present (Iteration_Scheme (N)) then
+
+ -- If iteration scheme present, extend the current
+ -- statement sequence to include the iteration scheme
+ -- and process any decisions it contains.
+
declare
ISC : constant Node_Id := Iteration_Scheme (N);
begin
- Extend_Statement_Sequence (N, ISC, 'F');
+ -- While statement
if Present (Condition (ISC)) then
- Process_Decisions
- (Condition (ISC), 'W');
+ Extend_Statement_Sequence (N, ISC, 'W');
+ Process_Decisions (Condition (ISC), 'W');
+
+ -- For statement
+
else
+ Extend_Statement_Sequence (N, ISC, 'F');
Process_Decisions
(Loop_Parameter_Specification (ISC), 'X');
end if;
diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads
index b8dd08d0350..6cc8742f3ab 100644
--- a/gcc/ada/scos.ads
+++ b/gcc/ada/scos.ads
@@ -105,8 +105,9 @@ package SCOs is
-- and the following regions of the syntax tree:
-- the part of a case_statement from CASE up to the expression
- -- the part of a FOR iteration scheme from FOR up to the
+ -- the part of a FOR loop iteration scheme from FOR up to the
-- loop_parameter_specification
+ -- the part of a WHILE loop up to the condition
-- the part of an extended_return_statement from RETURN up to the
-- expression (if present) or to the return_subtype_indication (if
-- no expression)
@@ -148,11 +149,13 @@ package SCOs is
-- r renaming declaration
-- i generic instantiation
-- C CASE statement (includes only the expression)
- -- F FOR/WHILE loop statement (includes only the iteration scheme)
+ -- E EXIT statement
+ -- F FOR loop statement (includes only the iteration scheme)
-- I IF statement (includes only the condition [in the RM sense, which
-- is a decision in the SCO sense])
-- P PRAGMA
-- R extended RETURN statement
+ -- W WHILE loop statement (includes only the condition)
-- and is omitted for all other cases.
@@ -278,9 +281,10 @@ package SCOs is
-- Statements
-- C1 = 'S' for entry point, 's' otherwise
- -- C2 = 't', 's', 'o', 'r', 'i', 'C', 'F', 'I', 'P', 'R', ' '
+ -- C2 = 't', 's', 'o', 'r', 'i',
+ -- 'C', 'E', 'F', 'I', 'P', 'R', 'W', ' '
-- (type/subtype/object/renaming/instantiation/
- -- CASE/FOR or WHILE/IF/PRAGMA/RETURN/other)
+ -- CASE/EXIT/FOR/IF/PRAGMA/RETURN/WHILE/other)
-- From = starting source location
-- To = ending source location
-- Last = False for all but the last entry, True for last entry