OSDN Git Service

2009-07-27 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Jul 2009 13:41:57 +0000 (13:41 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Jul 2009 13:41:57 +0000 (13:41 +0000)
* exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not attempt expansion in
Ravenscar mode. Error has already been posted on specification.

* sem.adb: Further code clean ups.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150116 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/ada/sem.adb

index ca9285d..d886bdf 100644 (file)
@@ -1,3 +1,10 @@
+2009-07-27  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not attempt expansion in
+       Ravenscar mode. Error has already been posted on specification.
+
+       * sem.adb: Further code clean ups.
+
 2009-07-27  Robert Dewar  <dewar@adacore.com>
 
        * g-sse.ads: Minor reformatting
index cc58d9f..e75ceca 100644 (file)
@@ -10324,6 +10324,13 @@ package body Exp_Ch9 is
       S : Entity_Id;  --  Primitive operation slot
 
    begin
+      --  Under the Ravenscar profile, timed entry calls are excluded. An error
+      --  was already reported on spec, so do not attempt to expand the call.
+
+      if Restriction_Active (No_Select_Statements) then
+         return;
+      end if;
+
       --  The arguments in the call may require dynamic allocation, and the
       --  call statement may have been transformed into a block. The block
       --  may contain additional declarations for internal entities, and the
index 6f68bdd..7411ede 100644 (file)
@@ -1680,8 +1680,16 @@ package body Sem is
          --------------------
 
          procedure Do_Withed_Unit (Withed_Unit : Node_Id) is
+            Save_Do_Main : constant Boolean := Do_Main;
+
          begin
+            --  Do not process the main unit if coming from a with_clause,
+            --  as would happen with a parent body that has a child spec
+            --  in its context.
+
+            Do_Main := False;
             Do_Unit_And_Dependents (Withed_Unit, Unit (Withed_Unit));
+            Do_Main := Save_Do_Main;
          end Do_Withed_Unit;
 
          procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit);
@@ -1875,7 +1883,7 @@ package body Sem is
               and then Present (Library_Unit (Main_CU))
             then
                Do_Unit_And_Dependents
-              (Library_Unit (Main_CU), Unit (Library_Unit (Main_CU)));
+                 (Library_Unit (Main_CU), Unit (Library_Unit (Main_CU)));
             else
                Do_Unit_And_Dependents (Main_CU, Unit (Main_CU));
             end if;