par_sco.adb (Traverse_Declarations_Or_Statements): Add processing for Case.
authorRobert Dewar <dewar@adacore.com>
Tue, 26 Jan 2010 10:20:43 +0000 (10:20 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 26 Jan 2010 10:20:43 +0000 (11:20 +0100)
2010-01-26  Robert Dewar  <dewar@adacore.com>

* par_sco.adb (Traverse_Declarations_Or_Statements): Add processing for
Case.

From-SVN: r156240

gcc/ada/ChangeLog
gcc/ada/par_sco.adb

index e46d80e6f9134c77973aab32444ceffee7580c83..3c8d13fedfdc3228bbf16cd9d2de10b5d35e3306 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-26  Robert Dewar  <dewar@adacore.com>
+
+       * par_sco.adb (Traverse_Declarations_Or_Statements): Add processing for
+       Case.
+
 2010-01-26  Robert Dewar  <dewar@adacore.com>
 
        * par_sco.adb (Is_Logical_Operator): Exclude AND/OR/XOR
index e47dbbc7dea6389a67d5057a96a8ceed9d5cf93b..67806b4f6f94700a2b87c01f103a9d6d462c17d8 100644 (file)
@@ -887,7 +887,32 @@ package body Par_SCO is
 
                   Traverse_Declarations_Or_Statements (Else_Statements (N));
 
-                  --  Unconditional exit points
+               --  Case statement
+
+               when N_Case_Statement =>
+
+                  --  We include the expression, but not any of the case
+                  --  branches in the generated statement sequence that
+                  --  includes this case statement.
+
+                  Sloc_Range (Expression (N), Dummy, Stop);
+                  Set_Statement_Entry;
+                  Process_Decisions (Expression (N), 'X');
+
+                  --  Process case branches
+
+                  declare
+                     Alt : Node_Id;
+
+                  begin
+                     Alt := First (Alternatives (N));
+                     while Present (Alt) loop
+                        Traverse_Declarations_Or_Statements (Statements (Alt));
+                        Next (Alt);
+                     end loop;
+                  end;
+
+               --  Unconditional exit points
 
                when N_Requeue_Statement |
                     N_Goto_Statement    |