diff options
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 65 |
1 files changed, 1 insertions, 64 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index c607865..1ea34b1 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3295,7 +3295,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) reference. GNAT_SUBPROG is the subprogram to which the VMS descriptor is passed. */ -static tree +tree convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type, bool by_ref, Entity_Id gnat_subprog) { @@ -3344,69 +3344,6 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type, return build3 (COND_EXPR, gnu_type, is64bit, gnu_expr64, gnu_expr32); } - -/* Build a stub for the subprogram specified by the GCC tree GNU_SUBPROG - and the GNAT node GNAT_SUBPROG. */ - -void -build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog) -{ - tree gnu_subprog_type, gnu_subprog_addr, gnu_subprog_call; - tree gnu_subprog_param, gnu_stub_param, gnu_param; - tree gnu_stub_decl = DECL_FUNCTION_STUB (gnu_subprog); - VEC(tree,gc) *gnu_param_vec = NULL; - - gnu_subprog_type = TREE_TYPE (gnu_subprog); - - /* Initialize the information structure for the function. */ - allocate_struct_function (gnu_stub_decl, false); - set_cfun (NULL); - - begin_subprog_body (gnu_stub_decl); - - start_stmt_group (); - gnat_pushlevel (); - - /* Loop over the parameters of the stub and translate any of them - passed by descriptor into a by reference one. */ - for (gnu_stub_param = DECL_ARGUMENTS (gnu_stub_decl), - gnu_subprog_param = DECL_ARGUMENTS (gnu_subprog); - gnu_stub_param; - gnu_stub_param = TREE_CHAIN (gnu_stub_param), - gnu_subprog_param = TREE_CHAIN (gnu_subprog_param)) - { - if (DECL_BY_DESCRIPTOR_P (gnu_stub_param)) - { - gcc_assert (DECL_BY_REF_P (gnu_subprog_param)); - gnu_param - = convert_vms_descriptor (TREE_TYPE (gnu_subprog_param), - gnu_stub_param, - DECL_PARM_ALT_TYPE (gnu_stub_param), - DECL_BY_DOUBLE_REF_P (gnu_subprog_param), - gnat_subprog); - } - else - gnu_param = gnu_stub_param; - - VEC_safe_push (tree, gc, gnu_param_vec, gnu_param); - } - - /* Invoke the internal subprogram. */ - gnu_subprog_addr = build1 (ADDR_EXPR, build_pointer_type (gnu_subprog_type), - gnu_subprog); - gnu_subprog_call = build_call_vec (TREE_TYPE (gnu_subprog_type), - gnu_subprog_addr, gnu_param_vec); - - /* Propagate the return value, if any. */ - if (VOID_TYPE_P (TREE_TYPE (gnu_subprog_type))) - add_stmt (gnu_subprog_call); - else - add_stmt (build_return_expr (DECL_RESULT (gnu_stub_decl), - gnu_subprog_call)); - - gnat_poplevel (); - end_subprog_body (end_stmt_group ()); -} /* Build a type to be used to represent an aliased object whose nominal type is an unconstrained array. This consists of a RECORD_TYPE containing a |