Import from savannah.gnu.org:
[official-gcc.git] / gcc / tree-ssa.h
blob5ec7007ee926b0ec898e2c5aedbedaba94f7ceaf
1 /* Header file for any pass which requires SSA routines.
2 Copyright (C) 2013 Free Software Foundation, Inc.
4 This file is part of GCC.
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.
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.
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_TREE_SSA_H
21 #define GCC_TREE_SSA_H
23 #include "gimple.h"
24 #include "tree-ssa-operands.h"
25 #include "tree-phinodes.h"
26 #include "gimple-ssa.h"
27 #include "ssa-iterators.h"
28 #include "tree-ssanames.h"
29 #include "tree-flow.h"
31 /* Mapping for redirected edges. */
32 struct _edge_var_map {
33 tree result; /* PHI result. */
34 tree def; /* PHI arg definition. */
35 source_location locus; /* PHI arg location. */
37 typedef struct _edge_var_map edge_var_map;
39 /* A vector of var maps. */
40 typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
43 extern void redirect_edge_var_map_add (edge, tree, tree, source_location);
44 extern void redirect_edge_var_map_clear (edge);
45 extern void redirect_edge_var_map_dup (edge, edge);
46 extern edge_var_map_vector *redirect_edge_var_map_vector (edge);
47 extern void redirect_edge_var_map_destroy (void);
48 extern edge ssa_redirect_edge (edge, basic_block);
49 extern void flush_pending_stmts (edge);
50 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
51 unsigned *);
52 extern void gimple_replace_ssa_lhs (gimple, tree);
53 extern tree target_for_debug_bind (tree);
54 extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
55 extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
56 extern void reset_debug_uses (gimple);
57 extern void release_defs_bitset (bitmap toremove);
58 extern void verify_ssa (bool);
59 extern void init_tree_ssa (struct function *);
60 extern void delete_tree_ssa (void);
61 extern bool tree_ssa_useless_type_conversion (tree);
62 extern tree tree_ssa_strip_useless_type_conversions (tree);
64 extern bool ssa_undefined_value_p (tree);
65 extern void execute_update_addresses_taken (void);
67 /* Given an edge_var_map V, return the PHI arg definition. */
69 static inline tree
70 redirect_edge_var_map_def (edge_var_map *v)
72 return v->def;
75 /* Given an edge_var_map V, return the PHI result. */
77 static inline tree
78 redirect_edge_var_map_result (edge_var_map *v)
80 return v->result;
83 /* Given an edge_var_map V, return the PHI arg location. */
85 static inline source_location
86 redirect_edge_var_map_location (edge_var_map *v)
88 return v->locus;
92 #endif /* GCC_TREE_SSA_H */