OSDN Git Service

* defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default.
[pf3gnuchains/gcc-fork.git] / gcc / tree-flow-inline.h
1 /* Inline functions for tree-flow.h
2    Copyright (C) 2001, 2003 Free Software Foundation, Inc.
3    Contributed by Diego Novillo <dnovillo@redhat.com>
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 2, 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 COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #ifndef _TREE_FLOW_INLINE_H
23 #define _TREE_FLOW_INLINE_H 1
24
25 /* Inline functions for manipulating various data structures defined in
26    tree-flow.h.  See tree-flow.h for documentation.  */
27
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)
32 {
33   gcc_assert (t);
34   gcc_assert (DECL_P (t));
35   gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
36
37   return (var_ann_t) t->common.ann;
38 }
39
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)
44 {
45   var_ann_t ann = var_ann (var);
46   return (ann) ? ann : create_var_ann (var);
47 }
48
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)
53 {
54 #ifdef ENABLE_CHECKING
55   gcc_assert (is_gimple_stmt (t));
56 #endif
57   return (stmt_ann_t) t->common.ann;
58 }
59
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)
64 {
65   stmt_ann_t ann = stmt_ann (stmt);
66   return (ann) ? ann : create_stmt_ann (stmt);
67 }
68
69
70 /* Return the annotation type for annotation ANN.  */
71 static inline enum tree_ann_type
72 ann_type (tree_ann_t ann)
73 {
74   return ann->common.type;
75 }
76
77 /* Return the basic block for statement T.  */
78 static inline basic_block
79 bb_for_stmt (tree t)
80 {
81   stmt_ann_t ann = stmt_ann (t);
82   return ann ? ann->bb : NULL;
83 }
84
85 /* Return the may_aliases varray for variable VAR, or NULL if it has
86    no may aliases.  */
87 static inline varray_type
88 may_aliases (tree var)
89 {
90   var_ann_t ann = var_ann (var);
91   return ann ? ann->may_aliases : NULL;
92 }
93
94 /* Return the line number for EXPR, or return -1 if we have no line
95    number information for it.  */
96 static inline int
97 get_lineno (tree expr)
98 {
99   if (expr == NULL_TREE)
100     return -1;
101
102   if (TREE_CODE (expr) == COMPOUND_EXPR)
103     expr = TREE_OPERAND (expr, 0);
104
105   if (! EXPR_HAS_LOCATION (expr))
106     return -1;
107
108   return EXPR_LINENO (expr);
109 }
110
111 /* Return the file name for EXPR, or return "???" if we have no
112    filename information.  */
113 static inline const char *
114 get_filename (tree expr)
115 {
116   const char *filename;
117   if (expr == NULL_TREE)
118     return "???";
119
120   if (TREE_CODE (expr) == COMPOUND_EXPR)
121     expr = TREE_OPERAND (expr, 0);
122
123   if (EXPR_HAS_LOCATION (expr) && (filename = EXPR_FILENAME (expr)))
124     return filename;
125   else
126     return "???";
127 }
128
129 /* Mark statement T as modified.  */
130 static inline void
131 modify_stmt (tree t)
132 {
133   stmt_ann_t ann = stmt_ann (t);
134   if (ann == NULL)
135     ann = create_stmt_ann (t);
136   ann->modified = 1;
137 }
138
139 /* Mark statement T as unmodified.  */
140 static inline void
141 unmodify_stmt (tree t)
142 {
143   stmt_ann_t ann = stmt_ann (t);
144   if (ann == NULL)
145     ann = create_stmt_ann (t);
146   ann->modified = 0;
147 }
148
149 /* Return true if T is marked as modified, false otherwise.  */
150 static inline bool
151 stmt_modified_p (tree t)
152 {
153   stmt_ann_t ann = stmt_ann (t);
154
155   /* Note that if the statement doesn't yet have an annotation, we consider it
156      modified.  This will force the next call to get_stmt_operands to scan the
157      statement.  */
158   return ann ? ann->modified : true;
159 }
160
161 /* Return the definitions present in ANN, a statement annotation.
162    Return NULL if this annotation contains no definitions.  */
163 static inline def_optype
164 get_def_ops (stmt_ann_t ann)
165 {
166   return ann ? ann->operands.def_ops : NULL;
167 }
168
169 /* Return the uses present in ANN, a statement annotation.
170    Return NULL if this annotation contains no uses.  */
171 static inline use_optype
172 get_use_ops (stmt_ann_t ann)
173 {
174   return ann ? ann->operands.use_ops : NULL;
175 }
176
177 /* Return the virtual may-defs present in ANN, a statement
178    annotation.
179    Return NULL if this annotation contains no virtual may-defs.  */
180 static inline v_may_def_optype
181 get_v_may_def_ops (stmt_ann_t ann)
182 {
183   return ann ? ann->operands.v_may_def_ops : NULL;
184 }
185
186 /* Return the virtual uses present in ANN, a statement annotation.
187    Return NULL if this annotation contains no virtual uses.  */
188 static inline vuse_optype
189 get_vuse_ops (stmt_ann_t ann)
190 {
191   return ann ? ann->operands.vuse_ops : NULL;
192 }
193
194 /* Return the virtual must-defs present in ANN, a statement
195    annotation.  Return NULL if this annotation contains no must-defs.*/
196 static inline v_must_def_optype
197 get_v_must_def_ops (stmt_ann_t ann)
198 {
199   return ann ? ann->operands.v_must_def_ops : NULL;
200 }
201
202 /* Return the tree pointer to by USE.  */ 
203 static inline tree
204 get_use_from_ptr (use_operand_p use)
205
206   return *(use.use);
207
208
209 /* Return the tree pointer to by DEF.  */
210 static inline tree
211 get_def_from_ptr (def_operand_p def)
212 {
213   return *(def.def);
214 }
215
216 /* Return a pointer to the tree that is at INDEX in the USES array.  */
217 static inline use_operand_p
218 get_use_op_ptr (use_optype uses, unsigned int index)
219 {
220   gcc_assert (index < uses->num_uses);
221   return uses->uses[index];
222 }
223
224 /* Return a def_operand_p pointer for element INDEX of DEFS.  */
225 static inline def_operand_p
226 get_def_op_ptr (def_optype defs, unsigned int index)
227 {
228   gcc_assert (index < defs->num_defs);
229   return defs->defs[index];
230 }
231
232
233 /* Return the def_operand_p that is the V_MAY_DEF_RESULT for the V_MAY_DEF
234    at INDEX in the V_MAY_DEFS array.  */
235 static inline def_operand_p
236 get_v_may_def_result_ptr(v_may_def_optype v_may_defs, unsigned int index)
237 {
238   def_operand_p op;
239   gcc_assert (index < v_may_defs->num_v_may_defs);
240   op.def = &(v_may_defs->v_may_defs[index].def);
241   return op;
242 }
243
244 /* Return a use_operand_p that is the V_MAY_DEF_OP for the V_MAY_DEF at
245    INDEX in the V_MAY_DEFS array.  */
246 static inline use_operand_p
247 get_v_may_def_op_ptr(v_may_def_optype v_may_defs, unsigned int index)
248 {
249   use_operand_p op;
250   gcc_assert (index < v_may_defs->num_v_may_defs);
251   op.use = &(v_may_defs->v_may_defs[index].use);
252   return op;
253 }
254
255 /* Return a use_operand_p that is at INDEX in the VUSES array.  */
256 static inline use_operand_p
257 get_vuse_op_ptr(vuse_optype vuses, unsigned int index)
258 {
259   use_operand_p op;
260   gcc_assert (index < vuses->num_vuses);
261   op.use = &(vuses->vuses[index]);
262   return op;
263 }
264
265 /* Return a def_operand_p that is the V_MUST_DEF_OP for the
266    V_MUST_DEF at INDEX in the V_MUST_DEFS array.  */
267 static inline def_operand_p
268 get_v_must_def_op_ptr (v_must_def_optype v_must_defs, unsigned int index)
269 {
270   def_operand_p op;
271   gcc_assert (index < v_must_defs->num_v_must_defs);
272   op.def = &(v_must_defs->v_must_defs[index]);
273   return op;
274 }
275
276 /* Return a def_operand_p pointer for the result of PHI.  */
277 static inline def_operand_p
278 get_phi_result_ptr (tree phi)
279 {
280   def_operand_p op;
281   op.def = &(PHI_RESULT_TREE (phi));
282   return op;
283 }
284
285 /* Return a use_operand_p pointer for argument I of phinode PHI.  */
286 static inline use_operand_p
287 get_phi_arg_def_ptr (tree phi, int i)
288 {
289   use_operand_p op;
290   op.use = &(PHI_ARG_DEF_TREE (phi, i));
291   return op;
292 }
293  
294 /* Return the bitmap of addresses taken by STMT, or NULL if it takes
295    no addresses.  */
296 static inline bitmap
297 addresses_taken (tree stmt)
298 {
299   stmt_ann_t ann = stmt_ann (stmt);
300   return ann ? ann->addresses_taken : NULL;
301 }
302
303 /* Return the immediate uses of STMT, or NULL if this information is
304    not computed.  */
305 static dataflow_t
306 get_immediate_uses (tree stmt)
307 {
308   stmt_ann_t ann = stmt_ann (stmt);
309   return ann ? ann->df : NULL;
310 }
311
312 /* Return the number of immediate uses present in the dataflow
313    information at DF.  */
314 static inline int
315 num_immediate_uses (dataflow_t df)
316 {
317   varray_type imm;
318
319   if (!df)
320     return 0;
321
322   imm = df->immediate_uses;
323   if (!imm)
324     return df->uses[1] ? 2 : 1;
325
326   return VARRAY_ACTIVE_SIZE (imm) + 2;
327 }
328
329 /* Return the tree that is at NUM in the immediate use DF array.  */
330 static inline tree
331 immediate_use (dataflow_t df, int num)
332 {
333   if (!df)
334     return NULL_TREE;
335
336 #ifdef ENABLE_CHECKING
337   gcc_assert (num < num_immediate_uses (df));
338 #endif
339   if (num < 2)
340     return df->uses[num];
341   return VARRAY_TREE (df->immediate_uses, num - 2);
342 }
343
344 /* Return the basic_block annotation for BB.  */
345 static inline bb_ann_t
346 bb_ann (basic_block bb)
347 {
348   return (bb_ann_t)bb->tree_annotations;
349 }
350
351 /* Return the PHI nodes for basic block BB, or NULL if there are no
352    PHI nodes.  */
353 static inline tree
354 phi_nodes (basic_block bb)
355 {
356   if (bb->index < 0)
357     return NULL;
358   return bb_ann (bb)->phi_nodes;
359 }
360
361 /* Set list of phi nodes of a basic block BB to L.  */
362
363 static inline void
364 set_phi_nodes (basic_block bb, tree l)
365 {
366   tree phi;
367
368   bb_ann (bb)->phi_nodes = l;
369   for (phi = l; phi; phi = PHI_CHAIN (phi))
370     set_bb_for_stmt (phi, bb);
371 }
372
373 /* Return the phi index number for an edge.  */
374 static inline int
375 phi_arg_from_edge (tree phi, edge e)
376 {
377   int i;
378   gcc_assert (phi);
379   gcc_assert (TREE_CODE (phi) == PHI_NODE);
380
381   for (i = 0; i < PHI_NUM_ARGS (phi); i++)
382     if (PHI_ARG_EDGE (phi, i) == e)
383       return i;
384
385   return -1;
386 }
387
388 /* Mark VAR as used, so that it'll be preserved during rtl expansion.  */
389
390 static inline void
391 set_is_used (tree var)
392 {
393   var_ann_t ann = get_var_ann (var);
394   ann->used = 1;
395 }
396
397
398 /*  -----------------------------------------------------------------------  */
399
400 /* Return true if T is an executable statement.  */
401 static inline bool
402 is_exec_stmt (tree t)
403 {
404   return (t && !IS_EMPTY_STMT (t) && t != error_mark_node);
405 }
406
407
408 /* Return true if this stmt can be the target of a control transfer stmt such
409    as a goto.  */
410 static inline bool
411 is_label_stmt (tree t)
412 {
413   if (t)
414     switch (TREE_CODE (t))
415       {
416         case LABEL_DECL:
417         case LABEL_EXPR:
418         case CASE_LABEL_EXPR:
419           return true;
420         default:
421           return false;
422       }
423   return false;
424 }
425
426 /* Set the default definition for VAR to DEF.  */
427 static inline void
428 set_default_def (tree var, tree def)
429 {
430   var_ann_t ann = get_var_ann (var);
431   ann->default_def = def;
432 }
433
434 /* Return the default definition for variable VAR, or NULL if none
435    exists.  */
436 static inline tree
437 default_def (tree var)
438 {
439   var_ann_t ann = var_ann (var);
440   return ann ? ann->default_def : NULL_TREE;
441 }
442
443 /* PHI nodes should contain only ssa_names and invariants.  A test
444    for ssa_name is definitely simpler; don't let invalid contents
445    slip in in the meantime.  */
446
447 static inline bool
448 phi_ssa_name_p (tree t)
449 {
450   if (TREE_CODE (t) == SSA_NAME)
451     return true;
452 #ifdef ENABLE_CHECKING
453   gcc_assert (is_gimple_min_invariant (t));
454 #endif
455   return false;
456 }
457
458 /*  -----------------------------------------------------------------------  */
459
460 /* Return a block_stmt_iterator that points to beginning of basic
461    block BB.  */
462 static inline block_stmt_iterator
463 bsi_start (basic_block bb)
464 {
465   block_stmt_iterator bsi;
466   if (bb->stmt_list)
467     bsi.tsi = tsi_start (bb->stmt_list);
468   else
469     {
470       gcc_assert (bb->index < 0);
471       bsi.tsi.ptr = NULL;
472       bsi.tsi.container = NULL;
473     }
474   bsi.bb = bb;
475   return bsi;
476 }
477
478 /* Return a block statement iterator that points to the last label in
479    block BB.  */
480
481 static inline block_stmt_iterator
482 bsi_after_labels (basic_block bb)
483 {
484   block_stmt_iterator bsi;
485   tree_stmt_iterator next;
486
487   bsi.bb = bb;
488
489   if (!bb->stmt_list)
490     {
491       gcc_assert (bb->index < 0);
492       bsi.tsi.ptr = NULL;
493       bsi.tsi.container = NULL;
494       return bsi;
495     }
496
497   bsi.tsi = tsi_start (bb->stmt_list);
498   if (tsi_end_p (bsi.tsi))
499     return bsi;
500
501   /* Ensure that there are some labels.  The rationale is that we want
502      to insert after the bsi that is returned, and these insertions should
503      be placed at the start of the basic block.  This would not work if the
504      first statement was not label; rather fail here than enable the user
505      proceed in wrong way.  */
506   gcc_assert (TREE_CODE (tsi_stmt (bsi.tsi)) == LABEL_EXPR);
507
508   next = bsi.tsi;
509   tsi_next (&next);
510
511   while (!tsi_end_p (next)
512          && TREE_CODE (tsi_stmt (next)) == LABEL_EXPR)
513     {
514       bsi.tsi = next;
515       tsi_next (&next);
516     }
517
518   return bsi;
519 }
520
521 /* Return a block statement iterator that points to the end of basic
522    block BB.  */
523 static inline block_stmt_iterator
524 bsi_last (basic_block bb)
525 {
526   block_stmt_iterator bsi;
527   if (bb->stmt_list)
528     bsi.tsi = tsi_last (bb->stmt_list);
529   else
530     {
531       gcc_assert (bb->index < 0);
532       bsi.tsi.ptr = NULL;
533       bsi.tsi.container = NULL;
534     }
535   bsi.bb = bb;
536   return bsi;
537 }
538
539 /* Return true if block statement iterator I has reached the end of
540    the basic block.  */
541 static inline bool
542 bsi_end_p (block_stmt_iterator i)
543 {
544   return tsi_end_p (i.tsi);
545 }
546
547 /* Modify block statement iterator I so that it is at the next
548    statement in the basic block.  */
549 static inline void
550 bsi_next (block_stmt_iterator *i)
551 {
552   tsi_next (&i->tsi);
553 }
554
555 /* Modify block statement iterator I so that it is at the previous
556    statement in the basic block.  */
557 static inline void
558 bsi_prev (block_stmt_iterator *i)
559 {
560   tsi_prev (&i->tsi);
561 }
562
563 /* Return the statement that block statement iterator I is currently
564    at.  */
565 static inline tree
566 bsi_stmt (block_stmt_iterator i)
567 {
568   return tsi_stmt (i.tsi);
569 }
570
571 /* Return a pointer to the statement that block statement iterator I
572    is currently at.  */
573 static inline tree *
574 bsi_stmt_ptr (block_stmt_iterator i)
575 {
576   return tsi_stmt_ptr (i.tsi);
577 }
578
579 /* Returns the loop of the statement STMT.  */
580
581 static inline struct loop *
582 loop_containing_stmt (tree stmt)
583 {
584   basic_block bb = bb_for_stmt (stmt);
585   if (!bb)
586     return NULL;
587
588   return bb->loop_father;
589 }
590
591 /* Return true if VAR is a clobbered by function calls.  */
592 static inline bool
593 is_call_clobbered (tree var)
594 {
595   return is_global_var (var)
596          || bitmap_bit_p (call_clobbered_vars, var_ann (var)->uid);
597 }
598
599 /* Mark variable VAR as being clobbered by function calls.  */
600 static inline void
601 mark_call_clobbered (tree var)
602 {
603   var_ann_t ann = var_ann (var);
604   /* If VAR is a memory tag, then we need to consider it a global
605      variable.  This is because the pointer that VAR represents has
606      been found to point to either an arbitrary location or to a known
607      location in global memory.  */
608   if (ann->mem_tag_kind != NOT_A_TAG)
609     DECL_EXTERNAL (var) = 1;
610   bitmap_set_bit (call_clobbered_vars, ann->uid);
611 }
612
613 /* Mark variable VAR as being non-addressable.  */
614 static inline void
615 mark_non_addressable (tree var)
616 {
617   bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
618   TREE_ADDRESSABLE (var) = 0;
619 }
620
621 /* Return the common annotation for T.  Return NULL if the annotation
622    doesn't already exist.  */
623 static inline tree_ann_t
624 tree_ann (tree t)
625 {
626   return t->common.ann;
627 }
628
629 /* Return a common annotation for T.  Create the constant annotation if it
630    doesn't exist.  */
631 static inline tree_ann_t
632 get_tree_ann (tree t)
633 {
634   tree_ann_t ann = tree_ann (t);
635   return (ann) ? ann : create_tree_ann (t);
636 }
637
638 /*  -----------------------------------------------------------------------  */
639
640 /* The following set of routines are used to iterator over various type of
641    SSA operands.  */
642
643 /* Return true if PTR is finished iterating.  */
644 static inline bool
645 op_iter_done (ssa_op_iter *ptr)
646 {
647   return ptr->done;
648 }
649
650 /* Get the next iterator use value for PTR.  */
651 static inline use_operand_p
652 op_iter_next_use (ssa_op_iter *ptr)
653 {
654   if (ptr->use_i < ptr->num_use)
655     {
656       return USE_OP_PTR (ptr->ops->use_ops, (ptr->use_i)++);
657     }
658   if (ptr->vuse_i < ptr->num_vuse)
659     {
660       return VUSE_OP_PTR (ptr->ops->vuse_ops, (ptr->vuse_i)++);
661     }
662   if (ptr->v_mayu_i < ptr->num_v_mayu)
663     {
664       return V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops,
665                                        (ptr->v_mayu_i)++);
666     }
667   ptr->done = true;
668   return NULL_USE_OPERAND_P;
669 }
670
671 /* Get the next iterator def value for PTR.  */
672 static inline def_operand_p
673 op_iter_next_def (ssa_op_iter *ptr)
674 {
675   if (ptr->def_i < ptr->num_def)
676     {
677       return DEF_OP_PTR (ptr->ops->def_ops, (ptr->def_i)++);
678     }
679   if (ptr->v_must_i < ptr->num_v_must)
680     {
681       return V_MUST_DEF_OP_PTR (ptr->ops->v_must_def_ops, 
682                                         (ptr->v_must_i)++);
683     }
684   if (ptr->v_mayd_i < ptr->num_v_mayd)
685     {
686       return V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops,
687                                            (ptr->v_mayd_i)++);
688     }
689   ptr->done = true;
690   return NULL_DEF_OPERAND_P;
691 }
692
693 /* Get the next iterator tree value for PTR.  */
694 static inline tree
695 op_iter_next_tree (ssa_op_iter *ptr)
696 {
697   if (ptr->use_i < ptr->num_use)
698     {
699       return USE_OP (ptr->ops->use_ops, (ptr->use_i)++);
700     }
701   if (ptr->vuse_i < ptr->num_vuse)
702     {
703       return VUSE_OP (ptr->ops->vuse_ops, (ptr->vuse_i)++);
704     }
705   if (ptr->v_mayu_i < ptr->num_v_mayu)
706     {
707       return V_MAY_DEF_OP (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
708     }
709   if (ptr->def_i < ptr->num_def)
710     {
711       return DEF_OP (ptr->ops->def_ops, (ptr->def_i)++);
712     }
713   if (ptr->v_must_i < ptr->num_v_must)
714     {
715       return V_MUST_DEF_OP (ptr->ops->v_must_def_ops, 
716                                         (ptr->v_must_i)++);
717     }
718   if (ptr->v_mayd_i < ptr->num_v_mayd)
719     {
720       return V_MAY_DEF_RESULT (ptr->ops->v_may_def_ops,
721                                            (ptr->v_mayd_i)++);
722     }
723   ptr->done = true;
724   return NULL;
725 }
726
727 /* Initialize the iterator PTR to the virtual defs in STMT.  */
728 static inline void
729 op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
730 {
731   stmt_operands_p ops;
732   stmt_ann_t ann = get_stmt_ann (stmt);
733
734   ops = &(ann->operands);
735   ptr->done = false;
736   ptr->ops = ops;
737   ptr->num_def = (flags & SSA_OP_DEF) ? NUM_DEFS (ops->def_ops) : 0;
738   ptr->num_use = (flags & SSA_OP_USE) ? NUM_USES (ops->use_ops) : 0;
739   ptr->num_vuse = (flags & SSA_OP_VUSE) ? NUM_VUSES (ops->vuse_ops) : 0;
740   ptr->num_v_mayu = (flags & SSA_OP_VMAYUSE)
741                      ?  NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
742   ptr->num_v_mayd = (flags & SSA_OP_VMAYDEF) 
743                      ?  NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
744   ptr->num_v_must = (flags & SSA_OP_VMUSTDEF) 
745                      ? NUM_V_MUST_DEFS (ops->v_must_def_ops) : 0;
746   ptr->def_i = 0;
747   ptr->use_i = 0;
748   ptr->vuse_i = 0;
749   ptr->v_mayu_i = 0;
750   ptr->v_mayd_i = 0;
751   ptr->v_must_i = 0;
752 }
753
754 /* Initialize iterator PTR to the use operands in STMT based on FLAGS. Return
755    the first use.  */
756 static inline use_operand_p
757 op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
758 {
759   op_iter_init (ptr, stmt, flags);
760   return op_iter_next_use (ptr);
761 }
762
763 /* Initialize iterator PTR to the def operands in STMT based on FLAGS. Return
764    the first def.  */
765 static inline def_operand_p
766 op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
767 {
768   op_iter_init (ptr, stmt, flags);
769   return op_iter_next_def (ptr);
770 }
771
772 /* Initialize iterator PTR to the operands in STMT based on FLAGS. Return
773    the first operand as a tree.  */
774 static inline tree
775 op_iter_init_tree (ssa_op_iter *ptr, tree stmt, int flags)
776 {
777   op_iter_init (ptr, stmt, flags);
778   return op_iter_next_tree (ptr);
779 }
780
781 /* Get the next iterator maydef value for PTR, returning the maydef values in
782    USE and DEF.  */
783 static inline void
784 op_iter_next_maydef (use_operand_p *use, def_operand_p *def, ssa_op_iter *ptr)
785 {
786   if (ptr->v_mayu_i < ptr->num_v_mayu)
787     {
788       *def = V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops, ptr->v_mayu_i);
789       *use = V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
790       return;
791     }
792   else
793     {
794       *def = NULL_DEF_OPERAND_P;
795       *use = NULL_USE_OPERAND_P;
796     }
797   ptr->done = true;
798   return;
799 }
800
801 /* Initialize iterator PTR to the operands in STMT.  Return the first operands
802    in USE and DEF.  */
803 static inline void
804 op_iter_init_maydef (ssa_op_iter *ptr, tree stmt, use_operand_p *use, 
805                      def_operand_p *def)
806 {
807   op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
808   op_iter_next_maydef (use, def, ptr);
809 }
810 #endif /* _TREE_FLOW_INLINE_H  */