dominance.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Calculate (post)dominators header file.
  2. Copyright (C) 2014-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
  5. under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  11. License 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_DOMINANCE_H
  16. #define GCC_DOMINANCE_H
  17. enum cdi_direction
  18. {
  19. CDI_DOMINATORS = 1,
  20. CDI_POST_DOMINATORS = 2
  21. };
  22. /* State of dominance information. */
  23. enum dom_state
  24. {
  25. DOM_NONE, /* Not computed at all. */
  26. DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
  27. DOM_OK /* Everything is ok. */
  28. };
  29. extern void calculate_dominance_info (enum cdi_direction);
  30. extern void free_dominance_info (function *, enum cdi_direction);
  31. extern void free_dominance_info (enum cdi_direction);
  32. extern basic_block get_immediate_dominator (enum cdi_direction, basic_block);
  33. extern void set_immediate_dominator (enum cdi_direction, basic_block,
  34. basic_block);
  35. extern vec<basic_block> get_dominated_by (enum cdi_direction, basic_block);
  36. extern vec<basic_block> get_dominated_by_region (enum cdi_direction,
  37. basic_block *,
  38. unsigned);
  39. extern vec<basic_block> get_dominated_to_depth (enum cdi_direction,
  40. basic_block, int);
  41. extern vec<basic_block> get_all_dominated_blocks (enum cdi_direction,
  42. basic_block);
  43. extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
  44. basic_block);
  45. extern basic_block nearest_common_dominator (enum cdi_direction,
  46. basic_block, basic_block);
  47. extern basic_block nearest_common_dominator_for_set (enum cdi_direction,
  48. bitmap);
  49. extern bool dominated_by_p (enum cdi_direction, const_basic_block,
  50. const_basic_block);
  51. unsigned bb_dom_dfs_in (enum cdi_direction, basic_block);
  52. unsigned bb_dom_dfs_out (enum cdi_direction, basic_block);
  53. extern void verify_dominators (enum cdi_direction);
  54. basic_block recompute_dominator (enum cdi_direction, basic_block);
  55. extern void iterate_fix_dominators (enum cdi_direction,
  56. vec<basic_block> , bool);
  57. extern void add_to_dominance_info (enum cdi_direction, basic_block);
  58. extern void delete_from_dominance_info (enum cdi_direction, basic_block);
  59. extern basic_block first_dom_son (enum cdi_direction, basic_block);
  60. extern basic_block next_dom_son (enum cdi_direction, basic_block);
  61. extern enum dom_state dom_info_state (function *, enum cdi_direction);
  62. extern enum dom_state dom_info_state (enum cdi_direction);
  63. extern void set_dom_info_availability (enum cdi_direction, enum dom_state);
  64. extern bool dom_info_available_p (function *, enum cdi_direction);
  65. extern bool dom_info_available_p (enum cdi_direction);
  66. #endif /* GCC_DOMINANCE_H */