From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [gimple-classes, committed 25/92] Introduce gimple_eh_must_not_throw
Date: Mon, 27 Oct 2014 20:36:00 -0000 [thread overview]
Message-ID: <1414442490-14841-26-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com>
This corresponds to:
[PATCH 27/89] Introduce gimple_eh_must_not_throw
https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01218.html
from the original 89-patch kit
That earlier patch was approved by Jeff:
> OK after fixing up the naming/const stuff as discussed for prior
> patches.
> That applies to 22-30. Make sure to take care of
> the pretty printers per Trevor's comments as well. He indicated those
> were missing in a couple of those patches.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00628.html
gcc/
* coretypes.h (gimple_eh_must_not_throw): New typedef.
(const_gimple_eh_must_not_throw): New typedef.
* gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
a gimple_eh_must_not_throw rather than a plain gimple.
(pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
* gimple-streamer-in.c (input_gimple_stmt): Likewise.
* gimple-streamer-out.c (output_gimple_stmt): Likewise.
* gimple.c (gimple_build_eh_must_not_throw): Return a
gimple_eh_must_not_throw rather than a plain gimple.
* gimple.h (gimple_build_eh_must_not_throw): Return a
gimple_eh_must_not_throw rather than a plain gimple.
(gimple_eh_must_not_throw_fndecl): Require a
gimple_eh_must_not_throw rather than a plain gimple.
(gimple_eh_must_not_throw_set_fndecl): Likewise.
* tree-eh.c (lower_eh_must_not_throw): Add checked cast.
---
gcc/ChangeLog.gimple-classes | 27 +++++++++++++++++++++++++++
gcc/coretypes.h | 4 ++++
gcc/gimple-pretty-print.c | 8 +++++---
gcc/gimple-streamer-in.c | 4 +++-
gcc/gimple-streamer-out.c | 5 ++++-
gcc/gimple.c | 6 ++++--
gcc/gimple.h | 9 ++++-----
gcc/tree-eh.c | 3 ++-
8 files changed, 53 insertions(+), 13 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index e91317c..dd39ce6 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,32 @@
2014-10-24 David Malcolm <dmalcolm@redhat.com>
+ Introduce gimple_eh_must_not_throw
+
+ * coretypes.h (gimple_eh_must_not_throw): New typedef.
+ (const_gimple_eh_must_not_throw): New typedef.
+
+ * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
+ a gimple_eh_must_not_throw rather than a plain gimple.
+ (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
+ within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
+
+ * gimple-streamer-in.c (input_gimple_stmt): Likewise.
+
+ * gimple-streamer-out.c (output_gimple_stmt): Likewise.
+
+ * gimple.c (gimple_build_eh_must_not_throw): Return a
+ gimple_eh_must_not_throw rather than a plain gimple.
+
+ * gimple.h (gimple_build_eh_must_not_throw): Return a
+ gimple_eh_must_not_throw rather than a plain gimple.
+ (gimple_eh_must_not_throw_fndecl): Require a
+ gimple_eh_must_not_throw rather than a plain gimple.
+ (gimple_eh_must_not_throw_set_fndecl): Likewise.
+
+ * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
+
+2014-10-24 David Malcolm <dmalcolm@redhat.com>
+
Introduce gimple_eh_filter
* coretypes.h (gimple_eh_filter): New typedef.
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index d2d19ec..51b73f6 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -142,6 +142,10 @@ struct gimple_statement_eh_filter;
typedef struct gimple_statement_eh_filter *gimple_eh_filter;
typedef const struct gimple_statement_eh_filter *const_gimple_eh_filter;
+struct gimple_statement_eh_mnt;
+typedef struct gimple_statement_eh_mnt *gimple_eh_must_not_throw;
+typedef const struct gimple_statement_eh_mnt *const_gimple_eh_must_not_throw;
+
struct gimple_statement_phi;
typedef struct gimple_statement_phi *gimple_phi;
typedef const struct gimple_statement_phi *const_gimple_phi;
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 5876a0c..42f94a3 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1021,8 +1021,8 @@ dump_gimple_eh_filter (pretty_printer *buffer, gimple_eh_filter gs, int spc,
/* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
static void
-dump_gimple_eh_must_not_throw (pretty_printer *buffer, gimple gs,
- int spc, int flags)
+dump_gimple_eh_must_not_throw (pretty_printer *buffer,
+ gimple_eh_must_not_throw gs, int spc, int flags)
{
if (flags & TDF_RAW)
dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs,
@@ -2203,7 +2203,9 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
break;
case GIMPLE_EH_MUST_NOT_THROW:
- dump_gimple_eh_must_not_throw (buffer, gs, spc, flags);
+ dump_gimple_eh_must_not_throw (buffer,
+ as_a <gimple_eh_must_not_throw> (gs),
+ spc, flags);
break;
case GIMPLE_EH_ELSE:
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index a4130a5..1d1ad27 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -127,7 +127,9 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
break;
case GIMPLE_EH_MUST_NOT_THROW:
- gimple_eh_must_not_throw_set_fndecl (stmt, stream_read_tree (ib, data_in));
+ gimple_eh_must_not_throw_set_fndecl (
+ as_a <gimple_eh_must_not_throw> (stmt),
+ stream_read_tree (ib, data_in));
break;
case GIMPLE_EH_DISPATCH:
diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c
index cc87e88..41a4dc4 100644
--- a/gcc/gimple-streamer-out.c
+++ b/gcc/gimple-streamer-out.c
@@ -101,7 +101,10 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
break;
case GIMPLE_EH_MUST_NOT_THROW:
- stream_write_tree (ob, gimple_eh_must_not_throw_fndecl (stmt), true);
+ stream_write_tree (ob,
+ gimple_eh_must_not_throw_fndecl (
+ as_a <gimple_eh_must_not_throw> (stmt)),
+ true);
break;
case GIMPLE_EH_DISPATCH:
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 3b1ff98..a52d989 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -644,10 +644,12 @@ gimple_build_eh_filter (tree types, gimple_seq failure)
/* Build a GIMPLE_EH_MUST_NOT_THROW statement. */
-gimple
+gimple_eh_must_not_throw
gimple_build_eh_must_not_throw (tree decl)
{
- gimple p = gimple_alloc (GIMPLE_EH_MUST_NOT_THROW, 0);
+ gimple_eh_must_not_throw p =
+ as_a <gimple_eh_must_not_throw> (
+ gimple_alloc (GIMPLE_EH_MUST_NOT_THROW, 0));
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
gcc_assert (flags_from_decl_or_type (decl) & ECF_NORETURN);
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 0d95035..445a1c0 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1327,7 +1327,7 @@ gimple_asm gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
vec<tree, va_gc> *);
gimple_catch gimple_build_catch (tree, gimple_seq);
gimple_eh_filter gimple_build_eh_filter (tree, gimple_seq);
-gimple gimple_build_eh_must_not_throw (tree);
+gimple_eh_must_not_throw gimple_build_eh_must_not_throw (tree);
gimple gimple_build_eh_else (gimple_seq, gimple_seq);
gimple_statement_try *gimple_build_try (gimple_seq, gimple_seq,
enum gimple_try_flags);
@@ -3652,18 +3652,17 @@ gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
/* Get the function decl to be called by the MUST_NOT_THROW region. */
static inline tree
-gimple_eh_must_not_throw_fndecl (gimple gs)
+gimple_eh_must_not_throw_fndecl (gimple_eh_must_not_throw eh_mnt_stmt)
{
- gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt *> (gs);
return eh_mnt_stmt->fndecl;
}
/* Set the function decl to be called by GS to DECL. */
static inline void
-gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
+gimple_eh_must_not_throw_set_fndecl (gimple_eh_must_not_throw eh_mnt_stmt,
+ tree decl)
{
- gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt *> (gs);
eh_mnt_stmt->fndecl = decl;
}
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 15dcf51..d22eb45 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -1861,7 +1861,8 @@ lower_eh_must_not_throw (struct leh_state *state, gimple tp)
this_region = gen_eh_region_must_not_throw (state->cur_region);
this_region->u.must_not_throw.failure_decl
- = gimple_eh_must_not_throw_fndecl (inner);
+ = gimple_eh_must_not_throw_fndecl (
+ as_a <gimple_eh_must_not_throw> (inner));
this_region->u.must_not_throw.failure_loc
= LOCATION_LOCUS (gimple_location (tp));
--
1.8.5.3
next prev parent reply other threads:[~2014-10-27 20:35 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 20:35 [gimple-classes, committed 00/92] Initial slew of commits David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 22/92] Introduce gimple_transaction David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 20/92] Introduce gimple_goto David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 03/92] Introduce gimple_cond and use it in various places David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 19/92] Introduce gimple_return David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 27/92] Introduce gimple_resx David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 38/92] tree-cfg.c: Make verify_gimple_call require a gimple_call David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 33/92] Introduce gimple_omp_atomic_store David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 45/92] omp-low.c: Use more concrete types of gimple statement for various locals David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 14/92] tree-ssa-loop-manip.c: use gimple_phi in three places David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 06/92] Introduce gimple_debug and use it in a few places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 69/92] Concretize gimple_cond_make_{false|true} David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 01/92] Introduce gimple_switch and use it in various places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 43/92] Introduce gimple_omp_sections David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 66/92] Concretize three gimple_return_ accessors David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 04/92] Introduce gimple_assign and use it in various places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 70/92] Concretize gimple_switch_index and gimple_switch_index_ptr David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 71/92] Concretize gimple_cond_{true|false}_label David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 57/92] Make gimple_goto_set_dest require a gimple_goto David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 05/92] Introduce gimple_label and use it in a few places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 92/92] Update gimple.texi class hierarchy diagram David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 40/92] Introduce gimple_omp_single David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 51/92] More gimple_phi David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 39/92] Introduce gimple_omp_task David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 61/92] Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 87/92] Convert various gimple to gimple_phi within ssa-iterators.h David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 82/92] Concretize gimple_call_arg_flags David Malcolm
2014-10-27 20:36 ` David Malcolm [this message]
2014-10-27 20:37 ` [gimple-classes, committed 83/92] Concretize gimple_assign_nontemporal_move_p David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 85/92] Use gimple_call in some places within tree-ssa-dom.c David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 84/92] Concretize gimple_call_copy_flags and ipa_modify_call_arguments David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 63/92] Concretize three gimple_try_set_ accessors David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 86/92] Use gimple_phi in many more places David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 77/92] Concretize gimple_call_nothrow_p David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 90/92] Automated renaming of gimple subclasses David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 68/92] Concretize locals within expand_omp_for_init_counts David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 54/92] Various gimple to gimple_call conversions in IPA David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 49/92] Update GRAPHITE to use more concrete gimple statement classes David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 72/92] Concretize gimple_cond_set_code David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 31/92] Use more concrete types for various gimple statements David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 88/92] Preparatory work before subclass renaming David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 02/92] Introduce gimple_bind and use it for accessors David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 74/92] Concretize gimple_cond_{lhs|rhs}_ptr David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 75/92] Concretize various expressions from gimple to gimple_cond David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 73/92] Concretize gimple_cond_set_{lhs|rhs} David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 80/92] Concretize gimple_call_set_fntype David Malcolm
2014-10-27 20:40 ` [gimple-classes, committed 09/92] Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi David Malcolm
2014-10-27 20:47 ` [gimple-classes, committed 89/92] Eliminate subclass typedefs from coretypes.h David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 64/92] Make gimple_phi_arg_location_from_edge require a gimple_phi David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 78/92] Tweak to gimplify_modify_expr David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 15/92] tree-ssa-loop-ivopts.c: use gimple_phi in a few places David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 10/92] tree-parloops.c: use gimple_phi in various places David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 37/92] Introduce gimple_omp_parallel David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 28/92] Introduce gimple_eh_dispatch David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 58/92] Concretize gimple_catch_types David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 35/92] Introduce gimple_omp_critical David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 13/92] tree-ssa-loop-niter.c: use gimple_phi in a few places David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 23/92] Introduce gimple_catch David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 60/92] Concretize gimple_label_label David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 42/92] Introduce gimple_omp_teams David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 34/92] Introduce gimple_omp_continue David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 47/92] Make add_phi_arg require a gimple_phi David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 56/92] Make gimple_label_set_label require a gimple_label David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 12/92] tree-ssa-phiprop.c: use gimple_phi David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 11/92] tree-predcom.c: use gimple_phi in various places David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 79/92] Concretize gimple_call_set_fn David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 67/92] Make gimple_cond_set_{true|false}_label require gimple_cond David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 21/92] Introduce gimple_asm David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 59/92] Concretize gimple_call_use_set and gimple_call_clobber_set David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 36/92] Introduce gimple_omp_for David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 46/92] Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 41/92] Introduce gimple_omp_target David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 44/92] tree-parloops.c: Use gimple_phi in various places David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 48/92] Make gimple_phi_arg_set_location require a gimple_phi David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 18/92] Introduce gimple_call David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 07/92] Introduce gimple_phi and use it in various places David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 62/92] Concretize gimple_try_set_catch_is_cleanup David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 30/92] Introduce gimple_try David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 81/92] Concretize gimple_call_set_tail and gimple_call_tail_p David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 76/92] Concretize gimple_call_set_nothrow David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 52/92] Make gimple_call_return_slot_opt_p require a gimple_call David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 91/92] Remove out-of-date references to typedefs David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 24/92] Introduce gimple_eh_filter David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 53/92] Use gimple_call for callgraph edges David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 50/92] Make gimple_phi_arg_edge require a gimple_phi David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 32/92] Introduce gimple_omp_atomic_load David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 29/92] Use subclasses of gimple in various places David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 17/92] Concretize get_loop_exit_condition et al to working on gimple_cond David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 16/92] Update various expressions within tree-scalar-evolution.c to be gimple_phi David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 08/92] Introduce gimple_phi_iterator David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 26/92] Introduce gimple_eh_else David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 65/92] Make gimple_phi_arg_location require a gimple_phi David Malcolm
2014-10-27 21:32 ` [gimple-classes, committed 55/92] Concretize parameter to gimple_call_copy_skip_args David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414442490-14841-26-git-send-email-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).