20 #ifndef GCC_SSA_ITERATORS_H
21 #define GCC_SSA_ITERATORS_H
75 #define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
76 for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
77 !end_readonly_imm_use_p (&(ITER)); \
78 (void) ((DEST) = next_readonly_imm_use (&(ITER))))
82 #define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \
83 for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR)); \
84 !end_imm_use_stmt_p (&(ITER)); \
85 (void) ((STMT) = next_imm_use_stmt (&(ITER))))
90 #define BREAK_FROM_IMM_USE_STMT(ITER) \
92 end_imm_use_stmt_traverse (&(ITER)); \
110 #define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \
111 for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
112 !end_imm_use_on_stmt_p (&(ITER)); \
113 (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
147 #define SSA_OP_USE 0x01
148 #define SSA_OP_DEF 0x02
149 #define SSA_OP_VUSE 0x04
150 #define SSA_OP_VDEF 0x08
153 #define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE)
154 #define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF)
155 #define SSA_OP_ALL_VIRTUALS (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS)
156 #define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE)
157 #define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
158 #define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
163 #define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS) \
164 for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS); \
165 !op_iter_done (&(ITER)); \
166 (void) (TREEVAR = op_iter_next_tree (&(ITER))))
171 #define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS) \
172 for (USEVAR = op_iter_init_use (&(ITER), STMT, FLAGS); \
173 !op_iter_done (&(ITER)); \
174 USEVAR = op_iter_next_use (&(ITER)))
179 #define FOR_EACH_SSA_DEF_OPERAND(DEFVAR, STMT, ITER, FLAGS) \
180 for (DEFVAR = op_iter_init_def (&(ITER), STMT, FLAGS); \
181 !op_iter_done (&(ITER)); \
182 DEFVAR = op_iter_next_def (&(ITER)))
187 #define FOR_EACH_PHI_ARG(USEVAR, STMT, ITER, FLAGS) \
188 for ((USEVAR) = op_iter_init_phiuse (&(ITER), STMT, FLAGS); \
189 !op_iter_done (&(ITER)); \
190 (USEVAR) = op_iter_next_use (&(ITER)))
195 #define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS) \
196 for ((USEVAR) = (gimple_code (STMT) == GIMPLE_PHI \
197 ? op_iter_init_phiuse (&(ITER), STMT, FLAGS) \
198 : op_iter_init_use (&(ITER), STMT, FLAGS)); \
199 !op_iter_done (&(ITER)); \
200 (USEVAR) = op_iter_next_use (&(ITER)))
204 #define FOR_EACH_PHI_OR_STMT_DEF(DEFVAR, STMT, ITER, FLAGS) \
205 for ((DEFVAR) = (gimple_code (STMT) == GIMPLE_PHI \
206 ? op_iter_init_phidef (&(ITER), STMT, FLAGS) \
207 : op_iter_init_def (&(ITER), STMT, FLAGS)); \
208 !op_iter_done (&(ITER)); \
209 (DEFVAR) = op_iter_next_def (&(ITER)))
214 #define SINGLE_SSA_TREE_OPERAND(STMT, FLAGS) \
215 single_ssa_tree_operand (STMT, FLAGS)
220 #define SINGLE_SSA_USE_OPERAND(STMT, FLAGS) \
221 single_ssa_use_operand (STMT, FLAGS)
226 #define SINGLE_SSA_DEF_OPERAND(STMT, FLAGS) \
227 single_ssa_def_operand (STMT, FLAGS)
230 #define ZERO_SSA_OPERANDS(STMT, FLAGS) zero_ssa_operands (STMT, FLAGS)
233 #define NUM_SSA_OPERANDS(STMT, FLAGS) num_ssa_operands (STMT, FLAGS)
256 linknode->
prev = list;
259 list->
next = linknode;
344 #ifdef ENABLE_CHECKING
358 #ifdef ENABLE_CHECKING
381 if (ptr == ptr->
next)
399 if (ptr == ptr->
next)
422 if (ptr == ptr->
next)
451 static inline unsigned int
456 unsigned int num = 0;
459 for (ptr = start->
next; ptr != start; ptr = ptr->
next)
462 for (ptr = start->
next; ptr != start; ptr = ptr->
next)
604 if (flags & (SSA_OP_DEF | SSA_OP_VDEF))
622 if (!(flags & SSA_OP_VUSE)
778 if ((flags & comp) == 0)
809 if ((flags & comp) == 0)
854 if (last_p->
next == use_p)