1 /* Calculate (post)dominators header file.
2 Copyright (C) 2014-2015 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_DOMINANCE_H
21 #define GCC_DOMINANCE_H
26 CDI_POST_DOMINATORS
= 2
29 /* State of dominance information. */
33 DOM_NONE
, /* Not computed at all. */
34 DOM_NO_FAST_QUERY
, /* The data is OK, but the fast query data are not usable. */
35 DOM_OK
/* Everything is ok. */
38 extern void calculate_dominance_info (enum cdi_direction
);
39 extern void free_dominance_info (function
*, enum cdi_direction
);
40 extern void free_dominance_info (enum cdi_direction
);
41 extern basic_block
get_immediate_dominator (enum cdi_direction
, basic_block
);
42 extern void set_immediate_dominator (enum cdi_direction
, basic_block
,
44 extern vec
<basic_block
> get_dominated_by (enum cdi_direction
, basic_block
);
45 extern vec
<basic_block
> get_dominated_by_region (enum cdi_direction
,
48 extern vec
<basic_block
> get_dominated_to_depth (enum cdi_direction
,
50 extern vec
<basic_block
> get_all_dominated_blocks (enum cdi_direction
,
52 extern void redirect_immediate_dominators (enum cdi_direction
, basic_block
,
54 extern basic_block
nearest_common_dominator (enum cdi_direction
,
55 basic_block
, basic_block
);
56 extern basic_block
nearest_common_dominator_for_set (enum cdi_direction
,
58 extern bool dominated_by_p (enum cdi_direction
, const_basic_block
,
60 unsigned bb_dom_dfs_in (enum cdi_direction
, basic_block
);
61 unsigned bb_dom_dfs_out (enum cdi_direction
, basic_block
);
62 extern void verify_dominators (enum cdi_direction
);
63 basic_block
recompute_dominator (enum cdi_direction
, basic_block
);
64 extern void iterate_fix_dominators (enum cdi_direction
,
65 vec
<basic_block
> , bool);
66 extern void add_to_dominance_info (enum cdi_direction
, basic_block
);
67 extern void delete_from_dominance_info (enum cdi_direction
, basic_block
);
68 extern basic_block
first_dom_son (enum cdi_direction
, basic_block
);
69 extern basic_block
next_dom_son (enum cdi_direction
, basic_block
);
70 extern enum dom_state
dom_info_state (function
*, enum cdi_direction
);
71 extern enum dom_state
dom_info_state (enum cdi_direction
);
72 extern void set_dom_info_availability (enum cdi_direction
, enum dom_state
);
73 extern bool dom_info_available_p (function
*, enum cdi_direction
);
74 extern bool dom_info_available_p (enum cdi_direction
);
78 #endif /* GCC_DOMINANCE_H */