From c35a1fc8b711d7043c20d6d497c5981fb83b0703 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 19 Dec 2013 13:57:49 -0500 Subject: [PATCH] Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure This corresponds to: [PATCH 63/89] Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01166.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK once prerequisites have gone in. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00830.html gcc/ * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter. (gimple_eh_filter_set_failure): Likewise. * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter within GIMPLE_EH_FILTER case. --- gcc/ChangeLog.gimple-classes | 9 +++++++++ gcc/gimple.c | 13 +++++++++---- gcc/gimple.h | 14 ++++++-------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 20deecf2ac6..ba0f5c195bc 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,14 @@ 2014-10-24 David Malcolm + Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure + + * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter. + (gimple_eh_filter_set_failure): Likewise. + * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter + within GIMPLE_EH_FILTER case. + +2014-10-24 David Malcolm + Concretize gimple_label_label * gimple.h (gimple_label_label): Require a const_gimple_label diff --git a/gcc/gimple.c b/gcc/gimple.c index 8721316b82e..07754776c20 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1686,10 +1686,15 @@ gimple_copy (gimple stmt) break; case GIMPLE_EH_FILTER: - new_seq = gimple_seq_copy (gimple_eh_filter_failure (stmt)); - gimple_eh_filter_set_failure (copy, new_seq); - t = unshare_expr (gimple_eh_filter_types (stmt)); - gimple_eh_filter_set_types (copy, t); + { + gimple_eh_filter eh_filter_stmt = as_a (stmt); + gimple_eh_filter eh_filter_copy = as_a (copy); + new_seq = + gimple_seq_copy (gimple_eh_filter_failure (eh_filter_stmt)); + gimple_eh_filter_set_failure (eh_filter_copy, new_seq); + t = unshare_expr (gimple_eh_filter_types (eh_filter_stmt)); + gimple_eh_filter_set_types (eh_filter_copy, t); + } break; case GIMPLE_EH_ELSE: diff --git a/gcc/gimple.h b/gcc/gimple.h index 1a017ca2cb4..79ee8baa06b 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -3620,25 +3620,23 @@ gimple_eh_filter_failure (gimple gs) } -/* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */ +/* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER + EH_FILTER_STMT. */ static inline void -gimple_eh_filter_set_types (gimple gs, tree types) +gimple_eh_filter_set_types (gimple_eh_filter eh_filter_stmt, tree types) { - gimple_statement_eh_filter *eh_filter_stmt = - as_a (gs); eh_filter_stmt->types = types; } /* Set FAILURE to be the sequence of statements to execute on failure - for GIMPLE_EH_FILTER GS. */ + for GIMPLE_EH_FILTER EH_FILTER_STMT. */ static inline void -gimple_eh_filter_set_failure (gimple gs, gimple_seq failure) +gimple_eh_filter_set_failure (gimple_eh_filter eh_filter_stmt, + gimple_seq failure) { - gimple_statement_eh_filter *eh_filter_stmt = - as_a (gs); eh_filter_stmt->failure = failure; } -- 2.11.4.GIT