tree-ssa.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* Header file for any pass which requires SSA routines.
  2. Copyright (C) 2013-2019 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_TREE_SSA_H
  16. #define GCC_TREE_SSA_H
  17. /* Mapping for redirected edges. */
  18. struct edge_var_map {
  19. tree result; /* PHI result. */
  20. tree def; /* PHI arg definition. */
  21. location_t locus; /* PHI arg location. */
  22. };
  23. /* A vector of var maps. */
  24. typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
  25. extern void redirect_edge_var_map_add (edge, tree, tree, location_t);
  26. extern void redirect_edge_var_map_clear (edge);
  27. extern void redirect_edge_var_map_dup (edge, edge);
  28. extern vec<edge_var_map> *redirect_edge_var_map_vector (edge);
  29. extern void redirect_edge_var_map_empty (void);
  30. extern edge ssa_redirect_edge (edge, basic_block);
  31. extern void flush_pending_stmts (edge);
  32. extern void gimple_replace_ssa_lhs (gimple *, tree);
  33. extern tree target_for_debug_bind (tree);
  34. extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
  35. extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
  36. extern void reset_debug_uses (gimple *);
  37. extern void release_defs_bitset (bitmap toremove);
  38. extern void verify_ssa (bool, bool);
  39. extern void init_tree_ssa (function *);
  40. extern void delete_tree_ssa (function *);
  41. extern bool tree_ssa_useless_type_conversion (tree);
  42. extern tree tree_ssa_strip_useless_type_conversions (tree);
  43. extern bool ssa_defined_default_def_p (tree t);
  44. extern bool ssa_undefined_value_p (tree, bool = true);
  45. extern bool gimple_uses_undefined_value_p (gimple *);
  46. extern void execute_update_addresses_taken (void);
  47. /* Given an edge_var_map V, return the PHI arg definition. */
  48. static inline tree
  49. redirect_edge_var_map_def (edge_var_map *v)
  50. {
  51. return v->def;
  52. }
  53. /* Given an edge_var_map V, return the PHI result. */
  54. static inline tree
  55. redirect_edge_var_map_result (edge_var_map *v)
  56. {
  57. return v->result;
  58. }
  59. /* Given an edge_var_map V, return the PHI arg location. */
  60. static inline location_t
  61. redirect_edge_var_map_location (edge_var_map *v)
  62. {
  63. return v->locus;
  64. }
  65. /* Verify SSA invariants, if internal consistency checks are enabled. */
  66. static inline void
  67. checking_verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
  68. {
  69. if (flag_checking)
  70. verify_ssa (check_modified_stmt, check_ssa_operands);
  71. }
  72. #endif /* GCC_TREE_SSA_H */