1 /* Data and Control Flow Analysis for Trees.
2 Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
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
9 the Free Software Foundation; either version 3, or (at your option)
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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
22 #define _TREE_FLOW_H 1
26 #include "basic-block.h"
29 #include "tree-ssa-operands.h"
31 #include "ipa-reference.h"
32 #include "tree-ssa-alias.h"
33 #include "tree-cfgcleanup.h"
35 #include "tree-pretty-print.h"
36 #include "gimple-low.h"
37 #include "tree-into-ssa.h"
38 #include "tree-ssa-loop.h"
40 /*---------------------------------------------------------------------------
42 ---------------------------------------------------------------------------*/
44 /* Parallel region information. Every parallel and workshare
45 directive is enclosed between two markers, the OMP_* directive
46 and a corresponding OMP_RETURN statement. */
50 /* The enclosing region. */
51 struct omp_region
*outer
;
53 /* First child region. */
54 struct omp_region
*inner
;
56 /* Next peer region. */
57 struct omp_region
*next
;
59 /* Block containing the omp directive as its last stmt. */
62 /* Block containing the OMP_RETURN as its last stmt. */
65 /* Block containing the OMP_CONTINUE as its last stmt. */
68 /* If this is a combined parallel+workshare region, this is a list
69 of additional arguments needed by the combined parallel+workshare
71 vec
<tree
, va_gc
> *ws_args
;
73 /* The code for the omp directive of this region. */
74 enum gimple_code type
;
76 /* Schedule kind, only used for OMP_FOR type regions. */
77 enum omp_clause_schedule_kind sched_kind
;
79 /* True if this is a combined parallel+workshare region. */
80 bool is_combined_parallel
;
83 extern struct omp_region
*root_omp_region
;
84 extern struct omp_region
*new_omp_region (basic_block
, enum gimple_code
,
86 extern void free_omp_regions (void);
87 void omp_expand_local (basic_block
);
88 tree
copy_var_decl (tree
, tree
, tree
);
90 /* Location to track pending stmt for edge insertion. */
91 #define PENDING_STMT(e) ((e)->insns.g)
93 extern void init_empty_tree_cfg_for_function (struct function
*);
94 extern void init_empty_tree_cfg (void);
95 extern void fold_cond_expr_cond (void);
96 extern void start_recording_case_labels (void);
97 extern void end_recording_case_labels (void);
98 extern basic_block
label_to_block_fn (struct function
*, tree
);
99 #define label_to_block(t) (label_to_block_fn (cfun, t))
100 extern void make_abnormal_goto_edges (basic_block
, bool);
101 extern void cleanup_dead_labels (void);
102 extern void group_case_labels_stmt (gimple
);
103 extern void group_case_labels (void);
104 extern void replace_uses_by (tree
, tree
);
105 extern basic_block
single_noncomplex_succ (basic_block bb
);
106 extern void notice_special_calls (gimple
);
107 extern void clear_special_calls (void);
108 extern edge
find_taken_edge (basic_block
, tree
);
109 extern void gimple_debug_bb (basic_block
);
110 extern basic_block
gimple_debug_bb_n (int);
111 extern void gimple_debug_cfg (int);
112 extern void gimple_dump_cfg (FILE *, int);
113 extern void dump_cfg_stats (FILE *);
114 extern void debug_cfg_stats (void);
115 extern bool stmt_can_make_abnormal_goto (gimple
);
116 extern bool is_ctrl_stmt (gimple
);
117 extern bool is_ctrl_altering_stmt (gimple
);
118 extern bool simple_goto_p (gimple
);
119 extern bool stmt_ends_bb_p (gimple
);
120 extern void delete_tree_cfg_annotations (void);
121 extern gimple
first_stmt (basic_block
);
122 extern gimple
last_stmt (basic_block
);
123 extern gimple
last_and_only_stmt (basic_block
);
124 extern void verify_gimple_in_seq (gimple_seq
);
125 extern void verify_gimple_in_cfg (struct function
*);
126 extern tree
gimple_block_label (basic_block
);
127 extern void add_phi_args_after_copy_bb (basic_block
);
128 extern void add_phi_args_after_copy (basic_block
*, unsigned, edge
);
129 extern bool gimple_duplicate_sese_region (edge
, edge
, basic_block
*, unsigned,
130 basic_block
*, bool);
131 extern bool gimple_duplicate_sese_tail (edge
, edge
, basic_block
*, unsigned,
133 extern void gather_blocks_in_sese_region (basic_block entry
, basic_block exit
,
134 vec
<basic_block
> *bbs_p
);
135 extern basic_block
move_sese_region_to_fn (struct function
*, basic_block
,
137 extern void dump_function_to_file (tree
, FILE *, int);
138 extern void debug_function (tree
, int) ;
139 extern void print_loops_bb (FILE *, basic_block
, int, int);
140 extern void print_loops (FILE *, int);
141 extern void debug (struct loop
&ref
);
142 extern void debug (struct loop
*ptr
);
143 extern void debug_verbose (struct loop
&ref
);
144 extern void debug_verbose (struct loop
*ptr
);
145 extern void debug_loops (int);
146 extern void debug_loop (struct loop
*, int);
147 extern void debug_loop_num (unsigned, int);
148 void remove_edge_and_dominated_blocks (edge
);
149 extern bool gimple_purge_dead_eh_edges (basic_block
);
150 extern bool gimple_purge_all_dead_eh_edges (const_bitmap
);
151 extern bool gimple_purge_dead_abnormal_call_edges (basic_block
);
152 extern bool gimple_purge_all_dead_abnormal_call_edges (const_bitmap
);
153 extern tree
gimplify_build3 (gimple_stmt_iterator
*, enum tree_code
,
154 tree
, tree
, tree
, tree
);
155 extern tree
gimplify_build2 (gimple_stmt_iterator
*, enum tree_code
,
157 extern tree
gimplify_build1 (gimple_stmt_iterator
*, enum tree_code
,
159 extern void extract_true_false_edges_from_block (basic_block
, edge
*, edge
*);
160 extern unsigned int execute_fixup_cfg (void);
162 #endif /* _TREE_FLOW_H */