diff options
author | Doug Rupp <rupp@adacore.com> | 2008-08-01 09:56:20 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-01 09:56:20 +0200 |
commit | d628c01538e48900f60a9b0bf1e9c5fd53038ad8 (patch) | |
tree | 725f4c3218fbf2332443fb1018002094c5a23852 /gcc/ada/gcc-interface/decl.c | |
parent | 73f0dc7a66c5a9481671e2870b64b8e175fc43f4 (diff) | |
download | gcc-d628c01538e48900f60a9b0bf1e9c5fd53038ad8.zip gcc-d628c01538e48900f60a9b0bf1e9c5fd53038ad8.tar.gz gcc-d628c01538e48900f60a9b0bf1e9c5fd53038ad8.tar.bz2 |
gnat_rm.texi: Document new mechanism Short_Descriptor.
2008-08-01 Doug Rupp <rupp@adacore.com>
* gnat_rm.texi: Document new mechanism Short_Descriptor.
* types.ads (Mechanism_Type): Modify range for new Short_Descriptor
mechanism values.
* sem_prag.adb (Set_Mechanism_Value): Enhance for Short_Descriptor
mechanism and Short_Descriptor mechanism values.
* snames.adb (preset_names): Add short_descriptor entry.
* snames.ads: Add Name_Short_Descriptor.
* types.h: Add new By_Short_Descriptor mechanism values.
* sem_mech.adb (Set_Mechanism_Value): Enhance for Short_Descriptor
mechanism and Short_Descriptor mechanism values.
* sem_mech.ads (Mechanism_Type): Add new By_Short_Descriptor mechanism
values.
(Descriptor_Codes): Modify range for new mechanism values.
* treepr.adb (Print_Entity_Enfo): Handle new By_Short_Descriptor
mechanism values.
* gcc-interface/decl.c (gnat_to_gnu_entity): Handle By_Short_Descriptor.
(gnat_to_gnu_param): Handle By_Short_Descriptor.
* gcc-interface/gigi.h (build_vms_descriptor64): Remove prototype.
(build_vms_descriptor32): New prototype.
(fill_vms_descriptor): Remove unneeded gnat_actual parameter.
* gcc-interface/trans.c (call_to_gnu): Removed unneeded gnat_actual
argument in call fill_vms_descriptor.
* gcc-interface/utils.c (build_vms_descriptor32): Renamed from
build_vms_descriptor and enhanced to hande Short_Descriptor mechanism.
(build_vms_descriptor): Renamed from build_vms_descriptor64.
(convert_vms_descriptor32): New function.
(convert_vms_descriptor64): New function.
(convert_vms_descriptor): Rewrite to handle both 32bit and 64bit
descriptors.
* gcc-interface/utils2.c (fill_vms_descriptor): Revert previous changes,
no longer needed.
From-SVN: r138473
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index f8ebf5a..f7f4a0d 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -3872,6 +3872,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ; else if (By_Descriptor_Last <= mech && mech <= By_Descriptor) mech = By_Descriptor; + + else if (By_Short_Descriptor_Last <= mech && + mech <= By_Short_Descriptor) + mech = By_Short_Descriptor; + else if (mech > 0) { if (TREE_CODE (gnu_param_type) == UNCONSTRAINED_ARRAY_TYPE @@ -3913,7 +3918,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) = chainon (gnu_param, gnu_stub_param_list); /* Change By_Descriptor parameter to By_Reference for the internal version of an exported subprogram. */ - if (mech == By_Descriptor) + if (mech == By_Descriptor || mech == By_Short_Descriptor) { gnu_param = gnat_to_gnu_param (gnat_param, By_Reference, @@ -4828,11 +4833,11 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, /* VMS descriptors are themselves passed by reference. Build both a 32bit and 64bit descriptor, one of which will be chosen - in fill_vms_descriptor based on the allocator size */ + in fill_vms_descriptor. */ if (mech == By_Descriptor) { gnu_param_type_alt - = build_pointer_type (build_vms_descriptor64 (gnu_param_type, + = build_pointer_type (build_vms_descriptor32 (gnu_param_type, Mechanism (gnat_param), gnat_subprog)); gnu_param_type @@ -4840,6 +4845,15 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, Mechanism (gnat_param), gnat_subprog)); } + else if (mech == By_Short_Descriptor) + { + gnu_param_type_alt = NULL_TREE; + + gnu_param_type + = build_pointer_type (build_vms_descriptor32 (gnu_param_type, + Mechanism (gnat_param), + gnat_subprog)); + } /* Arrays are passed as pointers to element type for foreign conventions. */ else if (foreign @@ -4920,6 +4934,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, && !by_ref && (by_return || (mech != By_Descriptor + && mech != By_Short_Descriptor && !POINTER_TYPE_P (gnu_param_type) && !AGGREGATE_TYPE_P (gnu_param_type))) && !(Is_Array_Type (Etype (gnat_param)) @@ -4931,11 +4946,12 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, ro_param || by_ref || by_component_ptr); DECL_BY_REF_P (gnu_param) = by_ref; DECL_BY_COMPONENT_PTR_P (gnu_param) = by_component_ptr; - DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor); + DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor || + mech == By_Short_Descriptor); DECL_POINTS_TO_READONLY_P (gnu_param) = (ro_param && (by_ref || by_component_ptr)); - /* Save the 64bit descriptor for later. */ + /* Save the alternate descriptor for later. */ SET_DECL_PARM_ALT (gnu_param, gnu_param_type_alt); /* If no Mechanism was specified, indicate what we're using, then |