@@ -887,7 +887,7 @@ BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
cfg-flags.def cfghooks.h
GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
- tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H)
+ tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h
GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
RECOG_H = recog.h
EMIT_RTL_H = emit-rtl.h
@@ -61,9 +61,8 @@ typedef const struct rtvec_def *const_rtvec;
union tree_node;
typedef union tree_node *tree;
typedef const union tree_node *const_tree;
-union gimple_statement_d;
-typedef union gimple_statement_d *gimple;
-typedef const union gimple_statement_d *const_gimple;
+typedef struct gimple_statement_base *gimple;
+typedef const struct gimple_statement_base *const_gimple;
typedef gimple gimple_seq;
struct gimple_stmt_iterator_d;
typedef struct gimple_stmt_iterator_d gimple_stmt_iterator;
@@ -269,10 +269,10 @@ ggc_alloc_cleared_tree_node_stat (size_t s MEM_STAT_DECL)
return (union tree_node *) ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
}
-static inline union gimple_statement_d *
-ggc_alloc_cleared_gimple_statement_d_stat (size_t s MEM_STAT_DECL)
+static inline struct gimple_statement_base *
+ggc_alloc_cleared_gimple_statement_stat (size_t s MEM_STAT_DECL)
{
- return (union gimple_statement_d *)
+ return (struct gimple_statement_base *)
ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
}
@@ -86,13 +86,13 @@ print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
}
DEBUG_FUNCTION void
-debug (gimple_statement_d &ref)
+debug (gimple_statement_base &ref)
{
print_gimple_stmt (stderr, &ref, 0, 0);
}
DEBUG_FUNCTION void
-debug (gimple_statement_d *ptr)
+debug (gimple_statement_base *ptr)
{
if (ptr)
debug (*ptr);
@@ -29,8 +29,8 @@ extern void debug_gimple_stmt (gimple);
extern void debug_gimple_seq (gimple_seq);
extern void print_gimple_seq (FILE *, gimple_seq, int, int);
extern void print_gimple_stmt (FILE *, gimple, int, int);
-extern void debug (gimple_statement_d &ref);
-extern void debug (gimple_statement_d *ptr);
+extern void debug (gimple_statement_base &ref);
+extern void debug (gimple_statement_base *ptr);
extern void print_gimple_expr (FILE *, gimple, int, int);
extern void pp_gimple_stmt_1 (pretty_printer *, gimple, int, int);
extern void gimple_dump_bb (FILE *, basic_block, int, int);
@@ -126,7 +126,7 @@ gimple_alloc_stat (enum gimple_code code, unsigned num_ops MEM_STAT_DECL)
gimple_alloc_sizes[(int) kind] += size;
}
- stmt = ggc_alloc_cleared_gimple_statement_d_stat (size PASS_MEM_STAT);
+ stmt = ggc_alloc_cleared_gimple_statement_stat (size PASS_MEM_STAT);
gimple_set_code (stmt, code);
gimple_set_num_ops (stmt, num_ops);
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "internal-fn.h"
#include "gimple-fold.h"
#include "tree-eh.h"
+#include "is-a.h"
typedef gimple gimple_seq_node;
@@ -158,7 +159,10 @@ struct gimple_stmt_iterator_d
/* Data structure definitions for GIMPLE tuples. NOTE: word markers
are for 64 bit hosts. */
-struct GTY((chain_next ("%h.next"))) gimple_statement_base {
+struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
+ chain_next ("%h.next"), variable_size))
+ gimple_statement_base
+{
/* [ WORD 1 ]
Main identifying code for a tuple. */
ENUM_BITFIELD(gimple_code) code : 8;
@@ -222,10 +226,11 @@ struct GTY((chain_next ("%h.next"))) gimple_statement_base {
/* Base structure for tuples with operands. */
-struct GTY(()) gimple_statement_with_ops_base
+/* This gimple subclass has no tag value. */
+struct GTY(())
+ gimple_statement_with_ops_base : public gimple_statement_base
{
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
SSA operand vectors. NOTE: It should be possible to
@@ -238,25 +243,25 @@ struct GTY(()) gimple_statement_with_ops_base
/* Statements that take register operands. */
-struct GTY(()) gimple_statement_with_ops
+struct GTY((tag("GSS_WITH_OPS")))
+ gimple_statement_with_ops : public gimple_statement_with_ops_base
{
- /* [ WORD 1-7 ] */
- struct gimple_statement_with_ops_base opbase;
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* Base for statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_with_memory_ops_base
+struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
+ gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
{
- /* [ WORD 1-7 ] */
- struct gimple_statement_with_ops_base opbase;
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8-9 ]
Virtual operands for this statement. The GC will pick them
@@ -268,32 +273,33 @@ struct GTY(()) gimple_statement_with_memory_ops_base
/* Statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_with_memory_ops
+struct GTY((tag("GSS_WITH_MEM_OPS")))
+ gimple_statement_with_memory_ops :
+ public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* Call statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_call
+struct GTY((tag("GSS_CALL")))
+ gimple_statement_call : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10-13 ] */
struct pt_solution call_used;
struct pt_solution call_clobbered;
/* [ WORD 14 ] */
- union GTY ((desc ("%1.membase.opbase.gsbase.subcode & GF_CALL_INTERNAL"))) {
+ union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
tree GTY ((tag ("0"))) fntype;
enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
} u;
@@ -302,15 +308,16 @@ struct GTY(()) gimple_statement_call
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* OpenMP statements (#pragma omp). */
-struct GTY(()) gimple_statement_omp {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP")))
+ gimple_statement_omp : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
gimple_seq body;
@@ -319,9 +326,10 @@ struct GTY(()) gimple_statement_omp {
/* GIMPLE_BIND */
-struct GTY(()) gimple_statement_bind {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_BIND")))
+ gimple_statement_bind : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Variables declared in this scope. */
@@ -342,9 +350,10 @@ struct GTY(()) gimple_statement_bind {
/* GIMPLE_CATCH */
-struct GTY(()) gimple_statement_catch {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_CATCH")))
+ gimple_statement_catch : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree types;
@@ -356,9 +365,10 @@ struct GTY(()) gimple_statement_catch {
/* GIMPLE_EH_FILTER */
-struct GTY(()) gimple_statement_eh_filter {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_FILTER")))
+ gimple_statement_eh_filter : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Filter types. */
@@ -371,9 +381,10 @@ struct GTY(()) gimple_statement_eh_filter {
/* GIMPLE_EH_ELSE */
-struct GTY(()) gimple_statement_eh_else {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_ELSE")))
+ gimple_statement_eh_else : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7,8 ] */
gimple_seq n_body, e_body;
@@ -381,9 +392,10 @@ struct GTY(()) gimple_statement_eh_else {
/* GIMPLE_EH_MUST_NOT_THROW */
-struct GTY(()) gimple_statement_eh_mnt {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_MNT")))
+ gimple_statement_eh_mnt : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] Abort function decl. */
tree fndecl;
@@ -391,9 +403,10 @@ struct GTY(()) gimple_statement_eh_mnt {
/* GIMPLE_PHI */
-struct GTY(()) gimple_statement_phi {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_PHI")))
+ gimple_statement_phi : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
unsigned capacity;
@@ -409,10 +422,10 @@ struct GTY(()) gimple_statement_phi {
/* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
-struct GTY(()) gimple_statement_eh_ctrl
+struct GTY((tag("GSS_EH_CTRL")))
+ gimple_statement_eh_ctrl : public gimple_statement_base
{
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Exception region number. */
@@ -422,9 +435,10 @@ struct GTY(()) gimple_statement_eh_ctrl
/* GIMPLE_TRY */
-struct GTY(()) gimple_statement_try {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_TRY")))
+ gimple_statement_try : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Expression to evaluate. */
@@ -451,9 +465,10 @@ enum gimple_try_flags
/* GIMPLE_WITH_CLEANUP_EXPR */
-struct GTY(()) gimple_statement_wce {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_WCE")))
+ gimple_statement_wce : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
executed if an exception is thrown, not on normal exit of its
@@ -468,10 +483,10 @@ struct GTY(()) gimple_statement_wce {
/* GIMPLE_ASM */
-struct GTY(()) gimple_statement_asm
+struct GTY((tag("GSS_ASM")))
+ gimple_statement_asm : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
__asm__ statement. */
@@ -488,14 +503,15 @@ struct GTY(()) gimple_statement_asm
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* GIMPLE_OMP_CRITICAL */
-struct GTY(()) gimple_statement_omp_critical {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_CRITICAL")))
+ gimple_statement_omp_critical : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Critical section name. */
@@ -522,9 +538,10 @@ struct GTY(()) gimple_omp_for_iter {
/* GIMPLE_OMP_FOR */
-struct GTY(()) gimple_statement_omp_for {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_FOR")))
+ gimple_statement_omp_for : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
@@ -544,9 +561,10 @@ struct GTY(()) gimple_statement_omp_for {
/* GIMPLE_OMP_PARALLEL */
-struct GTY(()) gimple_statement_omp_parallel {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_PARALLEL")))
+ gimple_statement_omp_parallel : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Clauses. */
@@ -564,9 +582,10 @@ struct GTY(()) gimple_statement_omp_parallel {
/* GIMPLE_OMP_TASK */
-struct GTY(()) gimple_statement_omp_task {
- /* [ WORD 1-10 ] */
- struct gimple_statement_omp_parallel par;
+struct GTY((tag("GSS_OMP_TASK")))
+ gimple_statement_omp_task : public gimple_statement_omp_parallel
+{
+ /* [ WORD 1-10 ] : base class */
/* [ WORD 11 ]
Child function holding firstprivate initialization if needed. */
@@ -585,9 +604,10 @@ struct GTY(()) gimple_statement_omp_task {
/* GIMPLE_OMP_SECTIONS */
-struct GTY(()) gimple_statement_omp_sections {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_SECTIONS")))
+ gimple_statement_omp_sections : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
@@ -603,9 +623,10 @@ struct GTY(()) gimple_statement_omp_sections {
Note: This does not inherit from gimple_statement_omp, because we
do not need the body field. */
-struct GTY(()) gimple_statement_omp_continue {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_CONTINUE")))
+ gimple_statement_omp_continue : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree control_def;
@@ -616,9 +637,10 @@ struct GTY(()) gimple_statement_omp_continue {
/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS */
-struct GTY(()) gimple_statement_omp_single {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_SINGLE")))
+ gimple_statement_omp_single : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 7 ] */
tree clauses;
@@ -629,9 +651,10 @@ struct GTY(()) gimple_statement_omp_single {
Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
contains a sequence, which we don't need here. */
-struct GTY(()) gimple_statement_omp_atomic_load {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
+ gimple_statement_omp_atomic_load : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7-8 ] */
tree rhs, lhs;
@@ -640,9 +663,10 @@ struct GTY(()) gimple_statement_omp_atomic_load {
/* GIMPLE_OMP_ATOMIC_STORE.
See note on GIMPLE_OMP_ATOMIC_LOAD. */
-struct GTY(()) gimple_statement_omp_atomic_store {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_ATOMIC_STORE")))
+ gimple_statement_omp_atomic_store : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree val;
@@ -676,10 +700,10 @@ struct GTY(()) gimple_statement_omp_atomic_store {
likely because it is guaranteed to go irrevocable upon entry. */
#define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
-struct GTY(()) gimple_statement_transaction
+struct GTY((tag("GSS_TRANSACTION")))
+ gimple_statement_transaction : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base gsbase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ] */
gimple_seq body;
@@ -695,40 +719,6 @@ enum gimple_statement_structure_enum {
};
#undef DEFGSSTRUCT
-
-/* Define the overall contents of a gimple tuple. It may be any of the
- structures declared above for various types of tuples. */
-
-union GTY ((desc ("gimple_statement_structure (&%h)"),
- chain_next ("%h.gsbase.next"), variable_size)) gimple_statement_d {
- struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
- struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
- struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
- struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
- struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
- struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
- struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
- struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
- struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
- struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
- struct gimple_statement_eh_else GTY ((tag ("GSS_EH_ELSE"))) gimple_eh_else;
- struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
- struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
- struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
- struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
- struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
- struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
- struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
- struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
- struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
- struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
- struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
- struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
- struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
- struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
- struct gimple_statement_transaction GTY((tag ("GSS_TRANSACTION"))) gimple_transaction;
-};
-
/* Offset in bytes to the location of the operand vector.
Zero if there is no operand vector for this tuple structure. */
extern size_t const gimple_ops_offset_[];
@@ -1013,7 +1013,7 @@ helper_const_non_const_cast (const char *p)
#define CONST_CAST_TREE(X) CONST_CAST (union tree_node *, (X))
#define CONST_CAST_RTX(X) CONST_CAST (struct rtx_def *, (X))
#define CONST_CAST_BB(X) CONST_CAST (struct basic_block_def *, (X))
-#define CONST_CAST_GIMPLE(X) CONST_CAST (union gimple_statement_d *, (X))
+#define CONST_CAST_GIMPLE(X) CONST_CAST (struct gimple_statement_base *, (X))
/* Activate certain diagnostics as warnings (not errors via the
-Werror flag). */
@@ -1693,7 +1693,7 @@ evaluate_stmt (gimple stmt)
return val;
}
-typedef hash_table <pointer_hash <gimple_statement_d> > gimple_htab;
+typedef hash_table <pointer_hash <gimple_statement_base> > gimple_htab;
/* Given a BUILT_IN_STACK_SAVE value SAVED_VAL, insert a clobber of VAR before
each matching BUILT_IN_STACK_RESTORE. Mark visited phis in VISITED. */