diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-12-08 12:47:46 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-12-08 12:47:46 +0100 |
commit | 6a2b39bdda1bb40449552e3b7617653b63cefac9 (patch) | |
tree | 7b83673455bc8ce24ce19e2a48a13fe8acf141db /gcc/ada/trans.c | |
parent | bd94e912ff679565d51bae79ef140ab7e7836aef (diff) | |
download | gcc-6a2b39bdda1bb40449552e3b7617653b63cefac9.zip gcc-6a2b39bdda1bb40449552e3b7617653b63cefac9.tar.gz gcc-6a2b39bdda1bb40449552e3b7617653b63cefac9.tar.bz2 |
misc.c (gnat_types_compatible_p, [...]): Remove.
* misc.c (gnat_types_compatible_p, LANG_HOOKS_TYPES_COMPATIBLE_P):
Remove.
(LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): New.
* adaint.h: (__gnat_dup, __gnat_dup2): Add missing decls.
* trans.c (Exception_Handler_to_gnu_sjlj): Also handle renamed
exception.
(call_to_gnu): Convert to actual DECL_ARG_TYPE, not variant of it.
From-SVN: r91890
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r-- | gcc/ada/trans.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 162e6ac..2acf832 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -1621,7 +1621,9 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnat_formal = Next_Formal_With_Extras (gnat_formal), gnat_actual = Next_Actual (gnat_actual)) { - tree gnu_formal_type = gnat_to_gnu_type (Etype (gnat_formal)); + tree gnu_formal + = (present_gnu_tree (gnat_formal) + ? get_gnu_tree (gnat_formal) : NULL_TREE); /* We treat a conversion between aggregate types as if it is an unchecked conversion. */ bool unchecked_convert_p @@ -1632,10 +1634,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ? Expression (gnat_actual) : gnat_actual); tree gnu_name = gnat_to_gnu (gnat_name); tree gnu_name_type = gnat_to_gnu_type (Etype (gnat_name)); - tree gnu_formal - = (present_gnu_tree (gnat_formal) - ? get_gnu_tree (gnat_formal) : NULL_TREE); tree gnu_actual; + tree gnu_formal_type; /* If it's possible we may need to use this expression twice, make sure than any side-effects are handled via SAVE_EXPRs. Likewise if we need @@ -1739,9 +1739,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_actual = convert (gnat_to_gnu_type (Etype (gnat_actual)), gnu_actual); - if (TREE_CODE (gnu_actual) != SAVE_EXPR) - gnu_actual = convert (gnu_formal_type, gnu_actual); - /* If we have not saved a GCC object for the formal, it means it is an OUT parameter not passed by reference and that does not need to be copied in. Otherwise, look at the PARM_DECL to see if it is passed by @@ -1856,9 +1853,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) integer_zero_node), false); else - gnu_actual - = convert (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (gnu_formal)), - gnu_actual); + gnu_actual = convert (DECL_ARG_TYPE (gnu_formal), gnu_actual); } gnu_actual_list = tree_cons (NULL_TREE, gnu_actual, gnu_actual_list); @@ -2244,8 +2239,15 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) else if (Nkind (gnat_temp) == N_Identifier || Nkind (gnat_temp) == N_Expanded_Name) { - tree gnu_expr - = gnat_to_gnu_entity (Entity (gnat_temp), NULL_TREE, 0); + Entity_Id gnat_ex_id = Entity (gnat_temp); + tree gnu_expr; + + /* Exception may be a renaming. Recover original exception which is + the one elaborated and registered. */ + if (Present (Renamed_Object (gnat_ex_id))) + gnat_ex_id = Renamed_Object (gnat_ex_id); + + gnu_expr = gnat_to_gnu_entity (gnat_ex_id, NULL_TREE, 0); this_choice = build_binary_op |