* configure.ac: (target_alias): Default to $host_alias, not
[official-gcc.git] / gcc / tree-flow-inline.h
blobe3c955e8c2671d59b4fef0ce6f964845b4013a1d
1 /* Inline functions for tree-flow.h
2 Copyright (C) 2001, 2003 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com>
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 2, or (at your option)
10 any later version.
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 COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #ifndef _TREE_FLOW_INLINE_H
23 #define _TREE_FLOW_INLINE_H 1
25 /* Inline functions for manipulating various data structures defined in
26 tree-flow.h. See tree-flow.h for documentation. */
28 /* Return the variable annotation for T, which must be a _DECL node.
29 Return NULL if the variable annotation doesn't already exist. */
30 static inline var_ann_t
31 var_ann (tree t)
33 gcc_assert (t);
34 gcc_assert (DECL_P (t));
35 gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
37 return (var_ann_t) t->common.ann;
40 /* Return the variable annotation for T, which must be a _DECL node.
41 Create the variable annotation if it doesn't exist. */
42 static inline var_ann_t
43 get_var_ann (tree var)
45 var_ann_t ann = var_ann (var);
46 return (ann) ? ann : create_var_ann (var);
49 /* Return the statement annotation for T, which must be a statement
50 node. Return NULL if the statement annotation doesn't exist. */
51 static inline stmt_ann_t
52 stmt_ann (tree t)
54 #ifdef ENABLE_CHECKING
55 gcc_assert (is_gimple_stmt (t));
56 #endif
57 return (stmt_ann_t) t->common.ann;
60 /* Return the statement annotation for T, which must be a statement
61 node. Create the statement annotation if it doesn't exist. */
62 static inline stmt_ann_t
63 get_stmt_ann (tree stmt)
65 stmt_ann_t ann = stmt_ann (stmt);
66 return (ann) ? ann : create_stmt_ann (stmt);
70 /* Return the annotation type for annotation ANN. */
71 static inline enum tree_ann_type
72 ann_type (tree_ann_t ann)
74 return ann->common.type;
77 /* Return the basic block for statement T. */
78 static inline basic_block
79 bb_for_stmt (tree t)
81 stmt_ann_t ann;
83 if (TREE_CODE (t) == PHI_NODE)
84 return PHI_BB (t);
86 ann = stmt_ann (t);
87 return ann ? ann->bb : NULL;
90 /* Return the may_aliases varray for variable VAR, or NULL if it has
91 no may aliases. */
92 static inline varray_type
93 may_aliases (tree var)
95 var_ann_t ann = var_ann (var);
96 return ann ? ann->may_aliases : NULL;
99 /* Return the line number for EXPR, or return -1 if we have no line
100 number information for it. */
101 static inline int
102 get_lineno (tree expr)
104 if (expr == NULL_TREE)
105 return -1;
107 if (TREE_CODE (expr) == COMPOUND_EXPR)
108 expr = TREE_OPERAND (expr, 0);
110 if (! EXPR_HAS_LOCATION (expr))
111 return -1;
113 return EXPR_LINENO (expr);
116 /* Return the file name for EXPR, or return "???" if we have no
117 filename information. */
118 static inline const char *
119 get_filename (tree expr)
121 const char *filename;
122 if (expr == NULL_TREE)
123 return "???";
125 if (TREE_CODE (expr) == COMPOUND_EXPR)
126 expr = TREE_OPERAND (expr, 0);
128 if (EXPR_HAS_LOCATION (expr) && (filename = EXPR_FILENAME (expr)))
129 return filename;
130 else
131 return "???";
134 /* Mark statement T as modified. */
135 static inline void
136 modify_stmt (tree t)
138 stmt_ann_t ann = stmt_ann (t);
139 if (ann == NULL)
140 ann = create_stmt_ann (t);
141 ann->modified = 1;
144 /* Mark statement T as unmodified. */
145 static inline void
146 unmodify_stmt (tree t)
148 stmt_ann_t ann = stmt_ann (t);
149 if (ann == NULL)
150 ann = create_stmt_ann (t);
151 ann->modified = 0;
154 /* Return true if T is marked as modified, false otherwise. */
155 static inline bool
156 stmt_modified_p (tree t)
158 stmt_ann_t ann = stmt_ann (t);
160 /* Note that if the statement doesn't yet have an annotation, we consider it
161 modified. This will force the next call to get_stmt_operands to scan the
162 statement. */
163 return ann ? ann->modified : true;
166 /* Return the definitions present in ANN, a statement annotation.
167 Return NULL if this annotation contains no definitions. */
168 static inline def_optype
169 get_def_ops (stmt_ann_t ann)
171 return ann ? ann->operands.def_ops : NULL;
174 /* Return the uses present in ANN, a statement annotation.
175 Return NULL if this annotation contains no uses. */
176 static inline use_optype
177 get_use_ops (stmt_ann_t ann)
179 return ann ? ann->operands.use_ops : NULL;
182 /* Return the virtual may-defs present in ANN, a statement
183 annotation.
184 Return NULL if this annotation contains no virtual may-defs. */
185 static inline v_may_def_optype
186 get_v_may_def_ops (stmt_ann_t ann)
188 return ann ? ann->operands.v_may_def_ops : NULL;
191 /* Return the virtual uses present in ANN, a statement annotation.
192 Return NULL if this annotation contains no virtual uses. */
193 static inline vuse_optype
194 get_vuse_ops (stmt_ann_t ann)
196 return ann ? ann->operands.vuse_ops : NULL;
199 /* Return the virtual must-defs present in ANN, a statement
200 annotation. Return NULL if this annotation contains no must-defs.*/
201 static inline v_must_def_optype
202 get_v_must_def_ops (stmt_ann_t ann)
204 return ann ? ann->operands.v_must_def_ops : NULL;
207 /* Return the tree pointer to by USE. */
208 static inline tree
209 get_use_from_ptr (use_operand_p use)
211 return *(use.use);
214 /* Return the tree pointer to by DEF. */
215 static inline tree
216 get_def_from_ptr (def_operand_p def)
218 return *(def.def);
221 /* Return a pointer to the tree that is at INDEX in the USES array. */
222 static inline use_operand_p
223 get_use_op_ptr (use_optype uses, unsigned int index)
225 gcc_assert (index < uses->num_uses);
226 return uses->uses[index];
229 /* Return a def_operand_p pointer for element INDEX of DEFS. */
230 static inline def_operand_p
231 get_def_op_ptr (def_optype defs, unsigned int index)
233 gcc_assert (index < defs->num_defs);
234 return defs->defs[index];
238 /* Return the def_operand_p that is the V_MAY_DEF_RESULT for the V_MAY_DEF
239 at INDEX in the V_MAY_DEFS array. */
240 static inline def_operand_p
241 get_v_may_def_result_ptr(v_may_def_optype v_may_defs, unsigned int index)
243 def_operand_p op;
244 gcc_assert (index < v_may_defs->num_v_may_defs);
245 op.def = &(v_may_defs->v_may_defs[index].def);
246 return op;
249 /* Return a use_operand_p that is the V_MAY_DEF_OP for the V_MAY_DEF at
250 INDEX in the V_MAY_DEFS array. */
251 static inline use_operand_p
252 get_v_may_def_op_ptr(v_may_def_optype v_may_defs, unsigned int index)
254 use_operand_p op;
255 gcc_assert (index < v_may_defs->num_v_may_defs);
256 op.use = &(v_may_defs->v_may_defs[index].use);
257 return op;
260 /* Return a use_operand_p that is at INDEX in the VUSES array. */
261 static inline use_operand_p
262 get_vuse_op_ptr(vuse_optype vuses, unsigned int index)
264 use_operand_p op;
265 gcc_assert (index < vuses->num_vuses);
266 op.use = &(vuses->vuses[index]);
267 return op;
270 /* Return a def_operand_p that is the V_MUST_DEF_RESULT for the
271 V_MUST_DEF at INDEX in the V_MUST_DEFS array. */
272 static inline def_operand_p
273 get_v_must_def_result_ptr (v_must_def_optype v_must_defs, unsigned int index)
275 def_operand_p op;
276 gcc_assert (index < v_must_defs->num_v_must_defs);
277 op.def = &(v_must_defs->v_must_defs[index].def);
278 return op;
281 /* Return a use_operand_p that is the V_MUST_DEF_KILL for the
282 V_MUST_DEF at INDEX in the V_MUST_DEFS array. */
283 static inline use_operand_p
284 get_v_must_def_kill_ptr (v_must_def_optype v_must_defs, unsigned int index)
286 use_operand_p op;
287 gcc_assert (index < v_must_defs->num_v_must_defs);
288 op.use = &(v_must_defs->v_must_defs[index].use);
289 return op;
292 /* Return a def_operand_p pointer for the result of PHI. */
293 static inline def_operand_p
294 get_phi_result_ptr (tree phi)
296 def_operand_p op;
297 op.def = &(PHI_RESULT_TREE (phi));
298 return op;
301 /* Return a use_operand_p pointer for argument I of phinode PHI. */
302 static inline use_operand_p
303 get_phi_arg_def_ptr (tree phi, int i)
305 use_operand_p op;
306 op.use = &(PHI_ARG_DEF_TREE (phi, i));
307 return op;
310 /* Return the bitmap of addresses taken by STMT, or NULL if it takes
311 no addresses. */
312 static inline bitmap
313 addresses_taken (tree stmt)
315 stmt_ann_t ann = stmt_ann (stmt);
316 return ann ? ann->addresses_taken : NULL;
319 /* Return the immediate uses of STMT, or NULL if this information is
320 not computed. */
321 static dataflow_t
322 get_immediate_uses (tree stmt)
324 stmt_ann_t ann;
326 if (TREE_CODE (stmt) == PHI_NODE)
327 return PHI_DF (stmt);
329 ann = stmt_ann (stmt);
330 return ann ? ann->df : NULL;
333 /* Return the number of immediate uses present in the dataflow
334 information at DF. */
335 static inline int
336 num_immediate_uses (dataflow_t df)
338 varray_type imm;
340 if (!df)
341 return 0;
343 imm = df->immediate_uses;
344 if (!imm)
345 return df->uses[1] ? 2 : 1;
347 return VARRAY_ACTIVE_SIZE (imm) + 2;
350 /* Return the tree that is at NUM in the immediate use DF array. */
351 static inline tree
352 immediate_use (dataflow_t df, int num)
354 if (!df)
355 return NULL_TREE;
357 #ifdef ENABLE_CHECKING
358 gcc_assert (num < num_immediate_uses (df));
359 #endif
360 if (num < 2)
361 return df->uses[num];
362 return VARRAY_TREE (df->immediate_uses, num - 2);
365 /* Return the basic_block annotation for BB. */
366 static inline bb_ann_t
367 bb_ann (basic_block bb)
369 return (bb_ann_t)bb->tree_annotations;
372 /* Return the PHI nodes for basic block BB, or NULL if there are no
373 PHI nodes. */
374 static inline tree
375 phi_nodes (basic_block bb)
377 return bb_ann (bb)->phi_nodes;
380 /* Set list of phi nodes of a basic block BB to L. */
382 static inline void
383 set_phi_nodes (basic_block bb, tree l)
385 tree phi;
387 bb_ann (bb)->phi_nodes = l;
388 for (phi = l; phi; phi = PHI_CHAIN (phi))
389 set_bb_for_stmt (phi, bb);
392 /* Return the phi index number for an edge. */
393 static inline int
394 phi_arg_from_edge (tree phi, edge e)
396 int i;
397 gcc_assert (phi);
398 gcc_assert (TREE_CODE (phi) == PHI_NODE);
400 for (i = 0; i < PHI_NUM_ARGS (phi); i++)
401 if (PHI_ARG_EDGE (phi, i) == e)
402 return i;
404 return -1;
407 /* Mark VAR as used, so that it'll be preserved during rtl expansion. */
409 static inline void
410 set_is_used (tree var)
412 var_ann_t ann = get_var_ann (var);
413 ann->used = 1;
417 /* ----------------------------------------------------------------------- */
419 /* Return true if T is an executable statement. */
420 static inline bool
421 is_exec_stmt (tree t)
423 return (t && !IS_EMPTY_STMT (t) && t != error_mark_node);
427 /* Return true if this stmt can be the target of a control transfer stmt such
428 as a goto. */
429 static inline bool
430 is_label_stmt (tree t)
432 if (t)
433 switch (TREE_CODE (t))
435 case LABEL_DECL:
436 case LABEL_EXPR:
437 case CASE_LABEL_EXPR:
438 return true;
439 default:
440 return false;
442 return false;
445 /* Set the default definition for VAR to DEF. */
446 static inline void
447 set_default_def (tree var, tree def)
449 var_ann_t ann = get_var_ann (var);
450 ann->default_def = def;
453 /* Return the default definition for variable VAR, or NULL if none
454 exists. */
455 static inline tree
456 default_def (tree var)
458 var_ann_t ann = var_ann (var);
459 return ann ? ann->default_def : NULL_TREE;
462 /* PHI nodes should contain only ssa_names and invariants. A test
463 for ssa_name is definitely simpler; don't let invalid contents
464 slip in in the meantime. */
466 static inline bool
467 phi_ssa_name_p (tree t)
469 if (TREE_CODE (t) == SSA_NAME)
470 return true;
471 #ifdef ENABLE_CHECKING
472 gcc_assert (is_gimple_min_invariant (t));
473 #endif
474 return false;
477 /* ----------------------------------------------------------------------- */
479 /* Return a block_stmt_iterator that points to beginning of basic
480 block BB. */
481 static inline block_stmt_iterator
482 bsi_start (basic_block bb)
484 block_stmt_iterator bsi;
485 if (bb->stmt_list)
486 bsi.tsi = tsi_start (bb->stmt_list);
487 else
489 gcc_assert (bb->index < 0);
490 bsi.tsi.ptr = NULL;
491 bsi.tsi.container = NULL;
493 bsi.bb = bb;
494 return bsi;
497 /* Return a block statement iterator that points to the last label in
498 block BB. */
500 static inline block_stmt_iterator
501 bsi_after_labels (basic_block bb)
503 block_stmt_iterator bsi;
504 tree_stmt_iterator next;
506 bsi.bb = bb;
508 if (!bb->stmt_list)
510 gcc_assert (bb->index < 0);
511 bsi.tsi.ptr = NULL;
512 bsi.tsi.container = NULL;
513 return bsi;
516 bsi.tsi = tsi_start (bb->stmt_list);
517 if (tsi_end_p (bsi.tsi))
518 return bsi;
520 /* Ensure that there are some labels. The rationale is that we want
521 to insert after the bsi that is returned, and these insertions should
522 be placed at the start of the basic block. This would not work if the
523 first statement was not label; rather fail here than enable the user
524 proceed in wrong way. */
525 gcc_assert (TREE_CODE (tsi_stmt (bsi.tsi)) == LABEL_EXPR);
527 next = bsi.tsi;
528 tsi_next (&next);
530 while (!tsi_end_p (next)
531 && TREE_CODE (tsi_stmt (next)) == LABEL_EXPR)
533 bsi.tsi = next;
534 tsi_next (&next);
537 return bsi;
540 /* Return a block statement iterator that points to the end of basic
541 block BB. */
542 static inline block_stmt_iterator
543 bsi_last (basic_block bb)
545 block_stmt_iterator bsi;
546 if (bb->stmt_list)
547 bsi.tsi = tsi_last (bb->stmt_list);
548 else
550 gcc_assert (bb->index < 0);
551 bsi.tsi.ptr = NULL;
552 bsi.tsi.container = NULL;
554 bsi.bb = bb;
555 return bsi;
558 /* Return true if block statement iterator I has reached the end of
559 the basic block. */
560 static inline bool
561 bsi_end_p (block_stmt_iterator i)
563 return tsi_end_p (i.tsi);
566 /* Modify block statement iterator I so that it is at the next
567 statement in the basic block. */
568 static inline void
569 bsi_next (block_stmt_iterator *i)
571 tsi_next (&i->tsi);
574 /* Modify block statement iterator I so that it is at the previous
575 statement in the basic block. */
576 static inline void
577 bsi_prev (block_stmt_iterator *i)
579 tsi_prev (&i->tsi);
582 /* Return the statement that block statement iterator I is currently
583 at. */
584 static inline tree
585 bsi_stmt (block_stmt_iterator i)
587 return tsi_stmt (i.tsi);
590 /* Return a pointer to the statement that block statement iterator I
591 is currently at. */
592 static inline tree *
593 bsi_stmt_ptr (block_stmt_iterator i)
595 return tsi_stmt_ptr (i.tsi);
598 /* Returns the loop of the statement STMT. */
600 static inline struct loop *
601 loop_containing_stmt (tree stmt)
603 basic_block bb = bb_for_stmt (stmt);
604 if (!bb)
605 return NULL;
607 return bb->loop_father;
610 /* Return true if VAR is a clobbered by function calls. */
611 static inline bool
612 is_call_clobbered (tree var)
614 return is_global_var (var)
615 || bitmap_bit_p (call_clobbered_vars, var_ann (var)->uid);
618 /* Mark variable VAR as being clobbered by function calls. */
619 static inline void
620 mark_call_clobbered (tree var)
622 var_ann_t ann = var_ann (var);
623 /* If VAR is a memory tag, then we need to consider it a global
624 variable. This is because the pointer that VAR represents has
625 been found to point to either an arbitrary location or to a known
626 location in global memory. */
627 if (ann->mem_tag_kind != NOT_A_TAG)
628 DECL_EXTERNAL (var) = 1;
629 bitmap_set_bit (call_clobbered_vars, ann->uid);
632 /* Mark variable VAR as being non-addressable. */
633 static inline void
634 mark_non_addressable (tree var)
636 bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
637 TREE_ADDRESSABLE (var) = 0;
640 /* Return the common annotation for T. Return NULL if the annotation
641 doesn't already exist. */
642 static inline tree_ann_t
643 tree_ann (tree t)
645 return t->common.ann;
648 /* Return a common annotation for T. Create the constant annotation if it
649 doesn't exist. */
650 static inline tree_ann_t
651 get_tree_ann (tree t)
653 tree_ann_t ann = tree_ann (t);
654 return (ann) ? ann : create_tree_ann (t);
657 /* ----------------------------------------------------------------------- */
659 /* The following set of routines are used to iterator over various type of
660 SSA operands. */
662 /* Return true if PTR is finished iterating. */
663 static inline bool
664 op_iter_done (ssa_op_iter *ptr)
666 return ptr->done;
669 /* Get the next iterator use value for PTR. */
670 static inline use_operand_p
671 op_iter_next_use (ssa_op_iter *ptr)
673 if (ptr->use_i < ptr->num_use)
675 return USE_OP_PTR (ptr->ops->use_ops, (ptr->use_i)++);
677 if (ptr->vuse_i < ptr->num_vuse)
679 return VUSE_OP_PTR (ptr->ops->vuse_ops, (ptr->vuse_i)++);
681 if (ptr->v_mayu_i < ptr->num_v_mayu)
683 return V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops,
684 (ptr->v_mayu_i)++);
686 if (ptr->v_mustu_i < ptr->num_v_mustu)
688 return V_MUST_DEF_KILL_PTR (ptr->ops->v_must_def_ops,
689 (ptr->v_mustu_i)++);
691 ptr->done = true;
692 return NULL_USE_OPERAND_P;
695 /* Get the next iterator def value for PTR. */
696 static inline def_operand_p
697 op_iter_next_def (ssa_op_iter *ptr)
699 if (ptr->def_i < ptr->num_def)
701 return DEF_OP_PTR (ptr->ops->def_ops, (ptr->def_i)++);
703 if (ptr->v_mustd_i < ptr->num_v_mustd)
705 return V_MUST_DEF_RESULT_PTR (ptr->ops->v_must_def_ops,
706 (ptr->v_mustd_i)++);
708 if (ptr->v_mayd_i < ptr->num_v_mayd)
710 return V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops,
711 (ptr->v_mayd_i)++);
713 ptr->done = true;
714 return NULL_DEF_OPERAND_P;
717 /* Get the next iterator tree value for PTR. */
718 static inline tree
719 op_iter_next_tree (ssa_op_iter *ptr)
721 if (ptr->use_i < ptr->num_use)
723 return USE_OP (ptr->ops->use_ops, (ptr->use_i)++);
725 if (ptr->vuse_i < ptr->num_vuse)
727 return VUSE_OP (ptr->ops->vuse_ops, (ptr->vuse_i)++);
729 if (ptr->v_mayu_i < ptr->num_v_mayu)
731 return V_MAY_DEF_OP (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
733 if (ptr->v_mustu_i < ptr->num_v_mustu)
735 return V_MUST_DEF_KILL (ptr->ops->v_must_def_ops, (ptr->v_mustu_i)++);
737 if (ptr->def_i < ptr->num_def)
739 return DEF_OP (ptr->ops->def_ops, (ptr->def_i)++);
741 if (ptr->v_mustd_i < ptr->num_v_mustd)
743 return V_MUST_DEF_RESULT (ptr->ops->v_must_def_ops,
744 (ptr->v_mustd_i)++);
746 if (ptr->v_mayd_i < ptr->num_v_mayd)
748 return V_MAY_DEF_RESULT (ptr->ops->v_may_def_ops,
749 (ptr->v_mayd_i)++);
751 ptr->done = true;
752 return NULL;
755 /* Initialize the iterator PTR to the virtual defs in STMT. */
756 static inline void
757 op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
759 stmt_operands_p ops;
760 stmt_ann_t ann = get_stmt_ann (stmt);
762 ops = &(ann->operands);
763 ptr->done = false;
764 ptr->ops = ops;
765 ptr->num_def = (flags & SSA_OP_DEF) ? NUM_DEFS (ops->def_ops) : 0;
766 ptr->num_use = (flags & SSA_OP_USE) ? NUM_USES (ops->use_ops) : 0;
767 ptr->num_vuse = (flags & SSA_OP_VUSE) ? NUM_VUSES (ops->vuse_ops) : 0;
768 ptr->num_v_mayu = (flags & SSA_OP_VMAYUSE)
769 ? NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
770 ptr->num_v_mayd = (flags & SSA_OP_VMAYDEF)
771 ? NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
772 ptr->num_v_mustu = (flags & SSA_OP_VMUSTDEFKILL)
773 ? NUM_V_MUST_DEFS (ops->v_must_def_ops) : 0;
774 ptr->num_v_mustd = (flags & SSA_OP_VMUSTDEF)
775 ? NUM_V_MUST_DEFS (ops->v_must_def_ops) : 0;
776 ptr->def_i = 0;
777 ptr->use_i = 0;
778 ptr->vuse_i = 0;
779 ptr->v_mayu_i = 0;
780 ptr->v_mayd_i = 0;
781 ptr->v_mustu_i = 0;
782 ptr->v_mustd_i = 0;
785 /* Initialize iterator PTR to the use operands in STMT based on FLAGS. Return
786 the first use. */
787 static inline use_operand_p
788 op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
790 op_iter_init (ptr, stmt, flags);
791 return op_iter_next_use (ptr);
794 /* Initialize iterator PTR to the def operands in STMT based on FLAGS. Return
795 the first def. */
796 static inline def_operand_p
797 op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
799 op_iter_init (ptr, stmt, flags);
800 return op_iter_next_def (ptr);
803 /* Initialize iterator PTR to the operands in STMT based on FLAGS. Return
804 the first operand as a tree. */
805 static inline tree
806 op_iter_init_tree (ssa_op_iter *ptr, tree stmt, int flags)
808 op_iter_init (ptr, stmt, flags);
809 return op_iter_next_tree (ptr);
812 /* Get the next iterator mustdef value for PTR, returning the mustdef values in
813 KILL and DEF. */
814 static inline void
815 op_iter_next_mustdef (use_operand_p *kill, def_operand_p *def, ssa_op_iter *ptr)
817 if (ptr->v_mustu_i < ptr->num_v_mustu)
819 *def = V_MUST_DEF_RESULT_PTR (ptr->ops->v_must_def_ops, ptr->v_mustu_i);
820 *kill = V_MUST_DEF_KILL_PTR (ptr->ops->v_must_def_ops, (ptr->v_mustu_i)++);
821 return;
823 else
825 *def = NULL_DEF_OPERAND_P;
826 *kill = NULL_USE_OPERAND_P;
828 ptr->done = true;
829 return;
831 /* Get the next iterator maydef value for PTR, returning the maydef values in
832 USE and DEF. */
833 static inline void
834 op_iter_next_maydef (use_operand_p *use, def_operand_p *def, ssa_op_iter *ptr)
836 if (ptr->v_mayu_i < ptr->num_v_mayu)
838 *def = V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops, ptr->v_mayu_i);
839 *use = V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
840 return;
842 else
844 *def = NULL_DEF_OPERAND_P;
845 *use = NULL_USE_OPERAND_P;
847 ptr->done = true;
848 return;
851 /* Initialize iterator PTR to the operands in STMT. Return the first operands
852 in USE and DEF. */
853 static inline void
854 op_iter_init_maydef (ssa_op_iter *ptr, tree stmt, use_operand_p *use,
855 def_operand_p *def)
857 op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
858 op_iter_next_maydef (use, def, ptr);
861 /* Initialize iterator PTR to the operands in STMT. Return the first operands
862 in KILL and DEF. */
863 static inline void
864 op_iter_init_mustdef (ssa_op_iter *ptr, tree stmt, use_operand_p *kill,
865 def_operand_p *def)
867 op_iter_init (ptr, stmt, SSA_OP_VMUSTDEFKILL);
868 op_iter_next_mustdef (kill, def, ptr);
870 #endif /* _TREE_FLOW_INLINE_H */