tree-cfg.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* Data and Control Flow Analysis for Trees.
  2. Copyright (C) 2001-2019 Free Software Foundation, Inc.
  3. Contributed by Diego Novillo <dnovillo@redhat.com>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. GCC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef _TREE_CFG_H
  17. #define _TREE_CFG_H
  18. /* Location to track pending stmt for edge insertion. */
  19. #define PENDING_STMT(e) ((e)->insns.g)
  20. /* Garbage collection and PCH support for edge_def. */
  21. extern void gt_ggc_mx (edge_def *e);
  22. extern void gt_pch_nx (edge_def *e);
  23. extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
  24. extern void init_empty_tree_cfg_for_function (struct function *);
  25. extern void init_empty_tree_cfg (void);
  26. extern void start_recording_case_labels (void);
  27. extern void end_recording_case_labels (void);
  28. extern basic_block label_to_block (struct function *, tree);
  29. extern void cleanup_dead_labels (void);
  30. extern bool group_case_labels_stmt (gswitch *);
  31. extern bool group_case_labels (void);
  32. extern void replace_uses_by (tree, tree);
  33. extern basic_block single_noncomplex_succ (basic_block bb);
  34. extern void notice_special_calls (gcall *);
  35. extern void clear_special_calls (void);
  36. extern edge find_taken_edge (basic_block, tree);
  37. extern void gimple_debug_bb (basic_block);
  38. extern basic_block gimple_debug_bb_n (int);
  39. extern void gimple_debug_cfg (int);
  40. extern void gimple_dump_cfg (FILE *, dump_flags_t);
  41. extern void dump_cfg_stats (FILE *);
  42. extern void debug_cfg_stats (void);
  43. extern bool computed_goto_p (gimple *);
  44. extern bool stmt_can_make_abnormal_goto (gimple *);
  45. extern basic_block get_abnormal_succ_dispatcher (basic_block);
  46. extern bool is_ctrl_stmt (gimple *);
  47. extern bool is_ctrl_altering_stmt (gimple *);
  48. extern bool simple_goto_p (gimple *);
  49. extern bool stmt_ends_bb_p (gimple *);
  50. extern bool gimple_seq_unreachable_p (gimple_seq);
  51. extern bool assert_unreachable_fallthru_edge_p (edge);
  52. extern void delete_tree_cfg_annotations (function *);
  53. extern gphi *get_virtual_phi (basic_block);
  54. extern gimple *first_stmt (basic_block);
  55. extern gimple *last_stmt (basic_block);
  56. extern gimple *last_and_only_stmt (basic_block);
  57. extern void verify_gimple_in_seq (gimple_seq);
  58. extern void verify_gimple_in_cfg (struct function *, bool);
  59. extern tree gimple_block_label (basic_block);
  60. extern void add_phi_args_after_copy_bb (basic_block);
  61. extern void add_phi_args_after_copy (basic_block *, unsigned, edge);
  62. extern basic_block split_edge_bb_loc (edge);
  63. extern bool gimple_duplicate_sese_region (edge, edge, basic_block *, unsigned,
  64. basic_block *, bool);
  65. extern bool gimple_duplicate_sese_tail (edge, edge, basic_block *, unsigned,
  66. basic_block *);
  67. extern void gather_blocks_in_sese_region (basic_block entry, basic_block exit,
  68. vec<basic_block> *bbs_p);
  69. extern void verify_sese (basic_block, basic_block, vec<basic_block> *);
  70. extern bool gather_ssa_name_hash_map_from (tree const &, tree const &, void *);
  71. extern void fold_loop_internal_call (gimple *, tree);
  72. extern basic_block move_sese_region_to_fn (struct function *, basic_block,
  73. basic_block, tree);
  74. extern void dump_function_to_file (tree, FILE *, dump_flags_t);
  75. extern void debug_function (tree, dump_flags_t);
  76. extern void print_loops_bb (FILE *, basic_block, int, int);
  77. extern void print_loops (FILE *, int);
  78. extern void debug (struct loop &ref);
  79. extern void debug (struct loop *ptr);
  80. extern void debug_verbose (struct loop &ref);
  81. extern void debug_verbose (struct loop *ptr);
  82. extern void debug_loops (int);
  83. extern void debug_loop (struct loop *, int);
  84. extern void debug_loop_num (unsigned, int);
  85. extern void remove_edge_and_dominated_blocks (edge);
  86. extern bool gimple_purge_dead_eh_edges (basic_block);
  87. extern bool gimple_purge_all_dead_eh_edges (const_bitmap);
  88. extern bool gimple_purge_dead_abnormal_call_edges (basic_block);
  89. extern bool gimple_purge_all_dead_abnormal_call_edges (const_bitmap);
  90. extern tree gimplify_build3 (gimple_stmt_iterator *, enum tree_code,
  91. tree, tree, tree, tree);
  92. extern tree gimplify_build2 (gimple_stmt_iterator *, enum tree_code,
  93. tree, tree, tree);
  94. extern tree gimplify_build1 (gimple_stmt_iterator *, enum tree_code,
  95. tree, tree);
  96. extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
  97. extern tree find_case_label_for_value (const gswitch *switch_stmt, tree val);
  98. extern edge find_taken_edge_switch_expr (const gswitch *switch_stmt, tree val);
  99. extern unsigned int execute_fixup_cfg (void);
  100. extern unsigned int split_critical_edges (void);
  101. extern basic_block insert_cond_bb (basic_block, gimple *, gimple *,
  102. profile_probability);
  103. extern bool gimple_find_sub_bbs (gimple_seq, gimple_stmt_iterator *);
  104. extern bool extract_true_false_controlled_edges (basic_block, basic_block,
  105. edge *, edge *);
  106. extern void generate_range_test (basic_block bb, tree index, tree low,
  107. tree high, tree *lhs, tree *rhs);
  108. extern basic_block gimple_switch_label_bb (function *, gswitch *, unsigned);
  109. extern basic_block gimple_switch_default_bb (function *, gswitch *);
  110. extern edge gimple_switch_edge (function *, gswitch *, unsigned);
  111. extern edge gimple_switch_default_edge (function *, gswitch *);
  112. /* Return true if the LHS of a call should be removed. */
  113. inline bool
  114. should_remove_lhs_p (tree lhs)
  115. {
  116. return (lhs
  117. && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST
  118. && !TREE_ADDRESSABLE (TREE_TYPE (lhs)));
  119. }
  120. #endif /* _TREE_CFG_H */