public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-958] [Ada] Remove left-overs of front-end SJLJ processing
@ 2022-06-02 9:11 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-06-02 9:11 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d6d9f534f9fa9f8e444906ebfe90053a24d212a5
commit r13-958-gd6d9f534f9fa9f8e444906ebfe90053a24d212a5
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Mon May 9 13:15:02 2022 +0200
[Ada] Remove left-overs of front-end SJLJ processing
gcc/ada/
* gcc-interface/gigi.h (enum standard_datatypes): Remove values
for the SJLJ exception mechanism.
(jmpbuf_type): Delete.
(jmpbuf_ptr_type): Likewise.
(get_jmpbuf_decl): Likewise.
(set_jmpbuf_decl): Likewise.
(get_excptr_decl): Likewise.
(not_handled_by_others_decl): Likewise.
(setjmp_decl): Likewise.
(update_setjmp_buf_decl): Likewise.
(raise_nodefer_decl): Likewise.
(set_block_jmpbuf_decl): Likewise.
(get_block_jmpbuf_decl): Likewise.
* gcc-interface/trans.cc (gigi): Delete dead code.
* gcc-interface/utils.cc (gnat_binding_level): Remove JMPBUF_DECL.
(gnat_pushlevel): Do not clear it.
(set_block_jmpbuf_decl): Delete.
(get_block_jmpbuf_decl): Likewise.
Diff:
---
gcc/ada/gcc-interface/gigi.h | 33 ++------------------
gcc/ada/gcc-interface/trans.cc | 68 +-----------------------------------------
gcc/ada/gcc-interface/utils.cc | 20 -------------
3 files changed, 4 insertions(+), 117 deletions(-)
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 6d70c30305a..52d44f0077a 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -399,18 +399,7 @@ enum standard_datatypes
/* Identifier for the name of the Not_Handled_By_Others field. */
ADT_not_handled_by_others_name_id,
- /* Types and decls used by the SJLJ exception mechanism. */
- ADT_jmpbuf_type,
- ADT_jmpbuf_ptr_type,
- ADT_get_jmpbuf_decl,
- ADT_set_jmpbuf_decl,
- ADT_get_excptr_decl,
- ADT_not_handled_by_others_decl,
- ADT_setjmp_decl,
- ADT_update_setjmp_buf_decl,
- ADT_raise_nodefer_decl,
-
- /* Types and decls used by the ZCX exception mechanism. */
+ /* Types and decls used by the exception mechanism. */
ADT_reraise_zcx_decl,
ADT_set_exception_parameter_decl,
ADT_begin_handler_decl,
@@ -469,25 +458,15 @@ extern GTY(()) tree gnat_raise_decls_ext[(int) LAST_REASON_CODE + 1];
#define parent_name_id gnat_std_decls[(int) ADT_parent_name_id]
#define not_handled_by_others_name_id \
gnat_std_decls[(int) ADT_not_handled_by_others_name_id]
-#define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type]
-#define jmpbuf_ptr_type gnat_std_decls[(int) ADT_jmpbuf_ptr_type]
-#define get_jmpbuf_decl gnat_std_decls[(int) ADT_get_jmpbuf_decl]
-#define set_jmpbuf_decl gnat_std_decls[(int) ADT_set_jmpbuf_decl]
-#define get_excptr_decl gnat_std_decls[(int) ADT_get_excptr_decl]
-#define not_handled_by_others_decl \
- gnat_std_decls[(int) ADT_not_handled_by_others_decl]
-#define setjmp_decl gnat_std_decls[(int) ADT_setjmp_decl]
-#define update_setjmp_buf_decl gnat_std_decls[(int) ADT_update_setjmp_buf_decl]
-#define raise_nodefer_decl gnat_std_decls[(int) ADT_raise_nodefer_decl]
#define reraise_zcx_decl gnat_std_decls[(int) ADT_reraise_zcx_decl]
#define set_exception_parameter_decl \
gnat_std_decls[(int) ADT_set_exception_parameter_decl]
#define begin_handler_decl gnat_std_decls[(int) ADT_begin_handler_decl]
+#define end_handler_decl gnat_std_decls[(int) ADT_end_handler_decl]
+#define unhandled_except_decl gnat_std_decls[(int) ADT_unhandled_except_decl]
#define others_decl gnat_std_decls[(int) ADT_others_decl]
#define all_others_decl gnat_std_decls[(int) ADT_all_others_decl]
#define unhandled_others_decl gnat_std_decls[(int) ADT_unhandled_others_decl]
-#define end_handler_decl gnat_std_decls[(int) ADT_end_handler_decl]
-#define unhandled_except_decl gnat_std_decls[(int) ADT_unhandled_except_decl]
/* Routines expected by the gcc back-end. They must have exactly the same
prototype and names as below. */
@@ -504,12 +483,6 @@ extern void gnat_zaplevel (void);
and point FNDECL to this BLOCK. */
extern void set_current_block_context (tree fndecl);
-/* Set the jmpbuf_decl for the current binding level to DECL. */
-extern void set_block_jmpbuf_decl (tree decl);
-
-/* Get the setjmp_decl, if any, for the current binding level. */
-extern tree get_block_jmpbuf_decl (void);
-
/* Record DECL as belonging to the current lexical scope and use GNAT_NODE
for location information and flag propagation. */
extern void gnat_pushdecl (tree decl, Node_Id gnat_node);
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 46030d808f5..f0602b824b0 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -467,71 +467,6 @@ gigi (Node_Id gnat_root,
/* Make the types and functions used for exception processing. */
except_type_node = gnat_to_gnu_type (Base_Type (standard_exception_type));
- for (t = TYPE_FIELDS (except_type_node); t; t = DECL_CHAIN (t))
- if (DECL_NAME (t) == not_handled_by_others_name_id)
- {
- not_handled_by_others_decl = t;
- break;
- }
- gcc_assert (DECL_P (not_handled_by_others_decl));
-
- jmpbuf_type
- = build_array_type (gnat_type_for_mode (Pmode, 0),
- build_index_type (size_int (5)));
- record_builtin_type ("JMPBUF_T", jmpbuf_type, true);
- jmpbuf_ptr_type = build_pointer_type (jmpbuf_type);
-
- /* Functions to get and set the jumpbuf pointer for the current thread. */
- get_jmpbuf_decl
- = create_subprog_decl
- (get_identifier ("system__soft_links__get_jmpbuf_address_soft"),
- NULL_TREE, build_function_type_list (jmpbuf_ptr_type, NULL_TREE),
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
-
- set_jmpbuf_decl
- = create_subprog_decl
- (get_identifier ("system__soft_links__set_jmpbuf_address_soft"),
- NULL_TREE, build_function_type_list (void_type_node, jmpbuf_ptr_type,
- NULL_TREE),
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
-
- get_excptr_decl
- = create_subprog_decl
- (get_identifier ("system__soft_links__get_gnat_exception"), NULL_TREE,
- build_function_type_list (build_pointer_type (except_type_node),
- NULL_TREE),
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
-
- /* setjmp returns an integer and has one operand, which is a pointer to
- a jmpbuf. */
- setjmp_decl
- = create_subprog_decl
- (get_identifier ("__builtin_setjmp"), NULL_TREE,
- build_function_type_list (integer_type_node, jmpbuf_ptr_type,
- NULL_TREE),
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
- set_decl_built_in_function (setjmp_decl, BUILT_IN_NORMAL, BUILT_IN_SETJMP);
-
- /* update_setjmp_buf updates a setjmp buffer from the current stack pointer
- address. */
- update_setjmp_buf_decl
- = create_subprog_decl
- (get_identifier ("__builtin_update_setjmp_buf"), NULL_TREE,
- build_function_type_list (void_type_node, jmpbuf_ptr_type, NULL_TREE),
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
- set_decl_built_in_function (update_setjmp_buf_decl, BUILT_IN_NORMAL,
- BUILT_IN_UPDATE_SETJMP_BUF);
-
- /* Indicate that it never returns. */
- ftype = build_function_type_list (void_type_node,
- build_pointer_type (except_type_node),
- NULL_TREE);
- ftype = build_qualified_type (ftype, TYPE_QUAL_VOLATILE);
- raise_nodefer_decl
- = create_subprog_decl
- (get_identifier ("__gnat_raise_nodefer_with_msg"), NULL_TREE, ftype,
- NULL_TREE, is_default, true, true, true, false, false, NULL, Empty);
-
set_exception_parameter_decl
= create_subprog_decl
(get_identifier ("__gnat_set_exception_parameter"), NULL_TREE,
@@ -600,8 +535,7 @@ gigi (Node_Id gnat_root,
NULL, Empty);
/* If in no exception handlers mode, all raise statements are redirected to
- __gnat_last_chance_handler. No need to redefine raise_nodefer_decl since
- this procedure will never be called in this mode. */
+ __gnat_last_chance_handler. */
if (No_Exception_Handlers_Set ())
{
/* Indicate that it never returns. */
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 3aa810ba21a..b5c2bfb8701 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -264,9 +264,6 @@ struct GTY((chain_next ("%h.chain"))) gnat_binding_level {
struct gnat_binding_level *chain;
/* The BLOCK node for this level. */
tree block;
- /* If nonzero, the setjmp buffer that needs to be updated for any
- variable-sized definition within this context. */
- tree jmpbuf_decl;
};
/* The binding level currently in effect. */
@@ -599,7 +596,6 @@ gnat_pushlevel (void)
/* Add this level to the front of the chain (stack) of active levels. */
newlevel->chain = current_binding_level;
- newlevel->jmpbuf_decl = NULL_TREE;
current_binding_level = newlevel;
}
@@ -614,22 +610,6 @@ set_current_block_context (tree fndecl)
set_block_for_group (current_binding_level->block);
}
-/* Set the jmpbuf_decl for the current binding level to DECL. */
-
-void
-set_block_jmpbuf_decl (tree decl)
-{
- current_binding_level->jmpbuf_decl = decl;
-}
-
-/* Get the jmpbuf_decl, if any, for the current binding level. */
-
-tree
-get_block_jmpbuf_decl (void)
-{
- return current_binding_level->jmpbuf_decl;
-}
-
/* Exit a binding level. Set any BLOCK into the current code group. */
void
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-02 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 9:11 [gcc r13-958] [Ada] Remove left-overs of front-end SJLJ processing Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).