aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/s-stoele.adb38
-rw-r--r--gcc/ada/s-stoele.ads30
2 files changed, 50 insertions, 18 deletions
diff --git a/gcc/ada/s-stoele.adb b/gcc/ada/s-stoele.adb
index 4d4f959..3a4f973 100644
--- a/gcc/ada/s-stoele.adb
+++ b/gcc/ada/s-stoele.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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- --
@@ -31,13 +31,30 @@
-- --
------------------------------------------------------------------------------
-with Unchecked_Conversion;
+with Ada.Unchecked_Conversion;
+
package body System.Storage_Elements is
pragma Suppress (All_Checks);
- function To_Address is new Unchecked_Conversion (Storage_Offset, Address);
- function To_Offset is new Unchecked_Conversion (Address, Storage_Offset);
+ function To_Address is
+ new Ada.Unchecked_Conversion (Storage_Offset, Address);
+ function To_Offset is
+ new Ada.Unchecked_Conversion (Address, Storage_Offset);
+
+ -- Conversion to/from integers
+ -- Those functions must be place first because they are inlined_always
+ -- and are used in other subprograms defined in this unit.
+
+ function To_Integer (Value : Address) return Integer_Address is
+ begin
+ return Integer_Address (Value);
+ end To_Integer;
+
+ function To_Address (Value : Integer_Address) return Address is
+ begin
+ return Address (Value);
+ end To_Address;
-- Address arithmetic
@@ -74,17 +91,4 @@ package body System.Storage_Elements is
((-To_Integer (Left)) mod Integer_Address (-Right));
end if;
end "mod";
-
- -- Conversion to/from integers
-
- function To_Address (Value : Integer_Address) return Address is
- begin
- return Address (Value);
- end To_Address;
-
- function To_Integer (Value : Address) return Integer_Address is
- begin
- return Integer_Address (Value);
- end To_Integer;
-
end System.Storage_Elements;
diff --git a/gcc/ada/s-stoele.ads b/gcc/ada/s-stoele.ads
index 3b1527b..2bc6c8b 100644
--- a/gcc/ada/s-stoele.ads
+++ b/gcc/ada/s-stoele.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2007, 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 --
@@ -64,6 +64,13 @@ package System.Storage_Elements is
type Storage_Element is mod 2 ** Storage_Unit;
for Storage_Element'Size use Storage_Unit;
+ pragma Warnings (Off);
+ pragma Universal_Aliasing (Storage_Element);
+ pragma Warnings (On);
+ -- This type is used by the expansion to implement aggregate copy.
+ -- We turn off warnings for this pragma to deal with being compiled
+ -- with an earlier GNAT version that does not recognize this pragma.
+
type Storage_Array is
array (Storage_Offset range <>) of aliased Storage_Element;
for Storage_Array'Component_Size use Storage_Unit;
@@ -111,4 +118,25 @@ 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;