]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/tree-ssa.h
c++, mingw: Fix up types of dtor hooks to __cxa_{,thread_}atexit/__cxa_throw on mingw...
[thirdparty/gcc.git] / gcc / tree-ssa.h
CommitLineData
7a300452 1/* Header file for any pass which requires SSA routines.
a945c346 2 Copyright (C) 2013-2024 Free Software Foundation, Inc.
7a300452
AM
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
7a300452 23/* Mapping for redirected edges. */
a79683d5 24struct edge_var_map {
7a300452
AM
25 tree result; /* PHI result. */
26 tree def; /* PHI arg definition. */
620e594b 27 location_t locus; /* PHI arg location. */
7a300452 28};
7a300452
AM
29
30/* A vector of var maps. */
31typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector;
32
33
620e594b 34extern void redirect_edge_var_map_add (edge, tree, tree, location_t);
7a300452
AM
35extern void redirect_edge_var_map_clear (edge);
36extern void redirect_edge_var_map_dup (edge, edge);
b787e7a2 37extern vec<edge_var_map> *redirect_edge_var_map_vector (edge);
b3e46655 38extern void redirect_edge_var_map_empty (void);
7a300452
AM
39extern edge ssa_redirect_edge (edge, basic_block);
40extern void flush_pending_stmts (edge);
355fe088 41extern void gimple_replace_ssa_lhs (gimple *, tree);
7a300452
AM
42extern tree target_for_debug_bind (tree);
43extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
44extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
355fe088 45extern void reset_debug_uses (gimple *);
7a300452 46extern void release_defs_bitset (bitmap toremove);
e9ff9caf 47extern void verify_ssa (bool, bool);
54af3008 48extern void init_tree_ssa (function *, int size = 0);
61183076 49extern void delete_tree_ssa (function *);
7a300452
AM
50extern bool tree_ssa_useless_type_conversion (tree);
51extern tree tree_ssa_strip_useless_type_conversions (tree);
0a1a3afb 52extern tree find_released_ssa_name (tree *, int *, void *);
7a300452 53
c6b0d21d
ML
54
55extern bool ssa_defined_default_def_p (tree t);
956623c1 56extern bool ssa_undefined_value_p (tree, bool = true);
44c8402d
RB
57
58
59bool ssa_name_any_use_dominates_bb_p (tree var, basic_block bb);
60extern void mark_ssa_maybe_undefs (void);
61
62/* Return TRUE iff VAR is marked as maybe-undefined. See
63 mark_ssa_maybe_undefs. */
64
cb3e0eac 65inline bool
44c8402d
RB
66ssa_name_maybe_undef_p (tree var)
67{
68 gcc_checking_assert (TREE_CODE (var) == SSA_NAME);
69 return TREE_VISITED (var);
70}
71
72/* Set (or clear, depending on VALUE) VAR's maybe-undefined mark. */
73
cb3e0eac 74inline void
44c8402d
RB
75ssa_name_set_maybe_undef (tree var, bool value = true)
76{
77 gcc_checking_assert (TREE_CODE (var) == SSA_NAME);
78 TREE_VISITED (var) = value;
79}
80
81
7a300452
AM
82extern void execute_update_addresses_taken (void);
83
84/* Given an edge_var_map V, return the PHI arg definition. */
85
cb3e0eac 86inline tree
7a300452
AM
87redirect_edge_var_map_def (edge_var_map *v)
88{
89 return v->def;
90}
91
92/* Given an edge_var_map V, return the PHI result. */
93
cb3e0eac 94inline tree
7a300452
AM
95redirect_edge_var_map_result (edge_var_map *v)
96{
97 return v->result;
98}
99
100/* Given an edge_var_map V, return the PHI arg location. */
101
cb3e0eac 102inline location_t
7a300452
AM
103redirect_edge_var_map_location (edge_var_map *v)
104{
105 return v->locus;
106}
107
b2b29377
MM
108/* Verify SSA invariants, if internal consistency checks are enabled. */
109
cb3e0eac 110inline void
b2b29377
MM
111checking_verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
112{
113 if (flag_checking)
114 verify_ssa (check_modified_stmt, check_ssa_operands);
115}
7a300452
AM
116
117#endif /* GCC_TREE_SSA_H */