Merge trunk version 202825 into gupc branch.
[official-gcc.git] / gcc / tree-ssa.h
blob1808b1c447a5affbebd4d7bc6a7b9f00a4935312
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 "tree-flow.h"
24 #include "tree-ssanames.h"
26 /* Mapping for redirected edges. */
27 struct _edge_var_map {
28 tree result; /* PHI result. */
29 tree def; /* PHI arg definition. */
30 source_location locus; /* PHI arg location. */
32 typedef struct _edge_var_map edge_var_map;
34 /* A vector of var maps. */
35 typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
38 extern void redirect_edge_var_map_add (edge, tree, tree, source_location);
39 extern void redirect_edge_var_map_clear (edge);
40 extern void redirect_edge_var_map_dup (edge, edge);
41 extern edge_var_map_vector *redirect_edge_var_map_vector (edge);
42 extern void redirect_edge_var_map_destroy (void);
43 extern edge ssa_redirect_edge (edge, basic_block);
44 extern void flush_pending_stmts (edge);
45 extern tree target_for_debug_bind (tree);
46 extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
47 extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
48 extern void reset_debug_uses (gimple);
49 extern void release_defs_bitset (bitmap toremove);
50 extern void verify_ssa (bool);
51 extern void init_tree_ssa (struct function *);
52 extern void delete_tree_ssa (void);
53 extern bool tree_ssa_useless_type_conversion (tree);
54 extern tree tree_ssa_strip_useless_type_conversions (tree);
56 /* Call-back function for walk_use_def_chains(). At each reaching
57 definition, a function with this prototype is called. */
58 typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
59 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
61 extern bool ssa_undefined_value_p (tree);
62 extern void execute_update_addresses_taken (void);
64 /* Given an edge_var_map V, return the PHI arg definition. */
66 static inline tree
67 redirect_edge_var_map_def (edge_var_map *v)
69 return v->def;
72 /* Given an edge_var_map V, return the PHI result. */
74 static inline tree
75 redirect_edge_var_map_result (edge_var_map *v)
77 return v->result;
80 /* Given an edge_var_map V, return the PHI arg location. */
82 static inline source_location
83 redirect_edge_var_map_location (edge_var_map *v)
85 return v->locus;
89 #endif /* GCC_TREE_SSA_H */