1 /* SSA operand management for trees.
2 Copyright (C) 2003 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 2, or (at your option) any later
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
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 #ifndef GCC_TREE_SSA_OPERANDS_H
22 #define GCC_TREE_SSA_OPERANDS_H
24 /* Interface to SSA operands. */
26 typedef struct def_optype_d GTY(())
29 tree * GTY((length("%h.num_defs"), skip(""))) defs[1];
32 typedef def_optype_t *def_optype;
34 typedef struct use_optype_d GTY(())
37 tree * GTY((length("%h.num_uses"), skip(""))) uses[1];
40 typedef use_optype_t *use_optype;
42 typedef struct v_may_def_optype_d GTY(())
44 unsigned num_v_may_defs;
45 tree GTY((length ("%h.num_v_may_defs * 2"))) v_may_defs[1];
48 typedef v_may_def_optype_t *v_may_def_optype;
50 typedef struct vuse_optype_d GTY(())
53 tree GTY((length ("%h.num_vuses"))) vuses[1];
56 typedef vuse_optype_t *vuse_optype;
58 typedef struct v_must_def_optype_d GTY(())
60 unsigned num_v_must_defs;
61 tree GTY((length("%h.num_v_must_defs"))) v_must_defs[1];
62 } v_must_def_optype_t;
64 typedef v_must_def_optype_t *v_must_def_optype;
66 #define USE_OPS(ANN) get_use_ops (ANN)
67 #define STMT_USE_OPS(STMT) get_use_ops (stmt_ann (STMT))
68 #define NUM_USES(OPS) ((OPS) ? (OPS)->num_uses : 0)
69 #define USE_OP_PTR(OPS, I) get_use_op_ptr ((OPS), (I))
70 #define USE_OP(OPS, I) (*(USE_OP_PTR ((OPS), (I))))
73 #define DEF_OPS(ANN) get_def_ops (ANN)
74 #define STMT_DEF_OPS(STMT) get_def_ops (stmt_ann (STMT))
75 #define NUM_DEFS(OPS) ((OPS) ? (OPS)->num_defs : 0)
76 #define DEF_OP_PTR(OPS, I) get_def_op_ptr ((OPS), (I))
77 #define DEF_OP(OPS, I) (*(DEF_OP_PTR ((OPS), (I))))
80 #define V_MAY_DEF_OPS(ANN) get_v_may_def_ops (ANN)
81 #define STMT_V_MAY_DEF_OPS(STMT) get_v_may_def_ops (stmt_ann(STMT))
82 #define NUM_V_MAY_DEFS(OPS) ((OPS) ? (OPS)->num_v_may_defs : 0)
83 #define V_MAY_DEF_RESULT_PTR(OPS, I) get_v_may_def_result_ptr ((OPS), (I))
84 #define V_MAY_DEF_RESULT(OPS, I) (*(V_MAY_DEF_RESULT_PTR ((OPS), (I))))
85 #define V_MAY_DEF_OP_PTR(OPS, I) get_v_may_def_op_ptr ((OPS), (I))
86 #define V_MAY_DEF_OP(OPS, I) (*(V_MAY_DEF_OP_PTR ((OPS), (I))))
89 #define VUSE_OPS(ANN) get_vuse_ops (ANN)
90 #define STMT_VUSE_OPS(STMT) get_vuse_ops (stmt_ann(STMT))
91 #define NUM_VUSES(OPS) ((OPS) ? (OPS)->num_vuses : 0)
92 #define VUSE_OP_PTR(OPS, I) get_vuse_op_ptr ((OPS), (I))
93 #define VUSE_OP(OPS, I) (*(VUSE_OP_PTR ((OPS), (I))))
96 #define V_MUST_DEF_OPS(ANN) get_v_must_def_ops (ANN)
97 #define STMT_V_MUST_DEF_OPS(STMT) get_v_must_def_ops (stmt_ann (STMT))
98 #define NUM_V_MUST_DEFS(OPS) ((OPS) ? (OPS)->num_v_must_defs : 0)
99 #define V_MUST_DEF_OP_PTR(OPS, I) get_v_must_def_op_ptr ((OPS), (I))
100 #define V_MUST_DEF_OP(OPS, I) (*(V_MUST_DEF_OP_PTR ((OPS), (I))))
102 extern void init_ssa_operands (void);
103 extern void fini_ssa_operands (void);
104 extern void verify_start_operands (tree);
105 extern void finalize_ssa_stmt_operands (tree);
106 void add_vuse (tree, tree);
107 extern void get_stmt_operands (tree);
108 extern void remove_vuses (tree);
109 extern void remove_v_may_defs (tree);
110 extern void remove_v_must_defs (tree);
112 #endif /* GCC_TREE_SSA_OPERANDS_H */