8c26fd1a2fe62d90bd56f89a25e2bdbc9034eca2
[gcc.git] / gcc / tree-ssa.h
1 /* Header file for any pass which requires SSA routines.
2 Copyright (C) 2013 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
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/>. */
19
20 #ifndef GCC_TREE_SSA_H
21 #define GCC_TREE_SSA_H
22
23 #include "bitmap.h"
24 #include "sbitmap.h"
25 #include "gimple.h"
26 #include "gimple-ssa.h"
27 #include "cgraph.h"
28 #include "tree-cfgcleanup.h"
29 #include "tree-cfg.h"
30 #include "tree-phinodes.h"
31 #include "ssa-iterators.h"
32 #include "tree-ssanames.h"
33 #include "tree-ssa-dom.h"
34 #include "tree-ssa-threadedge.h"
35 #include "tree-ssa-address.h"
36 #include "tree-ssa-loop.h"
37 #include "tree-into-ssa.h"
38 #include "gimple-low.h"
39 #include "tree-dfa.h"
40
41 /* Mapping for redirected edges. */
42 struct _edge_var_map {
43 tree result; /* PHI result. */
44 tree def; /* PHI arg definition. */
45 source_location locus; /* PHI arg location. */
46 };
47 typedef struct _edge_var_map edge_var_map;
48
49 /* A vector of var maps. */
50 typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
51
52
53 extern void redirect_edge_var_map_add (edge, tree, tree, source_location);
54 extern void redirect_edge_var_map_clear (edge);
55 extern void redirect_edge_var_map_dup (edge, edge);
56 extern edge_var_map_vector *redirect_edge_var_map_vector (edge);
57 extern void redirect_edge_var_map_destroy (void);
58 extern edge ssa_redirect_edge (edge, basic_block);
59 extern void flush_pending_stmts (edge);
60 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
61 unsigned *);
62 extern void gimple_replace_ssa_lhs (gimple, tree);
63 extern tree target_for_debug_bind (tree);
64 extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
65 extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
66 extern void reset_debug_uses (gimple);
67 extern void release_defs_bitset (bitmap toremove);
68 extern void verify_ssa (bool);
69 extern void init_tree_ssa (struct function *);
70 extern void delete_tree_ssa (void);
71 extern bool tree_ssa_useless_type_conversion (tree);
72 extern tree tree_ssa_strip_useless_type_conversions (tree);
73
74 extern bool ssa_undefined_value_p (tree);
75 extern void execute_update_addresses_taken (void);
76
77 /* Given an edge_var_map V, return the PHI arg definition. */
78
79 static inline tree
80 redirect_edge_var_map_def (edge_var_map *v)
81 {
82 return v->def;
83 }
84
85 /* Given an edge_var_map V, return the PHI result. */
86
87 static inline tree
88 redirect_edge_var_map_result (edge_var_map *v)
89 {
90 return v->result;
91 }
92
93 /* Given an edge_var_map V, return the PHI arg location. */
94
95 static inline source_location
96 redirect_edge_var_map_location (edge_var_map *v)
97 {
98 return v->locus;
99 }
100
101
102 #endif /* GCC_TREE_SSA_H */