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