annotate gcc/cfganal.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Control flow graph analysis header file.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 #ifndef GCC_CFGANAL_H
kono
parents:
diff changeset
22 #define GCC_CFGANAL_H
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 /* This structure maintains an edge list vector. */
kono
parents:
diff changeset
25 /* FIXME: Make this a vec<edge>. */
kono
parents:
diff changeset
26 struct edge_list
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 int num_edges;
kono
parents:
diff changeset
29 edge *index_to_edge;
kono
parents:
diff changeset
30 };
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 /* Class to compute and manage control dependences on an edge-list. */
kono
parents:
diff changeset
34 class control_dependences
kono
parents:
diff changeset
35 {
kono
parents:
diff changeset
36 public:
kono
parents:
diff changeset
37 control_dependences ();
kono
parents:
diff changeset
38 ~control_dependences ();
kono
parents:
diff changeset
39 bitmap get_edges_dependent_on (int);
kono
parents:
diff changeset
40 basic_block get_edge_src (int);
kono
parents:
diff changeset
41 basic_block get_edge_dest (int);
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 private:
kono
parents:
diff changeset
44 void set_control_dependence_map_bit (basic_block, int);
kono
parents:
diff changeset
45 void clear_control_dependence_bitmap (basic_block);
kono
parents:
diff changeset
46 void find_control_dependence (int);
kono
parents:
diff changeset
47 vec<bitmap> control_dependence_map;
kono
parents:
diff changeset
48 vec<std::pair<int, int> > m_el;
kono
parents:
diff changeset
49 };
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 extern bool mark_dfs_back_edges (void);
kono
parents:
diff changeset
52 extern void find_unreachable_blocks (void);
kono
parents:
diff changeset
53 extern void verify_no_unreachable_blocks (void);
kono
parents:
diff changeset
54 struct edge_list * create_edge_list (void);
kono
parents:
diff changeset
55 void free_edge_list (struct edge_list *);
kono
parents:
diff changeset
56 void print_edge_list (FILE *, struct edge_list *);
kono
parents:
diff changeset
57 void verify_edge_list (FILE *, struct edge_list *);
kono
parents:
diff changeset
58 edge find_edge (basic_block, basic_block);
kono
parents:
diff changeset
59 int find_edge_index (struct edge_list *, basic_block, basic_block);
kono
parents:
diff changeset
60 extern void remove_fake_edges (void);
kono
parents:
diff changeset
61 extern void remove_fake_exit_edges (void);
kono
parents:
diff changeset
62 extern void add_noreturn_fake_exit_edges (void);
kono
parents:
diff changeset
63 extern void connect_infinite_loops_to_exit (void);
kono
parents:
diff changeset
64 extern int post_order_compute (int *, bool, bool);
kono
parents:
diff changeset
65 extern basic_block dfs_find_deadend (basic_block);
kono
parents:
diff changeset
66 extern void inverted_post_order_compute (vec<int> *postorder, sbitmap *start_points = 0);
kono
parents:
diff changeset
67 extern int pre_and_rev_post_order_compute_fn (struct function *,
kono
parents:
diff changeset
68 int *, int *, bool);
kono
parents:
diff changeset
69 extern int pre_and_rev_post_order_compute (int *, int *, bool);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
70 extern int rev_post_order_and_mark_dfs_back_seme (struct function *, edge,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
71 bitmap, bool, int *);
111
kono
parents:
diff changeset
72 extern int dfs_enumerate_from (basic_block, int,
kono
parents:
diff changeset
73 bool (*)(const_basic_block, const void *),
kono
parents:
diff changeset
74 basic_block *, int, const void *);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
75 extern void compute_dominance_frontiers (class bitmap_head *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 extern bitmap compute_idf (bitmap, class bitmap_head *);
111
kono
parents:
diff changeset
77 extern void bitmap_intersection_of_succs (sbitmap, sbitmap *, basic_block);
kono
parents:
diff changeset
78 extern void bitmap_intersection_of_preds (sbitmap, sbitmap *, basic_block);
kono
parents:
diff changeset
79 extern void bitmap_union_of_succs (sbitmap, sbitmap *, basic_block);
kono
parents:
diff changeset
80 extern void bitmap_union_of_preds (sbitmap, sbitmap *, basic_block);
kono
parents:
diff changeset
81 extern basic_block * single_pred_before_succ_order (void);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
82 extern edge single_incoming_edge_ignoring_loop_edges (basic_block, bool);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
83 extern edge single_pred_edge_ignoring_loop_edges (basic_block, bool);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
84
111
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 #endif /* GCC_CFGANAL_H */