2008-04-08 Hristian Kirtchev <kirtchev@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2008 06:55:36 +0000 (06:55 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2008 06:55:36 +0000 (06:55 +0000)
* s-stoele.ads, s-soflin.ads: Move the location of
Dummy_Communication_Block from System.Storage_Elements to
System.Soft_Links.

* s-tpobop.ads: Add comment on usage of Dummy_Communication_Block to
emulate Communication_Block in certain scenarios.

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

gcc/ada/s-soflin.ads
gcc/ada/s-stoele.ads
gcc/ada/s-tpobop.ads

index 19f851c..bc8bd1d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2008, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -381,4 +381,25 @@ package System.Soft_Links is
 
    function Get_Exc_Stack_Addr_Soft return Address;
 
+   --  The following is a dummy record designed to mimic Communication_Block as
+   --  defined in s-tpobop.ads:
+
+   --     type Communication_Block is record
+   --        Self      : Task_Id;  --  An access type
+   --        Enqueued  : Boolean := True;
+   --        Cancelled : Boolean := False;
+   --     end record;
+
+   --  The record is used in the construction of the predefined dispatching
+   --  primitive _disp_asynchronous_select in order to avoid the import of
+   --  System.Tasking.Protected_Objects.Operations. Note that this package
+   --  is always imported in the presence of interfaces since the dispatch
+   --  table uses entities from here.
+
+   type Dummy_Communication_Block is record
+      Comp_1 : Address;  --  Address and access have the same size
+      Comp_2 : Boolean;
+      Comp_3 : Boolean;
+   end record;
+
 end System.Soft_Links;
index ef75211..45871a5 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2002-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 2002-2008, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -122,25 +122,4 @@ package System.Storage_Elements is
    pragma Inline_Always (To_Integer);
    pragma Pure_Function (To_Integer);
 
-   --  The following is a dummy record designed to mimic Communication_Block as
-   --  defined in s-tpobop.ads:
-
-   --     type Communication_Block is record
-   --        Self      : Task_Id;  --  An access type
-   --        Enqueued  : Boolean := True;
-   --        Cancelled : Boolean := False;
-   --     end record;
-
-   --  The record is used in the construction of the predefined dispatching
-   --  primitive _disp_asynchronous_select in order to avoid the import of
-   --  System.Tasking.Protected_Objects.Operations. Note that this package
-   --  is always imported in the presence of interfaces since the dispatch
-   --  table uses entities from here.
-
-   type Dummy_Communication_Block is record
-      Comp_1 : Address;  --  Address and access have the same size
-      Comp_2 : Boolean;
-      Comp_3 : Boolean;
-   end record;
-
 end System.Storage_Elements;
index 8620c79..0e409aa 100644 (file)
@@ -198,6 +198,15 @@ private
    end record;
    pragma Volatile (Communication_Block);
 
+   --  When a program contains limited interfaces, the compiler generates the
+   --  predefined primitives associated with dispatching selects. One of the
+   --  parameters of these routines is of type Communication_Block. Even if
+   --  the program lacks implementing concurrent types, the tasking runtime is
+   --  dragged in unconditionally because of Communication_Block. To avoid this
+   --  case, the compiler uses type Dummy_Communication_Block which defined in
+   --  System.Soft_Links. If the structure of Communication_Block is changed,
+   --  the corresponding dummy type must be changed as well.
+
    --  The Communication_Block seems to be a relic. At the moment, the
    --  compiler seems to be generating unnecessary conditional code based on
    --  this block. See the code generated for async. select with task entry