tree-into-ssa.c (enum need_phi_state): Relocate from tree-flow.h.
[gcc.git] / gcc / gimple-ssa.h
1 /* Header file for routines that straddle the border between GIMPLE and
2 SSA in gimple.
3 Copyright (C) 2009-2013 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
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)
10 any later version.
11
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.
16
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/>. */
20
21 #ifndef GCC_GIMPLE_SSA_H
22 #define GCC_GIMPLE_SSA_H
23
24 /* Return the set of VUSE operand for statement G. */
25
26 static inline use_operand_p
27 gimple_vuse_op (const_gimple g)
28 {
29 struct use_optype_d *ops;
30 if (!gimple_has_mem_ops (g))
31 return NULL_USE_OPERAND_P;
32 ops = g->gsops.opbase.use_ops;
33 if (ops
34 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
35 return USE_OP_PTR (ops);
36 return NULL_USE_OPERAND_P;
37 }
38
39 /* Return the set of VDEF operand for statement G. */
40
41 static inline def_operand_p
42 gimple_vdef_op (gimple g)
43 {
44 if (!gimple_has_mem_ops (g))
45 return NULL_DEF_OPERAND_P;
46 if (g->gsmembase.vdef)
47 return &g->gsmembase.vdef;
48 return NULL_DEF_OPERAND_P;
49 }
50
51 /* Mark statement S as modified, and update it. */
52
53 static inline void
54 update_stmt (gimple s)
55 {
56 if (gimple_has_ops (s))
57 {
58 gimple_set_modified (s, true);
59 update_stmt_operands (s);
60 }
61 }
62
63 /* Update statement S if it has been optimized. */
64
65 static inline void
66 update_stmt_if_modified (gimple s)
67 {
68 if (gimple_modified_p (s))
69 update_stmt_operands (s);
70 }
71
72
73 #endif /* GCC_GIMPLE_SSA_H */