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