annotate gcc/cfg.h @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Control flow graph manipulation code header file.
kono
parents:
diff changeset
2 Copyright (C) 2014-2017 Free Software Foundation, Inc.
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 #ifndef GCC_CFG_H
kono
parents:
diff changeset
21 #define GCC_CFG_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 #include "dominance.h"
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* What sort of profiling information we have. */
kono
parents:
diff changeset
26 enum profile_status_d
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 PROFILE_ABSENT,
kono
parents:
diff changeset
29 PROFILE_GUESSED,
kono
parents:
diff changeset
30 PROFILE_READ,
kono
parents:
diff changeset
31 PROFILE_LAST /* Last value, used by profile streaming. */
kono
parents:
diff changeset
32 };
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* A structure to group all the per-function control flow graph data.
kono
parents:
diff changeset
35 The x_* prefixing is necessary because otherwise references to the
kono
parents:
diff changeset
36 fields of this struct are interpreted as the defines for backward
kono
parents:
diff changeset
37 source compatibility following the definition of this struct. */
kono
parents:
diff changeset
38 struct GTY(()) control_flow_graph {
kono
parents:
diff changeset
39 /* Block pointers for the exit and entry of a function.
kono
parents:
diff changeset
40 These are always the head and tail of the basic block list. */
kono
parents:
diff changeset
41 basic_block x_entry_block_ptr;
kono
parents:
diff changeset
42 basic_block x_exit_block_ptr;
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 /* Index by basic block number, get basic block struct info. */
kono
parents:
diff changeset
45 vec<basic_block, va_gc> *x_basic_block_info;
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* Number of basic blocks in this flow graph. */
kono
parents:
diff changeset
48 int x_n_basic_blocks;
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /* Number of edges in this flow graph. */
kono
parents:
diff changeset
51 int x_n_edges;
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 /* The first free basic block number. */
kono
parents:
diff changeset
54 int x_last_basic_block;
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* UIDs for LABEL_DECLs. */
kono
parents:
diff changeset
57 int last_label_uid;
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 /* Mapping of labels to their associated blocks. At present
kono
parents:
diff changeset
60 only used for the gimple CFG. */
kono
parents:
diff changeset
61 vec<basic_block, va_gc> *x_label_to_block_map;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 enum profile_status_d x_profile_status;
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 /* Whether the dominators and the postdominators are available. */
kono
parents:
diff changeset
66 enum dom_state x_dom_computed[2];
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 /* Number of basic blocks in the dominance tree. */
kono
parents:
diff changeset
69 unsigned x_n_bbs_in_dom_tree[2];
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 /* Maximal number of entities in the single jumptable. Used to estimate
kono
parents:
diff changeset
72 final flowgraph size. */
kono
parents:
diff changeset
73 int max_jumptable_ents;
kono
parents:
diff changeset
74 };
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 extern void init_flow (function *);
kono
parents:
diff changeset
78 extern void clear_edges (function *);
kono
parents:
diff changeset
79 extern basic_block alloc_block (void);
kono
parents:
diff changeset
80 extern void link_block (basic_block, basic_block);
kono
parents:
diff changeset
81 extern void unlink_block (basic_block);
kono
parents:
diff changeset
82 extern void compact_blocks (void);
kono
parents:
diff changeset
83 extern void expunge_block (basic_block);
kono
parents:
diff changeset
84 extern edge unchecked_make_edge (basic_block, basic_block, int);
kono
parents:
diff changeset
85 extern edge cached_make_edge (sbitmap, basic_block, basic_block, int);
kono
parents:
diff changeset
86 extern edge make_edge (basic_block, basic_block, int);
kono
parents:
diff changeset
87 extern edge make_single_succ_edge (basic_block, basic_block, int);
kono
parents:
diff changeset
88 extern void remove_edge_raw (edge);
kono
parents:
diff changeset
89 extern void redirect_edge_succ (edge, basic_block);
kono
parents:
diff changeset
90 extern void redirect_edge_pred (edge, basic_block);
kono
parents:
diff changeset
91 extern void clear_bb_flags (void);
kono
parents:
diff changeset
92 extern void dump_edge_info (FILE *, edge, dump_flags_t, int);
kono
parents:
diff changeset
93 extern void debug (edge_def &ref);
kono
parents:
diff changeset
94 extern void debug (edge_def *ptr);
kono
parents:
diff changeset
95 extern void alloc_aux_for_blocks (int);
kono
parents:
diff changeset
96 extern void clear_aux_for_blocks (void);
kono
parents:
diff changeset
97 extern void free_aux_for_blocks (void);
kono
parents:
diff changeset
98 extern void alloc_aux_for_edge (edge, int);
kono
parents:
diff changeset
99 extern void alloc_aux_for_edges (int);
kono
parents:
diff changeset
100 extern void clear_aux_for_edges (void);
kono
parents:
diff changeset
101 extern void free_aux_for_edges (void);
kono
parents:
diff changeset
102 extern void debug_bb (basic_block);
kono
parents:
diff changeset
103 extern basic_block debug_bb_n (int);
kono
parents:
diff changeset
104 extern void dump_bb_info (FILE *, basic_block, int, dump_flags_t, bool, bool);
kono
parents:
diff changeset
105 extern void brief_dump_cfg (FILE *, dump_flags_t);
kono
parents:
diff changeset
106 extern void update_bb_profile_for_threading (basic_block, int, profile_count, edge);
kono
parents:
diff changeset
107 extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
kono
parents:
diff changeset
108 extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type,
kono
parents:
diff changeset
109 gcov_type);
kono
parents:
diff changeset
110 extern void scale_bbs_frequencies_profile_count (basic_block *, int,
kono
parents:
diff changeset
111 profile_count, profile_count);
kono
parents:
diff changeset
112 extern void scale_bbs_frequencies (basic_block *, int, profile_probability);
kono
parents:
diff changeset
113 extern void initialize_original_copy_tables (void);
kono
parents:
diff changeset
114 extern void reset_original_copy_tables (void);
kono
parents:
diff changeset
115 extern void free_original_copy_tables (void);
kono
parents:
diff changeset
116 extern bool original_copy_tables_initialized_p (void);
kono
parents:
diff changeset
117 extern void set_bb_original (basic_block, basic_block);
kono
parents:
diff changeset
118 extern basic_block get_bb_original (basic_block);
kono
parents:
diff changeset
119 extern void set_bb_copy (basic_block, basic_block);
kono
parents:
diff changeset
120 extern basic_block get_bb_copy (basic_block);
kono
parents:
diff changeset
121 void set_loop_copy (struct loop *, struct loop *);
kono
parents:
diff changeset
122 struct loop *get_loop_copy (struct loop *);
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 #endif /* GCC_CFG_H */