diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-26 07:39:17 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-26 07:39:17 +0000 |
commit | acf97c1176abc4bfda6f960b4de65efa8492354e (patch) | |
tree | 535fe9f7a2bfeba1b8bafd9aa970c714dda36fad /gcc/ada/exp_util.ads | |
parent | f3635788b320af298216c1ff9cc02a7924b24e0e (diff) | |
download | gcc-acf97c1176abc4bfda6f960b4de65efa8492354e.tar.gz |
2008-03-26 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Make_DT, Make_Secondary_DT): Set attribute
Is_Static_Dispatch_Table
(Build_Dispatch_Tables): Replace calls to Exchange_Entities() by calls
to Exchange_Declarations to exchange the private and full-view. Bug
found working in this issue.
(Expand_Dispatching_Call): Propagate the convention of the subprogram
to the subprogram pointer type.
(Make_Secondary_DT): Replace generation of Prim'Address by
Address (Prim'Unrestricted_Access)
(Make_DT): Replace generation of Prim'Address by
Address (Prim'Unrestricted_Access)
(Make_Disp_*_Bodies): When compiling for a restricted profile, use
simple call form for single entry.
(Make_DT): Handle new contents of Access_Disp_Table (access to dispatch
tables of predefined primitives).
(Make_Secondary_DT): Add support to handle access to dispatch tables of
predefined primitives.
(Make_Tags): Add entities to Access_Dispatch_Table associated with
access to dispatch tables containing predefined primitives.
* exp_ch6.adb (N_Pragma): Chars field removed, use Chars
(Pragma_Identifier (.. instead, adjustments throughout to accomodate
this change.
(Register_Predefined_DT_Entry): Updated to handle the new contents
of attribute Access_Disp_Table (pointers to dispatch tables containing
predefined primitives).
* exp_util.ads, exp_util.adb (Corresponding_Runtime_Package): New
subprogram.
(Find_Interface_ADT): Updated to skip the new contents of attribute
Access_Dispatch_Table (pointers to dispatch tables containing predefined
primitives).
* sem_util.adb (Has_Abstract_Interfaces): Add missing support for
concurrent types.
(Set_Convention): Use new function Is_Access_Subprogram_Type
(Collect_Interfaces_Info): Updated to skip the new contents of attribute
Access_Dispatch_Table (pointers to dispatch tables containing predefined
primitives).
* exp_atag.ads, exp_atag.adb (Build_Inherit_Predefined_Prims): Improve
expanded code avoiding calls to Build_Predef_Prims.
(Build_Set_Predefined_Prim_Op_Address): Improve expanded code avoiding
call to Build_Get_Predefined_Prim_Op_Address.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133564 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_util.ads')
-rw-r--r-- | gcc/ada/exp_util.ads | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 42c8d2ab8f3..737b39728ee 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -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- -- @@ -212,43 +212,51 @@ package Exp_Util is -- function itself must do its own cleanups. function Component_May_Be_Bit_Aligned (Comp : Entity_Id) return Boolean; - -- This function is in charge of detecting record components that may cause - -- trouble in the back end if an attempt is made to assign the component. - -- The back end can handle such assignments with no problem if the - -- components involved are small (64-bits or less) records or scalar items - -- (including bit-packed arrays represented with modular types) or are both - -- aligned on a byte boundary (starting on a byte boundary, and occupying - -- an integral number of bytes). + -- This function is in charge of detecting record components that may + -- cause trouble in the back end if an attempt is made to assign the + -- component. The back end can handle such assignments with no problem if + -- the components involved are small (64-bits or less) records or scalar + -- items (including bit-packed arrays represented with modular types) or + -- are both aligned on a byte boundary (starting on a byte boundary, and + -- occupying an integral number of bytes). -- -- However, problems arise for records larger than 64 bits, or for arrays -- (other than bit-packed arrays represented with a modular type) if the -- component starts on a non-byte boundary, or does not occupy an integral - -- number of bytes (i.e. there are some bits possibly shared with fields at - -- the start or beginning of the component). The back end cannot handle + -- number of bytes (i.e. there are some bits possibly shared with fields + -- at the start or beginning of the component). The back end cannot handle -- loading and storing such components in a single operation. -- -- This function is used to detect the troublesome situation. it is - -- conservative in the sense that it produces True unless it knows for sure - -- that the component is safe (as outlined in the first paragraph above). - -- The code generation for record and array assignment checks for trouble - -- using this function, and if so the assignment is generated + -- conservative in the sense that it produces True unless it knows for + -- sure that the component is safe (as outlined in the first paragraph + -- above). The code generation for record and array assignment checks for + -- trouble using this function, and if so the assignment is generated -- component-wise, which the back end is required to handle correctly. -- - -- Note that in GNAT 3, the back end will reject such components anyway, so - -- the hard work in checking for this case is wasted in GNAT 3, but it's - -- harmless, so it is easier to do it in all cases, rather than + -- Note that in GNAT 3, the back end will reject such components anyway, + -- so the hard work in checking for this case is wasted in GNAT 3, but + -- it is harmless, so it is easier to do it in all cases, rather than -- conditionalize it in GNAT 5 or beyond. procedure Convert_To_Actual_Subtype (Exp : Node_Id); - -- The Etype of an expression is the nominal type of the expression, not - -- the actual subtype. Often these are the same, but not always. For - -- example, a reference to a formal of unconstrained type has the + -- The Etype of an expression is the nominal type of the expression, + -- not the actual subtype. Often these are the same, but not always. + -- For example, a reference to a formal of unconstrained type has the -- unconstrained type as its Etype, but the actual subtype is obtained by -- applying the actual bounds. This routine is given an expression, Exp, - -- and (if necessary), replaces it using Rewrite, with a conversion to the - -- actual subtype, building the actual subtype if necessary. If the + -- and (if necessary), replaces it using Rewrite, with a conversion to + -- the actual subtype, building the actual subtype if necessary. If the -- expression is already of the requested type, then it is unchanged. + function Corresponding_Runtime_Package (Typ : Entity_Id) return RTU_Id; + -- Return the id of the runtime package that will provide support for + -- concurrent type Typ. Currently only protected types are supported, + -- and the returned value is one of the following: + -- System_Tasking_Protected_Objects + -- System_Tasking_Protected_Objects_Entries + -- System_Tasking_Protected_Objects_Single_Entry + function Current_Sem_Unit_Declarations return List_Id; -- Return the a place where it is fine to insert declarations for the -- current semantic unit. If the unit is a package body, return the |