summaryrefslogtreecommitdiff
path: root/gcc/ada/trans.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-11-19 11:54:53 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2004-11-19 11:54:53 +0100
commitee57599295edea9f7edd73768deab9cc526dc505 (patch)
tree6efa7bf4ecf82f27c400f99353c69a8bcca1b6c7 /gcc/ada/trans.c
parentf5a0cbf1083ff9d9635c813929b89d9f831f4ec9 (diff)
downloadgcc-ee57599295edea9f7edd73768deab9cc526dc505.tar.gz
a-exexpr.adb (Others_Value, [...]): New variables...
* a-exexpr.adb (Others_Value, All_Others_Value): New variables, the address of which may be used to represent "others" and "all others" choices in exception tables, instead of the current harcoded (void *)0 and (void *)1. (Setup_Exception): Do nothing in the GNAT SJLJ case. * gigi.h (others_decl, all_others_decl): New decls representing the new Others_Value and All_Others_Value objects. (struct attrib): Rename "arg" component as "args", since GCC expects a list of arguments in there. * raise.c (GNAT_OTHERS, GNAT_ALL_OTHERS): Are now the address of the corresponding objects exported by a-exexpr, instead of hardcoded dummy addresses. * trans.c (Exception_Handler_to_gnu_zcx): Use the address of others_decl and all_others_decl instead of hardcoded dummy addresses to represent "others" and "all others" choices, which is cleaner and more flexible with respect to the possible eh pointer encoding policies. * utils.c (init_gigi_decls): Initialize others_decl and all_others_decl. (process_attributes): Account for the naming change of the "args" attribute list entry component. * decl.c (build_attr_list): Rename into prepend_attributes to allow cumulating attributes for different entities into a single list. (gnat_to_gnu_entity): Use prepend_attributes to build the list of attributes for the current entity and propagate first subtype attributes to other subtypes. <E_Procedure>: Attribute arguments are attr->args and not attr->arg any more. (build_attr_list): Ditto. Make attr->args a TREE_LIST when there is an argument provided, as this is what GCC expects. Use NULL_TREE instead of 0 for trees. From-SVN: r90900
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r--gcc/ada/trans.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 4f04da7e8f6..162e6acc198 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -2299,24 +2299,22 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node)
handler can catch, with special cases for others and all others cases.
Each exception type is actually identified by a pointer to the exception
- id, with special value zero for "others" and one for "all others". Beware
- that these special values are known and used by the personality routine to
- identify the corresponding specific kinds of handlers.
+ id, or to a dummy object for "others" and "all others".
- ??? For initial time frame reasons, the others and all_others cases have
- been handled using specific type trees, but this somehow hides information
- from the back-end, which expects NULL to be passed for catch all and
- end_cleanup to be used for cleanups.
-
- Care should be taken to ensure that the control flow impact of such
- clauses is rendered in some way. lang_eh_type_covers is doing the trick
+ Care should be taken to ensure that the control flow impact of "others"
+ and "all others" is known to GCC. lang_eh_type_covers is doing the trick
currently. */
for (gnat_temp = First (Exception_Choices (gnat_node));
gnat_temp; gnat_temp = Next (gnat_temp))
{
if (Nkind (gnat_temp) == N_Others_Choice)
- gnu_etype = (All_Others (gnat_temp) ? integer_one_node
- : integer_zero_node);
+ {
+ tree gnu_expr
+ = All_Others (gnat_temp) ? all_others_decl : others_decl;
+
+ gnu_etype
+ = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr);
+ }
else if (Nkind (gnat_temp) == N_Identifier
|| Nkind (gnat_temp) == N_Expanded_Name)
{