From: Eric Botcazou Date: Wed, 6 Jun 2007 10:49:08 +0000 (+0200) Subject: s-stoele.ads, [...]: Move inline_always subprograms earlier than their first call. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cb65368d57a94a8b9b2e4a5c098cf3777f4d8dad;p=gcc.git s-stoele.ads, [...]: Move inline_always subprograms earlier than their first call. 2007-04-20 Eric Botcazou * s-stoele.ads, s-stoele.adb: Move inline_always subprograms earlier than their first call. Add type Dummy_Communication_Block used in the generation of the pre- defined dispatching primitive _disp_asynchronous_select. (Storage_Element): Put Pragma Universal_Aliasing on it. From-SVN: r125467 --- diff --git a/gcc/ada/s-stoele.adb b/gcc/ada/s-stoele.adb index 4d4f9594e76..3a4f97333d4 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 3b1527bfbdc..2bc6c8bb20e 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;