OSDN Git Service

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