1 /* Header file for routines that straddle the border between GIMPLE and
3 Copyright (C) 2009-2013 Free Software Foundation, Inc.
5 This file is part of GCC.
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)
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.
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/>. */
21 #ifndef GCC_GIMPLE_SSA_H
22 #define GCC_GIMPLE_SSA_H
24 /* Return the set of VUSE operand for statement G. */
26 static inline use_operand_p
27 gimple_vuse_op (const_gimple g
)
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
;
34 && USE_OP_PTR (ops
)->use
== &g
->gsmembase
.vuse
)
35 return USE_OP_PTR (ops
);
36 return NULL_USE_OPERAND_P
;
39 /* Return the set of VDEF operand for statement G. */
41 static inline def_operand_p
42 gimple_vdef_op (gimple g
)
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
;
51 /* Mark statement S as modified, and update it. */
54 update_stmt (gimple s
)
56 if (gimple_has_ops (s
))
58 gimple_set_modified (s
, true);
59 update_stmt_operands (s
);
63 /* Update statement S if it has been optimized. */
66 update_stmt_if_modified (gimple s
)
68 if (gimple_modified_p (s
))
69 update_stmt_operands (s
);
73 #endif /* GCC_GIMPLE_SSA_H */