tree-ssa.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Header file for any pass which requires SSA routines.
  2. Copyright (C) 2013-2015 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. source_location locus; /* PHI arg location. */
  22. };
  23. typedef struct _edge_var_map edge_var_map;
  24. /* A vector of var maps. */
  25. typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
  26. extern void redirect_edge_var_map_add (edge, tree, tree, source_location);
  27. extern void redirect_edge_var_map_clear (edge);
  28. extern void redirect_edge_var_map_dup (edge, edge);
  29. extern vec<edge_var_map> *redirect_edge_var_map_vector (edge);
  30. extern void redirect_edge_var_map_destroy (void);
  31. extern edge ssa_redirect_edge (edge, basic_block);
  32. extern void flush_pending_stmts (edge);
  33. extern void gimple_replace_ssa_lhs (gimple, tree);
  34. extern tree target_for_debug_bind (tree);
  35. extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
  36. extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
  37. extern void reset_debug_uses (gimple);
  38. extern void release_defs_bitset (bitmap toremove);
  39. extern void verify_ssa (bool, bool);
  40. extern void init_tree_ssa (struct function *);
  41. extern void delete_tree_ssa (void);
  42. extern bool tree_ssa_useless_type_conversion (tree);
  43. extern tree tree_ssa_strip_useless_type_conversions (tree);
  44. extern bool ssa_undefined_value_p (tree, bool = true);
  45. extern void execute_update_addresses_taken (void);
  46. /* Given an edge_var_map V, return the PHI arg definition. */
  47. static inline tree
  48. redirect_edge_var_map_def (edge_var_map *v)
  49. {
  50. return v->def;
  51. }
  52. /* Given an edge_var_map V, return the PHI result. */
  53. static inline tree
  54. redirect_edge_var_map_result (edge_var_map *v)
  55. {
  56. return v->result;
  57. }
  58. /* Given an edge_var_map V, return the PHI arg location. */
  59. static inline source_location
  60. redirect_edge_var_map_location (edge_var_map *v)
  61. {
  62. return v->locus;
  63. }
  64. #endif /* GCC_TREE_SSA_H */