This corresponds to:
  [PATCH 26/89] Introduce gimple_eh_filter
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01220.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_filter): New typedef.
        (const_gimple_eh_filter): New typedef.

        * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
        rather than a plain gimple.

        * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
        gimple_eh_filter rather than a plain gimple.
        (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
        GIMPLE_EH_FILTER case of switch statement.

        * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
        rather than a plain gimple.
---
 gcc/ChangeLog.gimple-classes | 18 ++++++++++++++++++
 gcc/coretypes.h              |  4 ++++
 gcc/gimple-pretty-print.c    |  5 +++--
 gcc/gimple.c                 |  5 +++--
 gcc/gimple.h                 |  2 +-
 5 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 04b611e..e91317c 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,23 @@
 2014-10-24  David Malcolm  <dmalc...@redhat.com>
 
+       Introduce gimple_eh_filter
+
+       * coretypes.h (gimple_eh_filter): New typedef.
+       (const_gimple_eh_filter): New typedef.
+
+       * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
+       rather than a plain gimple.
+
+       * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
+       gimple_eh_filter rather than a plain gimple.
+       (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
+       GIMPLE_EH_FILTER case of switch statement.
+
+       * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
+       rather than a plain gimple.
+
+2014-10-24  David Malcolm  <dmalc...@redhat.com>
+
        Introduce gimple_catch
 
        * coretypes.h (gimple_catch): New typedef.
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index bff57cc..d2d19ec 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -138,6 +138,10 @@ struct gimple_statement_catch;
 typedef struct gimple_statement_catch *gimple_catch;
 typedef const struct gimple_statement_catch *const_gimple_catch;
 
+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_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 f7287f6..5876a0c 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1004,7 +1004,8 @@ dump_gimple_catch (pretty_printer *buffer, gimple_catch 
gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_eh_filter (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_eh_filter (pretty_printer *buffer, gimple_eh_filter gs, int spc,
+                      int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+FAILURE <%S>%->", gs,
@@ -2198,7 +2199,7 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int 
spc, int flags)
       break;
 
     case GIMPLE_EH_FILTER:
-      dump_gimple_eh_filter (buffer, gs, spc, flags);
+      dump_gimple_eh_filter (buffer, as_a <gimple_eh_filter> (gs), spc, flags);
       break;
 
     case GIMPLE_EH_MUST_NOT_THROW:
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 61a9c83..3b1ff98 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -630,10 +630,11 @@ gimple_build_catch (tree types, gimple_seq handler)
    TYPES are the filter's types.
    FAILURE is the filter's failure action.  */
 
-gimple
+gimple_eh_filter
 gimple_build_eh_filter (tree types, gimple_seq failure)
 {
-  gimple p = gimple_alloc (GIMPLE_EH_FILTER, 0);
+  gimple_eh_filter p =
+    as_a <gimple_eh_filter> (gimple_alloc (GIMPLE_EH_FILTER, 0));
   gimple_eh_filter_set_types (p, types);
   if (failure)
     gimple_eh_filter_set_failure (p, failure);
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 23e6861..0d95035 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1326,7 +1326,7 @@ gimple_asm gimple_build_asm_vec (const char *, vec<tree, 
va_gc> *,
                                 vec<tree, va_gc> *, vec<tree, va_gc> *,
                                 vec<tree, va_gc> *);
 gimple_catch gimple_build_catch (tree, gimple_seq);
-gimple gimple_build_eh_filter (tree, gimple_seq);
+gimple_eh_filter gimple_build_eh_filter (tree, gimple_seq);
 gimple 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,
-- 
1.8.5.3

Reply via email to