]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gimple-ssa.h
Update copyright years.
[thirdparty/gcc.git] / gcc / gimple-ssa.h
index 904f002d54e0ef30d69ab571bf0760c291390ef2..4b3b7672553940a891f07926da5e0d9349206785 100644 (file)
@@ -1,6 +1,6 @@
 /* Header file for routines that straddle the border between GIMPLE and
    SSA in gimple.
-   Copyright (C) 2009-2014 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -26,22 +26,50 @@ along with GCC; see the file COPYING3.  If not see
 /* This structure is used to map a gimple statement to a label,
    or list of labels to represent transaction restart.  */
 
-struct GTY(()) tm_restart_node {
-  gimple stmt;
+struct GTY((for_user)) tm_restart_node {
+  gimple *stmt;
   tree label_or_list;
 };
 
+/* Hasher for tm_restart_node.  */
+
+struct tm_restart_hasher : ggc_ptr_hash<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;
+  }
+};
+
+extern void gt_ggc_mx (gimple *&);
+extern void gt_pch_nx (gimple *&);
+
+struct ssa_name_hasher : ggc_ptr_hash<tree_node>
+{
+  /* Hash a tree in a uid_decl_map.  */
+
+  static hashval_t
+  hash (tree item)
+  {
+    return item->ssa_name.var->decl_minimal.uid;
+  }
+
+  /* Return true if the DECL_UID in both trees are equal.  */
+
+  static bool
+  equal (tree a, tree b)
+{
+  return (a->ssa_name.var->decl_minimal.uid == b->ssa_name.var->decl_minimal.uid);
+}
+};
+
 /* Gimple dataflow datastructure. All publicly available fields shall have
    gimple_ accessor defined, all publicly modifiable fields should have
    gimple_set accessor.  */
 struct GTY(()) gimple_df {
-  /* A vector of all the noreturn calls passed to modify_stmt.
-     cleanup_control_flow uses it to detect cases where a mid-block
-     indirect call has been turned into a noreturn call.  When this
-     happens, all the instructions after the call are no longer
-     reachable and must be deleted as dead.  */
-  vec<gimple, va_gc> *modified_noreturn_calls;
-
   /* Array of all SSA_NAMEs used in the function.  */
   vec<tree, va_gc> *ssa_names;
 
@@ -53,16 +81,19 @@ struct GTY(()) gimple_df {
 
   /* A map of decls to artificial ssa-names that point to the partition
      of the decl.  */
-  struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
+  hash_map<tree, tree> * GTY((skip(""))) decls_to_pointers;
 
   /* Free list of SSA_NAMEs.  */
   vec<tree, va_gc> *free_ssanames;
 
+  /* Queue of SSA_NAMEs to be freed at the next opportunity.  */
+  vec<tree, va_gc> *free_ssanames_queue;
+
   /* Hashtable holding definition for symbol.  If this field is not NULL, it
      means that the first reference to this variable in the function is a
      USE or a VUSE.  In those cases, the SSA renamer creates an SSA name
      for this variable with an empty defining statement.  */
-  htab_t GTY((param_is (union tree_node))) default_defs;
+  hash_table<ssa_name_hasher> *default_defs;
 
   /* True if there are any symbols that need to be renamed.  */
   unsigned int ssa_renaming_needed : 1;
@@ -80,7 +111,7 @@ struct GTY(()) gimple_df {
 
   /* Map gimple stmt to tree label (or list of labels) for transaction
      restart and abort.  */
-  htab_t GTY ((param_is (struct tm_restart_node))) tm_restart;
+  hash_table<tm_restart_hasher> *tm_restart;
 };
 
 
@@ -105,7 +136,7 @@ gimple_vop (const struct function *fun)
 /* Return the set of VUSE operand for statement G.  */
 
 static inline use_operand_p
-gimple_vuse_op (const_gimple g)
+gimple_vuse_op (const gimple *g)
 {
   struct use_optype_d *ops;
   const gimple_statement_with_memory_ops *mem_ops_stmt =
@@ -122,7 +153,7 @@ gimple_vuse_op (const_gimple g)
 /* Return the set of VDEF operand for statement G.  */
 
 static inline def_operand_p
-gimple_vdef_op (gimple g)
+gimple_vdef_op (gimple *g)
 {
   gimple_statement_with_memory_ops *mem_ops_stmt =
      dyn_cast <gimple_statement_with_memory_ops *> (g);
@@ -136,7 +167,7 @@ gimple_vdef_op (gimple g)
 /* Mark statement S as modified, and update it.  */
 
 static inline void
-update_stmt (gimple s)
+update_stmt (gimple *s)
 {
   if (gimple_has_ops (s))
     {
@@ -148,7 +179,7 @@ update_stmt (gimple s)
 /* Update statement S if it has been optimized.  */
 
 static inline void
-update_stmt_if_modified (gimple s)
+update_stmt_if_modified (gimple *s)
 {
   if (gimple_modified_p (s))
     update_stmt_operands (cfun, s);
@@ -157,7 +188,7 @@ update_stmt_if_modified (gimple s)
 /* Mark statement S as modified, and update it.  */
 
 static inline void
-update_stmt_fn (struct function *fn, gimple s)
+update_stmt_fn (struct function *fn, gimple *s)
 {
   if (gimple_has_ops (s))
     {