123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- #ifndef GCC_GIMPLE_SSA_H
- #define GCC_GIMPLE_SSA_H
- #include "hash-map.h"
- #include "tree-hasher.h"
- #include "tree-ssa-operands.h"
- struct GTY((for_user)) tm_restart_node {
- gimple stmt;
- tree label_or_list;
- };
- struct tm_restart_hasher : ggc_hasher<tm_restart_node *>
- {
- static hashval_t hash (tm_restart_node *n) { return htab_hash_pointer (n); }
- static bool
- equal (tm_restart_node *a, tm_restart_node *b)
- {
- return a == b;
- }
- };
- struct ssa_name_hasher : ggc_hasher<tree>
- {
-
- static hashval_t
- hash (tree item)
- {
- return item->ssa_name.var->decl_minimal.uid;
- }
-
- static bool
- equal (tree a, tree b)
- {
- return (a->ssa_name.var->decl_minimal.uid == b->ssa_name.var->decl_minimal.uid);
- }
- };
- struct GTY(()) gimple_df {
-
- vec<gimple, va_gc> *modified_noreturn_calls;
-
- vec<tree, va_gc> *ssa_names;
-
- tree vop;
-
- struct pt_solution escaped;
-
- hash_map<tree, tree> * GTY((skip(""))) decls_to_pointers;
-
- vec<tree, va_gc> *free_ssanames;
-
- hash_table<ssa_name_hasher> *default_defs;
-
- unsigned int ssa_renaming_needed : 1;
-
- unsigned int rename_vops : 1;
-
- unsigned int in_ssa_p : 1;
-
- unsigned int ipa_pta : 1;
- struct ssa_operands ssa_operands;
-
- hash_table<tm_restart_hasher> *tm_restart;
- };
- static inline bool
- gimple_in_ssa_p (const struct function *fun)
- {
- return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
- }
- static inline tree
- gimple_vop (const struct function *fun)
- {
- gcc_checking_assert (fun && fun->gimple_df);
- return fun->gimple_df->vop;
- }
- static inline use_operand_p
- gimple_vuse_op (const_gimple g)
- {
- struct use_optype_d *ops;
- const gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <const gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL_USE_OPERAND_P;
- ops = mem_ops_stmt->use_ops;
- if (ops
- && USE_OP_PTR (ops)->use == &mem_ops_stmt->vuse)
- return USE_OP_PTR (ops);
- return NULL_USE_OPERAND_P;
- }
- static inline def_operand_p
- gimple_vdef_op (gimple g)
- {
- gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL_DEF_OPERAND_P;
- if (mem_ops_stmt->vdef)
- return &mem_ops_stmt->vdef;
- return NULL_DEF_OPERAND_P;
- }
- static inline void
- update_stmt (gimple s)
- {
- if (gimple_has_ops (s))
- {
- gimple_set_modified (s, true);
- update_stmt_operands (cfun, s);
- }
- }
- static inline void
- update_stmt_if_modified (gimple s)
- {
- if (gimple_modified_p (s))
- update_stmt_operands (cfun, s);
- }
- static inline void
- update_stmt_fn (struct function *fn, gimple s)
- {
- if (gimple_has_ops (s))
- {
- gimple_set_modified (s, true);
- update_stmt_operands (fn, s);
- }
- }
- #endif
|