OSDN Git Service

* collect2.c (main): Match exactly --version and --help.
[pf3gnuchains/gcc-fork.git] / gcc / gimple.h
1 /* Gimple IR definitions.
2
3    Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4    Contributed by Aldy Hernandez <aldyh@redhat.com>
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3.  If not see
20 <http://www.gnu.org/licenses/>.  */
21
22 #ifndef GCC_GIMPLE_H
23 #define GCC_GIMPLE_H
24
25 #include "pointer-set.h"
26 #include "vec.h"
27 #include "vecprim.h"
28 #include "vecir.h"
29 #include "ggc.h"
30 #include "tm.h"
31 #include "hard-reg-set.h"
32 #include "basic-block.h"
33 #include "tree-ssa-operands.h"
34 #include "tree-ssa-alias.h"
35
36 struct gimple_seq_node_d;
37 typedef struct gimple_seq_node_d *gimple_seq_node;
38 typedef const struct gimple_seq_node_d *const_gimple_seq_node;
39
40 /* For each block, the PHI nodes that need to be rewritten are stored into
41    these vectors.  */
42 typedef VEC(gimple, heap) *gimple_vec;
43 DEF_VEC_P (gimple_vec);
44 DEF_VEC_ALLOC_P (gimple_vec, heap);
45
46 enum gimple_code {
47 #define DEFGSCODE(SYM, STRING, STRUCT)  SYM,
48 #include "gimple.def"
49 #undef DEFGSCODE
50     LAST_AND_UNUSED_GIMPLE_CODE
51 };
52
53 extern const char *const gimple_code_name[];
54 extern const unsigned char gimple_rhs_class_table[];
55
56 /* Error out if a gimple tuple is addressed incorrectly.  */
57 #if defined ENABLE_GIMPLE_CHECKING
58 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
59 extern void gimple_check_failed (const_gimple, const char *, int,          \
60                                  const char *, enum gimple_code,           \
61                                  enum tree_code) ATTRIBUTE_NORETURN;
62
63 #define GIMPLE_CHECK(GS, CODE)                                          \
64   do {                                                                  \
65     const_gimple __gs = (GS);                                           \
66     if (gimple_code (__gs) != (CODE))                                   \
67       gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,      \
68                            (CODE), ERROR_MARK);                         \
69   } while (0)
70 #else  /* not ENABLE_GIMPLE_CHECKING  */
71 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
72 #define GIMPLE_CHECK(GS, CODE)                  (void)0
73 #endif
74
75 /* Class of GIMPLE expressions suitable for the RHS of assignments.  See
76    get_gimple_rhs_class.  */
77 enum gimple_rhs_class
78 {
79   GIMPLE_INVALID_RHS,   /* The expression cannot be used on the RHS.  */
80   GIMPLE_BINARY_RHS,    /* The expression is a binary operation.  */
81   GIMPLE_UNARY_RHS,     /* The expression is a unary operation.  */
82   GIMPLE_SINGLE_RHS     /* The expression is a single object (an SSA
83                            name, a _DECL, a _REF, etc.  */
84 };
85
86 /* Specific flags for individual GIMPLE statements.  These flags are
87    always stored in gimple_statement_base.subcode and they may only be
88    defined for statement codes that do not use sub-codes.
89
90    Values for the masks can overlap as long as the overlapping values
91    are never used in the same statement class.
92
93    The maximum mask value that can be defined is 1 << 15 (i.e., each
94    statement code can hold up to 16 bitflags).
95
96    Keep this list sorted.  */
97 enum gf_mask {
98     GF_ASM_INPUT                = 1 << 0,
99     GF_ASM_VOLATILE             = 1 << 1,
100     GF_CALL_CANNOT_INLINE       = 1 << 0,
101     GF_CALL_FROM_THUNK          = 1 << 1,
102     GF_CALL_RETURN_SLOT_OPT     = 1 << 2,
103     GF_CALL_TAILCALL            = 1 << 3,
104     GF_CALL_VA_ARG_PACK         = 1 << 4,
105     GF_CALL_NOTHROW             = 1 << 5,
106     GF_OMP_PARALLEL_COMBINED    = 1 << 0,
107
108     /* True on an GIMPLE_OMP_RETURN statement if the return does not require
109        a thread synchronization via some sort of barrier.  The exact barrier
110        that would otherwise be emitted is dependent on the OMP statement with
111        which this return is associated.  */
112     GF_OMP_RETURN_NOWAIT        = 1 << 0,
113
114     GF_OMP_SECTION_LAST         = 1 << 0,
115     GF_PREDICT_TAKEN            = 1 << 15
116 };
117
118 /* Currently, there's only one type of gimple debug stmt.  Others are
119    envisioned, for example, to enable the generation of is_stmt notes
120    in line number information, to mark sequence points, etc.  This
121    subcode is to be used to tell them apart.  */
122 enum gimple_debug_subcode {
123   GIMPLE_DEBUG_BIND = 0
124 };
125
126 /* Masks for selecting a pass local flag (PLF) to work on.  These
127    masks are used by gimple_set_plf and gimple_plf.  */
128 enum plf_mask {
129     GF_PLF_1    = 1 << 0,
130     GF_PLF_2    = 1 << 1
131 };
132
133 /* A node in a gimple_seq_d.  */
134 struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) gimple_seq_node_d {
135   gimple stmt;
136   struct gimple_seq_node_d *prev;
137   struct gimple_seq_node_d *next;
138 };
139
140 /* A double-linked sequence of gimple statements.  */
141 struct GTY ((chain_next ("%h.next_free"))) gimple_seq_d {
142   /* First and last statements in the sequence.  */
143   gimple_seq_node first;
144   gimple_seq_node last;
145
146   /* Sequences are created/destroyed frequently.  To minimize
147      allocation activity, deallocated sequences are kept in a pool of
148      available sequences.  This is the pointer to the next free
149      sequence in the pool.  */
150   gimple_seq next_free;
151 };
152
153
154 /* Return the first node in GIMPLE sequence S.  */
155
156 static inline gimple_seq_node
157 gimple_seq_first (const_gimple_seq s)
158 {
159   return s ? s->first : NULL;
160 }
161
162
163 /* Return the first statement in GIMPLE sequence S.  */
164
165 static inline gimple
166 gimple_seq_first_stmt (const_gimple_seq s)
167 {
168   gimple_seq_node n = gimple_seq_first (s);
169   return (n) ? n->stmt : NULL;
170 }
171
172
173 /* Return the last node in GIMPLE sequence S.  */
174
175 static inline gimple_seq_node
176 gimple_seq_last (const_gimple_seq s)
177 {
178   return s ? s->last : NULL;
179 }
180
181
182 /* Return the last statement in GIMPLE sequence S.  */
183
184 static inline gimple
185 gimple_seq_last_stmt (const_gimple_seq s)
186 {
187   gimple_seq_node n = gimple_seq_last (s);
188   return (n) ? n->stmt : NULL;
189 }
190
191
192 /* Set the last node in GIMPLE sequence S to LAST.  */
193
194 static inline void
195 gimple_seq_set_last (gimple_seq s, gimple_seq_node last)
196 {
197   s->last = last;
198 }
199
200
201 /* Set the first node in GIMPLE sequence S to FIRST.  */
202
203 static inline void
204 gimple_seq_set_first (gimple_seq s, gimple_seq_node first)
205 {
206   s->first = first;
207 }
208
209
210 /* Return true if GIMPLE sequence S is empty.  */
211
212 static inline bool
213 gimple_seq_empty_p (const_gimple_seq s)
214 {
215   return s == NULL || s->first == NULL;
216 }
217
218
219 void gimple_seq_add_stmt (gimple_seq *, gimple);
220
221 /* Link gimple statement GS to the end of the sequence *SEQ_P.  If
222    *SEQ_P is NULL, a new sequence is allocated.  This function is
223    similar to gimple_seq_add_stmt, but does not scan the operands.
224    During gimplification, we need to manipulate statement sequences
225    before the def/use vectors have been constructed.  */
226 void gimplify_seq_add_stmt (gimple_seq *, gimple);
227
228 /* Allocate a new sequence and initialize its first element with STMT.  */
229
230 static inline gimple_seq
231 gimple_seq_alloc_with_stmt (gimple stmt)
232 {
233   gimple_seq seq = NULL;
234   gimple_seq_add_stmt (&seq, stmt);
235   return seq;
236 }
237
238
239 /* Returns the sequence of statements in BB.  */
240
241 static inline gimple_seq
242 bb_seq (const_basic_block bb)
243 {
244   return (!(bb->flags & BB_RTL) && bb->il.gimple) ? bb->il.gimple->seq : NULL;
245 }
246
247
248 /* Sets the sequence of statements in BB to SEQ.  */
249
250 static inline void
251 set_bb_seq (basic_block bb, gimple_seq seq)
252 {
253   gcc_checking_assert (!(bb->flags & BB_RTL));
254   bb->il.gimple->seq = seq;
255 }
256
257 /* Iterator object for GIMPLE statement sequences.  */
258
259 typedef struct
260 {
261   /* Sequence node holding the current statement.  */
262   gimple_seq_node ptr;
263
264   /* Sequence and basic block holding the statement.  These fields
265      are necessary to handle edge cases such as when statement is
266      added to an empty basic block or when the last statement of a
267      block/sequence is removed.  */
268   gimple_seq seq;
269   basic_block bb;
270 } gimple_stmt_iterator;
271
272
273 /* Data structure definitions for GIMPLE tuples.  NOTE: word markers
274    are for 64 bit hosts.  */
275
276 struct GTY(()) gimple_statement_base {
277   /* [ WORD 1 ]
278      Main identifying code for a tuple.  */
279   ENUM_BITFIELD(gimple_code) code : 8;
280
281   /* Nonzero if a warning should not be emitted on this tuple.  */
282   unsigned int no_warning       : 1;
283
284   /* Nonzero if this tuple has been visited.  Passes are responsible
285      for clearing this bit before using it.  */
286   unsigned int visited          : 1;
287
288   /* Nonzero if this tuple represents a non-temporal move.  */
289   unsigned int nontemporal_move : 1;
290
291   /* Pass local flags.  These flags are free for any pass to use as
292      they see fit.  Passes should not assume that these flags contain
293      any useful value when the pass starts.  Any initial state that
294      the pass requires should be set on entry to the pass.  See
295      gimple_set_plf and gimple_plf for usage.  */
296   unsigned int plf              : 2;
297
298   /* Nonzero if this statement has been modified and needs to have its
299      operands rescanned.  */
300   unsigned modified             : 1;
301
302   /* Nonzero if this statement contains volatile operands.  */
303   unsigned has_volatile_ops     : 1;
304
305   /* Padding to get subcode to 16 bit alignment.  */
306   unsigned pad                  : 1;
307
308   /* The SUBCODE field can be used for tuple-specific flags for tuples
309      that do not require subcodes.  Note that SUBCODE should be at
310      least as wide as tree codes, as several tuples store tree codes
311      in there.  */
312   unsigned int subcode          : 16;
313
314   /* UID of this statement.  This is used by passes that want to
315      assign IDs to statements.  It must be assigned and used by each
316      pass.  By default it should be assumed to contain garbage.  */
317   unsigned uid;
318
319   /* [ WORD 2 ]
320      Locus information for debug info.  */
321   location_t location;
322
323   /* Number of operands in this tuple.  */
324   unsigned num_ops;
325
326   /* [ WORD 3 ]
327      Basic block holding this statement.  */
328   struct basic_block_def *bb;
329
330   /* [ WORD 4 ]
331      Lexical block holding this statement.  */
332   tree block;
333 };
334
335
336 /* Base structure for tuples with operands.  */
337
338 struct GTY(()) gimple_statement_with_ops_base
339 {
340   /* [ WORD 1-4 ]  */
341   struct gimple_statement_base gsbase;
342
343   /* [ WORD 5-6 ]
344      SSA operand vectors.  NOTE: It should be possible to
345      amalgamate these vectors with the operand vector OP.  However,
346      the SSA operand vectors are organized differently and contain
347      more information (like immediate use chaining).  */
348   struct def_optype_d GTY((skip (""))) *def_ops;
349   struct use_optype_d GTY((skip (""))) *use_ops;
350 };
351
352
353 /* Statements that take register operands.  */
354
355 struct GTY(()) gimple_statement_with_ops
356 {
357   /* [ WORD 1-6 ]  */
358   struct gimple_statement_with_ops_base opbase;
359
360   /* [ WORD 7 ]
361      Operand vector.  NOTE!  This must always be the last field
362      of this structure.  In particular, this means that this
363      structure cannot be embedded inside another one.  */
364   tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
365 };
366
367
368 /* Base for statements that take both memory and register operands.  */
369
370 struct GTY(()) gimple_statement_with_memory_ops_base
371 {
372   /* [ WORD 1-6 ]  */
373   struct gimple_statement_with_ops_base opbase;
374
375   /* [ WORD 7-8 ]
376      Virtual operands for this statement.  The GC will pick them
377      up via the ssa_names array.  */
378   tree GTY((skip (""))) vdef;
379   tree GTY((skip (""))) vuse;
380 };
381
382
383 /* Statements that take both memory and register operands.  */
384
385 struct GTY(()) gimple_statement_with_memory_ops
386 {
387   /* [ WORD 1-8 ]  */
388   struct gimple_statement_with_memory_ops_base membase;
389
390   /* [ WORD 9 ]
391      Operand vector.  NOTE!  This must always be the last field
392      of this structure.  In particular, this means that this
393      structure cannot be embedded inside another one.  */
394   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
395 };
396
397
398 /* Call statements that take both memory and register operands.  */
399
400 struct GTY(()) gimple_statement_call
401 {
402   /* [ WORD 1-8 ]  */
403   struct gimple_statement_with_memory_ops_base membase;
404
405   /* [ WORD 9-12 ]  */
406   struct pt_solution call_used;
407   struct pt_solution call_clobbered;
408
409   /* [ WORD 13 ]
410      Operand vector.  NOTE!  This must always be the last field
411      of this structure.  In particular, this means that this
412      structure cannot be embedded inside another one.  */
413   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
414 };
415
416
417 /* OpenMP statements (#pragma omp).  */
418
419 struct GTY(()) gimple_statement_omp {
420   /* [ WORD 1-4 ]  */
421   struct gimple_statement_base gsbase;
422
423   /* [ WORD 5 ]  */
424   gimple_seq body;
425 };
426
427
428 /* GIMPLE_BIND */
429
430 struct GTY(()) gimple_statement_bind {
431   /* [ WORD 1-4 ]  */
432   struct gimple_statement_base gsbase;
433
434   /* [ WORD 5 ]
435      Variables declared in this scope.  */
436   tree vars;
437
438   /* [ WORD 6 ]
439      This is different than the BLOCK field in gimple_statement_base,
440      which is analogous to TREE_BLOCK (i.e., the lexical block holding
441      this statement).  This field is the equivalent of BIND_EXPR_BLOCK
442      in tree land (i.e., the lexical scope defined by this bind).  See
443      gimple-low.c.  */
444   tree block;
445
446   /* [ WORD 7 ]  */
447   gimple_seq body;
448 };
449
450
451 /* GIMPLE_CATCH */
452
453 struct GTY(()) gimple_statement_catch {
454   /* [ WORD 1-4 ]  */
455   struct gimple_statement_base gsbase;
456
457   /* [ WORD 5 ]  */
458   tree types;
459
460   /* [ WORD 6 ]  */
461   gimple_seq handler;
462 };
463
464
465 /* GIMPLE_EH_FILTER */
466
467 struct GTY(()) gimple_statement_eh_filter {
468   /* [ WORD 1-4 ]  */
469   struct gimple_statement_base gsbase;
470
471   /* [ WORD 5 ]
472      Filter types.  */
473   tree types;
474
475   /* [ WORD 6 ]
476      Failure actions.  */
477   gimple_seq failure;
478 };
479
480
481 /* GIMPLE_EH_MUST_NOT_THROW */
482
483 struct GTY(()) gimple_statement_eh_mnt {
484   /* [ WORD 1-4 ]  */
485   struct gimple_statement_base gsbase;
486
487   /* [ WORD 5 ] Abort function decl.  */
488   tree fndecl;
489 };
490
491 /* GIMPLE_PHI */
492
493 struct GTY(()) gimple_statement_phi {
494   /* [ WORD 1-4 ]  */
495   struct gimple_statement_base gsbase;
496
497   /* [ WORD 5 ]  */
498   unsigned capacity;
499   unsigned nargs;
500
501   /* [ WORD 6 ]  */
502   tree result;
503
504   /* [ WORD 7 ]  */
505   struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
506 };
507
508
509 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
510
511 struct GTY(()) gimple_statement_eh_ctrl
512 {
513   /* [ WORD 1-4 ]  */
514   struct gimple_statement_base gsbase;
515
516   /* [ WORD 5 ]
517      Exception region number.  */
518   int region;
519 };
520
521
522 /* GIMPLE_TRY */
523
524 struct GTY(()) gimple_statement_try {
525   /* [ WORD 1-4 ]  */
526   struct gimple_statement_base gsbase;
527
528   /* [ WORD 5 ]
529      Expression to evaluate.  */
530   gimple_seq eval;
531
532   /* [ WORD 6 ]
533      Cleanup expression.  */
534   gimple_seq cleanup;
535 };
536
537 /* Kind of GIMPLE_TRY statements.  */
538 enum gimple_try_flags
539 {
540   /* A try/catch.  */
541   GIMPLE_TRY_CATCH = 1 << 0,
542
543   /* A try/finally.  */
544   GIMPLE_TRY_FINALLY = 1 << 1,
545   GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
546
547   /* Analogous to TRY_CATCH_IS_CLEANUP.  */
548   GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
549 };
550
551 /* GIMPLE_WITH_CLEANUP_EXPR */
552
553 struct GTY(()) gimple_statement_wce {
554   /* [ WORD 1-4 ]  */
555   struct gimple_statement_base gsbase;
556
557   /* Subcode: CLEANUP_EH_ONLY.  True if the cleanup should only be
558               executed if an exception is thrown, not on normal exit of its
559               scope.  This flag is analogous to the CLEANUP_EH_ONLY flag
560               in TARGET_EXPRs.  */
561
562   /* [ WORD 5 ]
563      Cleanup expression.  */
564   gimple_seq cleanup;
565 };
566
567
568 /* GIMPLE_ASM  */
569
570 struct GTY(()) gimple_statement_asm
571 {
572   /* [ WORD 1-8 ]  */
573   struct gimple_statement_with_memory_ops_base membase;
574
575   /* [ WORD 9 ]
576      __asm__ statement.  */
577   const char *string;
578
579   /* [ WORD 10 ]
580        Number of inputs, outputs, clobbers, labels.  */
581   unsigned char ni;
582   unsigned char no;
583   unsigned char nc;
584   unsigned char nl;
585
586   /* [ WORD 11 ]
587      Operand vector.  NOTE!  This must always be the last field
588      of this structure.  In particular, this means that this
589      structure cannot be embedded inside another one.  */
590   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
591 };
592
593 /* GIMPLE_OMP_CRITICAL */
594
595 struct GTY(()) gimple_statement_omp_critical {
596   /* [ WORD 1-5 ]  */
597   struct gimple_statement_omp omp;
598
599   /* [ WORD 6 ]
600      Critical section name.  */
601   tree name;
602 };
603
604
605 struct GTY(()) gimple_omp_for_iter {
606   /* Condition code.  */
607   enum tree_code cond;
608
609   /* Index variable.  */
610   tree index;
611
612   /* Initial value.  */
613   tree initial;
614
615   /* Final value.  */
616   tree final;
617
618   /* Increment.  */
619   tree incr;
620 };
621
622 /* GIMPLE_OMP_FOR */
623
624 struct GTY(()) gimple_statement_omp_for {
625   /* [ WORD 1-5 ]  */
626   struct gimple_statement_omp omp;
627
628   /* [ WORD 6 ]  */
629   tree clauses;
630
631   /* [ WORD 7 ]
632      Number of elements in iter array.  */
633   size_t collapse;
634
635   /* [ WORD 8 ]  */
636   struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
637
638   /* [ WORD 9 ]
639      Pre-body evaluated before the loop body begins.  */
640   gimple_seq pre_body;
641 };
642
643
644 /* GIMPLE_OMP_PARALLEL */
645
646 struct GTY(()) gimple_statement_omp_parallel {
647   /* [ WORD 1-5 ]  */
648   struct gimple_statement_omp omp;
649
650   /* [ WORD 6 ]
651      Clauses.  */
652   tree clauses;
653
654   /* [ WORD 7 ]
655      Child function holding the body of the parallel region.  */
656   tree child_fn;
657
658   /* [ WORD 8 ]
659      Shared data argument.  */
660   tree data_arg;
661 };
662
663
664 /* GIMPLE_OMP_TASK */
665
666 struct GTY(()) gimple_statement_omp_task {
667   /* [ WORD 1-8 ]  */
668   struct gimple_statement_omp_parallel par;
669
670   /* [ WORD 9 ]
671      Child function holding firstprivate initialization if needed.  */
672   tree copy_fn;
673
674   /* [ WORD 10-11 ]
675      Size and alignment in bytes of the argument data block.  */
676   tree arg_size;
677   tree arg_align;
678 };
679
680
681 /* GIMPLE_OMP_SECTION */
682 /* Uses struct gimple_statement_omp.  */
683
684
685 /* GIMPLE_OMP_SECTIONS */
686
687 struct GTY(()) gimple_statement_omp_sections {
688   /* [ WORD 1-5 ]  */
689   struct gimple_statement_omp omp;
690
691   /* [ WORD 6 ]  */
692   tree clauses;
693
694   /* [ WORD 7 ]
695      The control variable used for deciding which of the sections to
696      execute.  */
697   tree control;
698 };
699
700 /* GIMPLE_OMP_CONTINUE.
701
702    Note: This does not inherit from gimple_statement_omp, because we
703          do not need the body field.  */
704
705 struct GTY(()) gimple_statement_omp_continue {
706   /* [ WORD 1-4 ]  */
707   struct gimple_statement_base gsbase;
708
709   /* [ WORD 5 ]  */
710   tree control_def;
711
712   /* [ WORD 6 ]  */
713   tree control_use;
714 };
715
716 /* GIMPLE_OMP_SINGLE */
717
718 struct GTY(()) gimple_statement_omp_single {
719   /* [ WORD 1-5 ]  */
720   struct gimple_statement_omp omp;
721
722   /* [ WORD 6 ]  */
723   tree clauses;
724 };
725
726
727 /* GIMPLE_OMP_ATOMIC_LOAD.
728    Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
729    contains a sequence, which we don't need here.  */
730
731 struct GTY(()) gimple_statement_omp_atomic_load {
732   /* [ WORD 1-4 ]  */
733   struct gimple_statement_base gsbase;
734
735   /* [ WORD 5-6 ]  */
736   tree rhs, lhs;
737 };
738
739 /* GIMPLE_OMP_ATOMIC_STORE.
740    See note on GIMPLE_OMP_ATOMIC_LOAD.  */
741
742 struct GTY(()) gimple_statement_omp_atomic_store {
743   /* [ WORD 1-4 ]  */
744   struct gimple_statement_base gsbase;
745
746   /* [ WORD 5 ]  */
747   tree val;
748 };
749
750 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP)   SYM,
751 enum gimple_statement_structure_enum {
752 #include "gsstruct.def"
753     LAST_GSS_ENUM
754 };
755 #undef DEFGSSTRUCT
756
757
758 /* Define the overall contents of a gimple tuple.  It may be any of the
759    structures declared above for various types of tuples.  */
760
761 union GTY ((desc ("gimple_statement_structure (&%h)"), variable_size)) gimple_statement_d {
762   struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
763   struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
764   struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
765   struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
766   struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
767   struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
768   struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
769   struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
770   struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
771   struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
772   struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
773   struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
774   struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
775   struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
776   struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
777   struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
778   struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
779   struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
780   struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
781   struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
782   struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
783   struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
784   struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
785   struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
786 };
787
788 /* In gimple.c.  */
789
790 /* Offset in bytes to the location of the operand vector.
791    Zero if there is no operand vector for this tuple structure.  */
792 extern size_t const gimple_ops_offset_[];
793
794 /* Map GIMPLE codes to GSS codes.  */
795 extern enum gimple_statement_structure_enum const gss_for_code_[];
796
797 /* This variable holds the currently expanded gimple statement for purposes
798    of comminucating the profile info to the builtin expanders.  */
799 extern gimple currently_expanding_gimple_stmt;
800
801 gimple gimple_build_return (tree);
802
803 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
804 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
805
806 void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *);
807
808 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree,
809                                           tree MEM_STAT_DECL);
810 #define gimple_build_assign_with_ops(c,o1,o2,o3) \
811   gimple_build_assign_with_ops_stat (c, o1, o2, o3 MEM_STAT_INFO)
812
813 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
814 #define gimple_build_debug_bind(var,val,stmt)                   \
815   gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
816
817 gimple gimple_build_call_vec (tree, VEC(tree, heap) *);
818 gimple gimple_build_call (tree, unsigned, ...);
819 gimple gimple_build_call_from_tree (tree);
820 gimple gimplify_assign (tree, tree, gimple_seq *);
821 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
822 gimple gimple_build_label (tree label);
823 gimple gimple_build_goto (tree dest);
824 gimple gimple_build_nop (void);
825 gimple gimple_build_bind (tree, gimple_seq, tree);
826 gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *,
827                              VEC(tree,gc) *, VEC(tree,gc) *);
828 gimple gimple_build_catch (tree, gimple_seq);
829 gimple gimple_build_eh_filter (tree, gimple_seq);
830 gimple gimple_build_eh_must_not_throw (tree);
831 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
832 gimple gimple_build_wce (gimple_seq);
833 gimple gimple_build_resx (int);
834 gimple gimple_build_eh_dispatch (int);
835 gimple gimple_build_switch_nlabels (unsigned, tree, tree);
836 gimple gimple_build_switch (unsigned, tree, tree, ...);
837 gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *);
838 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
839 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
840 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq);
841 gimple gimple_build_omp_critical (gimple_seq, tree);
842 gimple gimple_build_omp_section (gimple_seq);
843 gimple gimple_build_omp_continue (tree, tree);
844 gimple gimple_build_omp_master (gimple_seq);
845 gimple gimple_build_omp_return (bool);
846 gimple gimple_build_omp_ordered (gimple_seq);
847 gimple gimple_build_omp_sections (gimple_seq, tree);
848 gimple gimple_build_omp_sections_switch (void);
849 gimple gimple_build_omp_single (gimple_seq, tree);
850 gimple gimple_build_cdt (tree, tree);
851 gimple gimple_build_omp_atomic_load (tree, tree);
852 gimple gimple_build_omp_atomic_store (tree);
853 gimple gimple_build_predict (enum br_predictor, enum prediction);
854 enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
855 void sort_case_labels (VEC(tree,heap) *);
856 void gimple_set_body (tree, gimple_seq);
857 gimple_seq gimple_body (tree);
858 bool gimple_has_body_p (tree);
859 gimple_seq gimple_seq_alloc (void);
860 void gimple_seq_free (gimple_seq);
861 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
862 gimple_seq gimple_seq_copy (gimple_seq);
863 int gimple_call_flags (const_gimple);
864 int gimple_call_return_flags (const_gimple);
865 int gimple_call_arg_flags (const_gimple, unsigned);
866 void gimple_call_reset_alias_info (gimple);
867 bool gimple_assign_copy_p (gimple);
868 bool gimple_assign_ssa_name_copy_p (gimple);
869 bool gimple_assign_single_p (gimple);
870 bool gimple_assign_unary_nop_p (gimple);
871 void gimple_set_bb (gimple, struct basic_block_def *);
872 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
873 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
874                                      tree, tree);
875 tree gimple_get_lhs (const_gimple);
876 void gimple_set_lhs (gimple, tree);
877 void gimple_replace_lhs (gimple, tree);
878 gimple gimple_copy (gimple);
879 bool is_gimple_operand (const_tree);
880 void gimple_set_modified (gimple, bool);
881 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
882 gimple gimple_build_cond_from_tree (tree, tree, tree);
883 void gimple_cond_set_condition_from_tree (gimple, tree);
884 bool gimple_has_side_effects (const_gimple);
885 bool gimple_rhs_has_side_effects (const_gimple);
886 bool gimple_could_trap_p (gimple);
887 bool gimple_assign_rhs_could_trap_p (gimple);
888 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
889 bool empty_body_p (gimple_seq);
890 unsigned get_gimple_rhs_num_ops (enum tree_code);
891 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
892 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
893 const char *gimple_decl_printable_name (tree, int);
894 tree gimple_fold_obj_type_ref (tree, tree);
895 tree gimple_get_relevant_ref_binfo (tree ref, tree known_binfo);
896 tree gimple_fold_obj_type_ref_known_binfo (HOST_WIDE_INT, tree);
897
898 /* Returns true iff T is a valid GIMPLE statement.  */
899 extern bool is_gimple_stmt (tree);
900
901 /* Returns true iff TYPE is a valid type for a scalar register variable.  */
902 extern bool is_gimple_reg_type (tree);
903 /* Returns true iff T is a scalar register variable.  */
904 extern bool is_gimple_reg (tree);
905 /* Returns true iff T is any sort of variable.  */
906 extern bool is_gimple_variable (tree);
907 /* Returns true iff T is any sort of symbol.  */
908 extern bool is_gimple_id (tree);
909 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable).  */
910 extern bool is_gimple_min_lval (tree);
911 /* Returns true iff T is something whose address can be taken.  */
912 extern bool is_gimple_addressable (tree);
913 /* Returns true iff T is any valid GIMPLE lvalue.  */
914 extern bool is_gimple_lvalue (tree);
915
916 /* Returns true iff T is a GIMPLE address.  */
917 bool is_gimple_address (const_tree);
918 /* Returns true iff T is a GIMPLE invariant address.  */
919 bool is_gimple_invariant_address (const_tree);
920 /* Returns true iff T is a GIMPLE invariant address at interprocedural
921    level.  */
922 bool is_gimple_ip_invariant_address (const_tree);
923 /* Returns true iff T is a valid GIMPLE constant.  */
924 bool is_gimple_constant (const_tree);
925 /* Returns true iff T is a GIMPLE restricted function invariant.  */
926 extern bool is_gimple_min_invariant (const_tree);
927 /* Returns true iff T is a GIMPLE restricted interprecodural invariant.  */
928 extern bool is_gimple_ip_invariant (const_tree);
929 /* Returns true iff T is a GIMPLE rvalue.  */
930 extern bool is_gimple_val (tree);
931 /* Returns true iff T is a GIMPLE asm statement input.  */
932 extern bool is_gimple_asm_val (tree);
933 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a
934    GIMPLE temporary, a renamed user variable, or something else,
935    respectively.  */
936 extern bool is_gimple_reg_rhs (tree);
937 extern bool is_gimple_mem_rhs (tree);
938
939 /* Returns true iff T is a valid if-statement condition.  */
940 extern bool is_gimple_condexpr (tree);
941
942 /* Returns true iff T is a type conversion.  */
943 extern bool is_gimple_cast (tree);
944 /* Returns true iff T is a variable that does not need to live in memory.  */
945 extern bool is_gimple_non_addressable (tree t);
946
947 /* Returns true iff T is a valid call address expression.  */
948 extern bool is_gimple_call_addr (tree);
949 /* If T makes a function call, returns the CALL_EXPR operand.  */
950 extern tree get_call_expr_in (tree t);
951
952 extern void recalculate_side_effects (tree);
953 extern bool gimple_compare_field_offset (tree, tree);
954 extern tree gimple_register_type (tree);
955 extern void print_gimple_types_stats (void);
956 extern void free_gimple_type_tables (void);
957 extern tree gimple_unsigned_type (tree);
958 extern tree gimple_signed_type (tree);
959 extern alias_set_type gimple_get_alias_set (tree);
960 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
961                                    unsigned *);
962 extern bool walk_stmt_load_store_addr_ops (gimple, void *,
963                                            bool (*)(gimple, tree, void *),
964                                            bool (*)(gimple, tree, void *),
965                                            bool (*)(gimple, tree, void *));
966 extern bool walk_stmt_load_store_ops (gimple, void *,
967                                       bool (*)(gimple, tree, void *),
968                                       bool (*)(gimple, tree, void *));
969 extern bool gimple_ior_addresses_taken (bitmap, gimple);
970 extern bool gimple_call_builtin_p (gimple, enum built_in_function);
971
972 /* In gimplify.c  */
973 extern tree create_tmp_var_raw (tree, const char *);
974 extern tree create_tmp_var_name (const char *);
975 extern tree create_tmp_var (tree, const char *);
976 extern tree create_tmp_reg (tree, const char *);
977 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
978 extern tree get_formal_tmp_var (tree, gimple_seq *);
979 extern void declare_vars (tree, gimple, bool);
980 extern void annotate_all_with_location (gimple_seq, location_t);
981
982 /* Validation of GIMPLE expressions.  Note that these predicates only check
983    the basic form of the expression, they don't recurse to make sure that
984    underlying nodes are also of the right form.  */
985 typedef bool (*gimple_predicate)(tree);
986
987
988 /* FIXME we should deduce this from the predicate.  */
989 enum fallback {
990   fb_none = 0,          /* Do not generate a temporary.  */
991
992   fb_rvalue = 1,        /* Generate an rvalue to hold the result of a
993                            gimplified expression.  */
994
995   fb_lvalue = 2,        /* Generate an lvalue to hold the result of a
996                            gimplified expression.  */
997
998   fb_mayfail = 4,       /* Gimplification may fail.  Error issued
999                            afterwards.  */
1000   fb_either= fb_rvalue | fb_lvalue
1001 };
1002
1003 typedef int fallback_t;
1004
1005 enum gimplify_status {
1006   GS_ERROR      = -2,   /* Something Bad Seen.  */
1007   GS_UNHANDLED  = -1,   /* A langhook result for "I dunno".  */
1008   GS_OK         = 0,    /* We did something, maybe more to do.  */
1009   GS_ALL_DONE   = 1     /* The expression is fully gimplified.  */
1010 };
1011
1012 struct gimplify_ctx
1013 {
1014   struct gimplify_ctx *prev_context;
1015
1016   VEC(gimple,heap) *bind_expr_stack;
1017   tree temps;
1018   gimple_seq conditional_cleanups;
1019   tree exit_label;
1020   tree return_temp;
1021
1022   VEC(tree,heap) *case_labels;
1023   /* The formal temporary table.  Should this be persistent?  */
1024   htab_t temp_htab;
1025
1026   int conditions;
1027   bool save_stack;
1028   bool into_ssa;
1029   bool allow_rhs_cond_expr;
1030 };
1031
1032 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
1033                                            bool (*) (tree), fallback_t);
1034 extern void gimplify_type_sizes (tree, gimple_seq *);
1035 extern void gimplify_one_sizepos (tree *, gimple_seq *);
1036 extern bool gimplify_stmt (tree *, gimple_seq *);
1037 extern gimple gimplify_body (tree *, tree, bool);
1038 extern void push_gimplify_context (struct gimplify_ctx *);
1039 extern void pop_gimplify_context (gimple);
1040 extern void gimplify_and_add (tree, gimple_seq *);
1041
1042 /* Miscellaneous helpers.  */
1043 extern void gimple_add_tmp_var (tree);
1044 extern gimple gimple_current_bind_expr (void);
1045 extern VEC(gimple, heap) *gimple_bind_expr_stack (void);
1046 extern tree voidify_wrapper_expr (tree, tree);
1047 extern tree build_and_jump (tree *);
1048 extern tree force_labels_r (tree *, int *, void *);
1049 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
1050                                                   gimple_seq *);
1051 struct gimplify_omp_ctx;
1052 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
1053 extern tree gimple_boolify (tree);
1054 extern gimple_predicate rhs_predicate_for (tree);
1055 extern tree canonicalize_cond_expr_cond (tree);
1056
1057 /* In omp-low.c.  */
1058 extern tree omp_reduction_init (tree, tree);
1059
1060 /* In tree-nested.c.  */
1061 extern void lower_nested_functions (tree);
1062 extern void insert_field_into_struct (tree, tree);
1063
1064 /* In gimplify.c.  */
1065 extern void gimplify_function_tree (tree);
1066
1067 /* In cfgexpand.c.  */
1068 extern tree gimple_assign_rhs_to_tree (gimple);
1069
1070 /* In builtins.c  */
1071 extern bool validate_gimple_arglist (const_gimple, ...);
1072
1073 /* In tree-ssa.c  */
1074 extern bool tree_ssa_useless_type_conversion (tree);
1075 extern tree tree_ssa_strip_useless_type_conversions (tree);
1076 extern bool useless_type_conversion_p (tree, tree);
1077 extern bool types_compatible_p (tree, tree);
1078
1079 /* Return the code for GIMPLE statement G.  */
1080
1081 static inline enum gimple_code
1082 gimple_code (const_gimple g)
1083 {
1084   return g->gsbase.code;
1085 }
1086
1087
1088 /* Return the GSS code used by a GIMPLE code.  */
1089
1090 static inline enum gimple_statement_structure_enum
1091 gss_for_code (enum gimple_code code)
1092 {
1093   gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1094   return gss_for_code_[code];
1095 }
1096
1097
1098 /* Return which GSS code is used by GS.  */
1099
1100 static inline enum gimple_statement_structure_enum
1101 gimple_statement_structure (gimple gs)
1102 {
1103   return gss_for_code (gimple_code (gs));
1104 }
1105
1106
1107 /* Return true if statement G has sub-statements.  This is only true for
1108    High GIMPLE statements.  */
1109
1110 static inline bool
1111 gimple_has_substatements (gimple g)
1112 {
1113   switch (gimple_code (g))
1114     {
1115     case GIMPLE_BIND:
1116     case GIMPLE_CATCH:
1117     case GIMPLE_EH_FILTER:
1118     case GIMPLE_TRY:
1119     case GIMPLE_OMP_FOR:
1120     case GIMPLE_OMP_MASTER:
1121     case GIMPLE_OMP_ORDERED:
1122     case GIMPLE_OMP_SECTION:
1123     case GIMPLE_OMP_PARALLEL:
1124     case GIMPLE_OMP_TASK:
1125     case GIMPLE_OMP_SECTIONS:
1126     case GIMPLE_OMP_SINGLE:
1127     case GIMPLE_OMP_CRITICAL:
1128     case GIMPLE_WITH_CLEANUP_EXPR:
1129       return true;
1130
1131     default:
1132       return false;
1133     }
1134 }
1135
1136
1137 /* Return the basic block holding statement G.  */
1138
1139 static inline struct basic_block_def *
1140 gimple_bb (const_gimple g)
1141 {
1142   return g->gsbase.bb;
1143 }
1144
1145
1146 /* Return the lexical scope block holding statement G.  */
1147
1148 static inline tree
1149 gimple_block (const_gimple g)
1150 {
1151   return g->gsbase.block;
1152 }
1153
1154
1155 /* Set BLOCK to be the lexical scope block holding statement G.  */
1156
1157 static inline void
1158 gimple_set_block (gimple g, tree block)
1159 {
1160   g->gsbase.block = block;
1161 }
1162
1163
1164 /* Return location information for statement G.  */
1165
1166 static inline location_t
1167 gimple_location (const_gimple g)
1168 {
1169   return g->gsbase.location;
1170 }
1171
1172 /* Return pointer to location information for statement G.  */
1173
1174 static inline const location_t *
1175 gimple_location_ptr (const_gimple g)
1176 {
1177   return &g->gsbase.location;
1178 }
1179
1180
1181 /* Set location information for statement G.  */
1182
1183 static inline void
1184 gimple_set_location (gimple g, location_t location)
1185 {
1186   g->gsbase.location = location;
1187 }
1188
1189
1190 /* Return true if G contains location information.  */
1191
1192 static inline bool
1193 gimple_has_location (const_gimple g)
1194 {
1195   return gimple_location (g) != UNKNOWN_LOCATION;
1196 }
1197
1198
1199 /* Return the file name of the location of STMT.  */
1200
1201 static inline const char *
1202 gimple_filename (const_gimple stmt)
1203 {
1204   return LOCATION_FILE (gimple_location (stmt));
1205 }
1206
1207
1208 /* Return the line number of the location of STMT.  */
1209
1210 static inline int
1211 gimple_lineno (const_gimple stmt)
1212 {
1213   return LOCATION_LINE (gimple_location (stmt));
1214 }
1215
1216
1217 /* Determine whether SEQ is a singleton. */
1218
1219 static inline bool
1220 gimple_seq_singleton_p (gimple_seq seq)
1221 {
1222   return ((gimple_seq_first (seq) != NULL)
1223           && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1224 }
1225
1226 /* Return true if no warnings should be emitted for statement STMT.  */
1227
1228 static inline bool
1229 gimple_no_warning_p (const_gimple stmt)
1230 {
1231   return stmt->gsbase.no_warning;
1232 }
1233
1234 /* Set the no_warning flag of STMT to NO_WARNING.  */
1235
1236 static inline void
1237 gimple_set_no_warning (gimple stmt, bool no_warning)
1238 {
1239   stmt->gsbase.no_warning = (unsigned) no_warning;
1240 }
1241
1242 /* Set the visited status on statement STMT to VISITED_P.  */
1243
1244 static inline void
1245 gimple_set_visited (gimple stmt, bool visited_p)
1246 {
1247   stmt->gsbase.visited = (unsigned) visited_p;
1248 }
1249
1250
1251 /* Return the visited status for statement STMT.  */
1252
1253 static inline bool
1254 gimple_visited_p (gimple stmt)
1255 {
1256   return stmt->gsbase.visited;
1257 }
1258
1259
1260 /* Set pass local flag PLF on statement STMT to VAL_P.  */
1261
1262 static inline void
1263 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1264 {
1265   if (val_p)
1266     stmt->gsbase.plf |= (unsigned int) plf;
1267   else
1268     stmt->gsbase.plf &= ~((unsigned int) plf);
1269 }
1270
1271
1272 /* Return the value of pass local flag PLF on statement STMT.  */
1273
1274 static inline unsigned int
1275 gimple_plf (gimple stmt, enum plf_mask plf)
1276 {
1277   return stmt->gsbase.plf & ((unsigned int) plf);
1278 }
1279
1280
1281 /* Set the UID of statement.  */
1282
1283 static inline void
1284 gimple_set_uid (gimple g, unsigned uid)
1285 {
1286   g->gsbase.uid = uid;
1287 }
1288
1289
1290 /* Return the UID of statement.  */
1291
1292 static inline unsigned
1293 gimple_uid (const_gimple g)
1294 {
1295   return g->gsbase.uid;
1296 }
1297
1298
1299 /* Return true if GIMPLE statement G has register or memory operands.  */
1300
1301 static inline bool
1302 gimple_has_ops (const_gimple g)
1303 {
1304   return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1305 }
1306
1307
1308 /* Return true if GIMPLE statement G has memory operands.  */
1309
1310 static inline bool
1311 gimple_has_mem_ops (const_gimple g)
1312 {
1313   return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1314 }
1315
1316
1317 /* Return the set of DEF operands for statement G.  */
1318
1319 static inline struct def_optype_d *
1320 gimple_def_ops (const_gimple g)
1321 {
1322   if (!gimple_has_ops (g))
1323     return NULL;
1324   return g->gsops.opbase.def_ops;
1325 }
1326
1327
1328 /* Set DEF to be the set of DEF operands for statement G.  */
1329
1330 static inline void
1331 gimple_set_def_ops (gimple g, struct def_optype_d *def)
1332 {
1333   gcc_gimple_checking_assert (gimple_has_ops (g));
1334   g->gsops.opbase.def_ops = def;
1335 }
1336
1337
1338 /* Return the set of USE operands for statement G.  */
1339
1340 static inline struct use_optype_d *
1341 gimple_use_ops (const_gimple g)
1342 {
1343   if (!gimple_has_ops (g))
1344     return NULL;
1345   return g->gsops.opbase.use_ops;
1346 }
1347
1348
1349 /* Set USE to be the set of USE operands for statement G.  */
1350
1351 static inline void
1352 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1353 {
1354   gcc_gimple_checking_assert (gimple_has_ops (g));
1355   g->gsops.opbase.use_ops = use;
1356 }
1357
1358
1359 /* Return the set of VUSE operand for statement G.  */
1360
1361 static inline use_operand_p
1362 gimple_vuse_op (const_gimple g)
1363 {
1364   struct use_optype_d *ops;
1365   if (!gimple_has_mem_ops (g))
1366     return NULL_USE_OPERAND_P;
1367   ops = g->gsops.opbase.use_ops;
1368   if (ops
1369       && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
1370     return USE_OP_PTR (ops);
1371   return NULL_USE_OPERAND_P;
1372 }
1373
1374 /* Return the set of VDEF operand for statement G.  */
1375
1376 static inline def_operand_p
1377 gimple_vdef_op (const_gimple g)
1378 {
1379   struct def_optype_d *ops;
1380   if (!gimple_has_mem_ops (g))
1381     return NULL_DEF_OPERAND_P;
1382   ops = g->gsops.opbase.def_ops;
1383   if (ops
1384       && DEF_OP_PTR (ops) == &g->gsmembase.vdef)
1385     return DEF_OP_PTR (ops);
1386   return NULL_DEF_OPERAND_P;
1387 }
1388
1389
1390 /* Return the single VUSE operand of the statement G.  */
1391
1392 static inline tree
1393 gimple_vuse (const_gimple g)
1394 {
1395   if (!gimple_has_mem_ops (g))
1396     return NULL_TREE;
1397   return g->gsmembase.vuse;
1398 }
1399
1400 /* Return the single VDEF operand of the statement G.  */
1401
1402 static inline tree
1403 gimple_vdef (const_gimple g)
1404 {
1405   if (!gimple_has_mem_ops (g))
1406     return NULL_TREE;
1407   return g->gsmembase.vdef;
1408 }
1409
1410 /* Return the single VUSE operand of the statement G.  */
1411
1412 static inline tree *
1413 gimple_vuse_ptr (gimple g)
1414 {
1415   if (!gimple_has_mem_ops (g))
1416     return NULL;
1417   return &g->gsmembase.vuse;
1418 }
1419
1420 /* Return the single VDEF operand of the statement G.  */
1421
1422 static inline tree *
1423 gimple_vdef_ptr (gimple g)
1424 {
1425   if (!gimple_has_mem_ops (g))
1426     return NULL;
1427   return &g->gsmembase.vdef;
1428 }
1429
1430 /* Set the single VUSE operand of the statement G.  */
1431
1432 static inline void
1433 gimple_set_vuse (gimple g, tree vuse)
1434 {
1435   gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1436   g->gsmembase.vuse = vuse;
1437 }
1438
1439 /* Set the single VDEF operand of the statement G.  */
1440
1441 static inline void
1442 gimple_set_vdef (gimple g, tree vdef)
1443 {
1444   gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1445   g->gsmembase.vdef = vdef;
1446 }
1447
1448
1449 /* Return true if statement G has operands and the modified field has
1450    been set.  */
1451
1452 static inline bool
1453 gimple_modified_p (const_gimple g)
1454 {
1455   return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
1456 }
1457
1458
1459 /* Return the tree code for the expression computed by STMT.  This is
1460    only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN.  For
1461    GIMPLE_CALL, return CALL_EXPR as the expression code for
1462    consistency.  This is useful when the caller needs to deal with the
1463    three kinds of computation that GIMPLE supports.  */
1464
1465 static inline enum tree_code
1466 gimple_expr_code (const_gimple stmt)
1467 {
1468   enum gimple_code code = gimple_code (stmt);
1469   if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1470     return (enum tree_code) stmt->gsbase.subcode;
1471   else
1472     {
1473       gcc_gimple_checking_assert (code == GIMPLE_CALL);
1474       return CALL_EXPR;
1475     }
1476 }
1477
1478
1479 /* Mark statement S as modified, and update it.  */
1480
1481 static inline void
1482 update_stmt (gimple s)
1483 {
1484   if (gimple_has_ops (s))
1485     {
1486       gimple_set_modified (s, true);
1487       update_stmt_operands (s);
1488     }
1489 }
1490
1491 /* Update statement S if it has been optimized.  */
1492
1493 static inline void
1494 update_stmt_if_modified (gimple s)
1495 {
1496   if (gimple_modified_p (s))
1497     update_stmt_operands (s);
1498 }
1499
1500 /* Return true if statement STMT contains volatile operands.  */
1501
1502 static inline bool
1503 gimple_has_volatile_ops (const_gimple stmt)
1504 {
1505   if (gimple_has_mem_ops (stmt))
1506     return stmt->gsbase.has_volatile_ops;
1507   else
1508     return false;
1509 }
1510
1511
1512 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP.  */
1513
1514 static inline void
1515 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1516 {
1517   if (gimple_has_mem_ops (stmt))
1518     stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
1519 }
1520
1521
1522 /* Return true if statement STMT may access memory.  */
1523
1524 static inline bool
1525 gimple_references_memory_p (gimple stmt)
1526 {
1527   return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1528 }
1529
1530
1531 /* Return the subcode for OMP statement S.  */
1532
1533 static inline unsigned
1534 gimple_omp_subcode (const_gimple s)
1535 {
1536   gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1537               && gimple_code (s) <= GIMPLE_OMP_SINGLE);
1538   return s->gsbase.subcode;
1539 }
1540
1541 /* Set the subcode for OMP statement S to SUBCODE.  */
1542
1543 static inline void
1544 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1545 {
1546   /* We only have 16 bits for the subcode.  Assert that we are not
1547      overflowing it.  */
1548   gcc_gimple_checking_assert (subcode < (1 << 16));
1549   s->gsbase.subcode = subcode;
1550 }
1551
1552 /* Set the nowait flag on OMP_RETURN statement S.  */
1553
1554 static inline void
1555 gimple_omp_return_set_nowait (gimple s)
1556 {
1557   GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1558   s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
1559 }
1560
1561
1562 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1563    flag set.  */
1564
1565 static inline bool
1566 gimple_omp_return_nowait_p (const_gimple g)
1567 {
1568   GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1569   return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1570 }
1571
1572
1573 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1574    flag set.  */
1575
1576 static inline bool
1577 gimple_omp_section_last_p (const_gimple g)
1578 {
1579   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1580   return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1581 }
1582
1583
1584 /* Set the GF_OMP_SECTION_LAST flag on G.  */
1585
1586 static inline void
1587 gimple_omp_section_set_last (gimple g)
1588 {
1589   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1590   g->gsbase.subcode |= GF_OMP_SECTION_LAST;
1591 }
1592
1593
1594 /* Return true if OMP parallel statement G has the
1595    GF_OMP_PARALLEL_COMBINED flag set.  */
1596
1597 static inline bool
1598 gimple_omp_parallel_combined_p (const_gimple g)
1599 {
1600   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1601   return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1602 }
1603
1604
1605 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1606    value of COMBINED_P.  */
1607
1608 static inline void
1609 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1610 {
1611   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1612   if (combined_p)
1613     g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
1614   else
1615     g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
1616 }
1617
1618
1619 /* Return the number of operands for statement GS.  */
1620
1621 static inline unsigned
1622 gimple_num_ops (const_gimple gs)
1623 {
1624   return gs->gsbase.num_ops;
1625 }
1626
1627
1628 /* Set the number of operands for statement GS.  */
1629
1630 static inline void
1631 gimple_set_num_ops (gimple gs, unsigned num_ops)
1632 {
1633   gs->gsbase.num_ops = num_ops;
1634 }
1635
1636
1637 /* Return the array of operands for statement GS.  */
1638
1639 static inline tree *
1640 gimple_ops (gimple gs)
1641 {
1642   size_t off;
1643
1644   /* All the tuples have their operand vector at the very bottom
1645      of the structure.  Note that those structures that do not
1646      have an operand vector have a zero offset.  */
1647   off = gimple_ops_offset_[gimple_statement_structure (gs)];
1648   gcc_gimple_checking_assert (off != 0);
1649
1650   return (tree *) ((char *) gs + off);
1651 }
1652
1653
1654 /* Return operand I for statement GS.  */
1655
1656 static inline tree
1657 gimple_op (const_gimple gs, unsigned i)
1658 {
1659   if (gimple_has_ops (gs))
1660     {
1661       gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1662       return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1663     }
1664   else
1665     return NULL_TREE;
1666 }
1667
1668 /* Return a pointer to operand I for statement GS.  */
1669
1670 static inline tree *
1671 gimple_op_ptr (const_gimple gs, unsigned i)
1672 {
1673   if (gimple_has_ops (gs))
1674     {
1675       gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1676       return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1677     }
1678   else
1679     return NULL;
1680 }
1681
1682 /* Set operand I of statement GS to OP.  */
1683
1684 static inline void
1685 gimple_set_op (gimple gs, unsigned i, tree op)
1686 {
1687   gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1688
1689   /* Note.  It may be tempting to assert that OP matches
1690      is_gimple_operand, but that would be wrong.  Different tuples
1691      accept slightly different sets of tree operands.  Each caller
1692      should perform its own validation.  */
1693   gimple_ops (gs)[i] = op;
1694 }
1695
1696 /* Return true if GS is a GIMPLE_ASSIGN.  */
1697
1698 static inline bool
1699 is_gimple_assign (const_gimple gs)
1700 {
1701   return gimple_code (gs) == GIMPLE_ASSIGN;
1702 }
1703
1704 /* Determine if expression CODE is one of the valid expressions that can
1705    be used on the RHS of GIMPLE assignments.  */
1706
1707 static inline enum gimple_rhs_class
1708 get_gimple_rhs_class (enum tree_code code)
1709 {
1710   return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1711 }
1712
1713 /* Return the LHS of assignment statement GS.  */
1714
1715 static inline tree
1716 gimple_assign_lhs (const_gimple gs)
1717 {
1718   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1719   return gimple_op (gs, 0);
1720 }
1721
1722
1723 /* Return a pointer to the LHS of assignment statement GS.  */
1724
1725 static inline tree *
1726 gimple_assign_lhs_ptr (const_gimple gs)
1727 {
1728   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1729   return gimple_op_ptr (gs, 0);
1730 }
1731
1732
1733 /* Set LHS to be the LHS operand of assignment statement GS.  */
1734
1735 static inline void
1736 gimple_assign_set_lhs (gimple gs, tree lhs)
1737 {
1738   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1739   gimple_set_op (gs, 0, lhs);
1740
1741   if (lhs && TREE_CODE (lhs) == SSA_NAME)
1742     SSA_NAME_DEF_STMT (lhs) = gs;
1743 }
1744
1745
1746 /* Return the first operand on the RHS of assignment statement GS.  */
1747
1748 static inline tree
1749 gimple_assign_rhs1 (const_gimple gs)
1750 {
1751   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1752   return gimple_op (gs, 1);
1753 }
1754
1755
1756 /* Return a pointer to the first operand on the RHS of assignment
1757    statement GS.  */
1758
1759 static inline tree *
1760 gimple_assign_rhs1_ptr (const_gimple gs)
1761 {
1762   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1763   return gimple_op_ptr (gs, 1);
1764 }
1765
1766 /* Set RHS to be the first operand on the RHS of assignment statement GS.  */
1767
1768 static inline void
1769 gimple_assign_set_rhs1 (gimple gs, tree rhs)
1770 {
1771   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1772
1773   gimple_set_op (gs, 1, rhs);
1774 }
1775
1776
1777 /* Return the second operand on the RHS of assignment statement GS.
1778    If GS does not have two operands, NULL is returned instead.  */
1779
1780 static inline tree
1781 gimple_assign_rhs2 (const_gimple gs)
1782 {
1783   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1784
1785   if (gimple_num_ops (gs) >= 3)
1786     return gimple_op (gs, 2);
1787   else
1788     return NULL_TREE;
1789 }
1790
1791
1792 /* Return a pointer to the second operand on the RHS of assignment
1793    statement GS.  */
1794
1795 static inline tree *
1796 gimple_assign_rhs2_ptr (const_gimple gs)
1797 {
1798   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1799   return gimple_op_ptr (gs, 2);
1800 }
1801
1802
1803 /* Set RHS to be the second operand on the RHS of assignment statement GS.  */
1804
1805 static inline void
1806 gimple_assign_set_rhs2 (gimple gs, tree rhs)
1807 {
1808   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1809
1810   gimple_set_op (gs, 2, rhs);
1811 }
1812
1813 /* Returns true if GS is a nontemporal move.  */
1814
1815 static inline bool
1816 gimple_assign_nontemporal_move_p (const_gimple gs)
1817 {
1818   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1819   return gs->gsbase.nontemporal_move;
1820 }
1821
1822 /* Sets nontemporal move flag of GS to NONTEMPORAL.  */
1823
1824 static inline void
1825 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
1826 {
1827   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1828   gs->gsbase.nontemporal_move = nontemporal;
1829 }
1830
1831
1832 /* Return the code of the expression computed on the rhs of assignment
1833    statement GS.  In case that the RHS is a single object, returns the
1834    tree code of the object.  */
1835
1836 static inline enum tree_code
1837 gimple_assign_rhs_code (const_gimple gs)
1838 {
1839   enum tree_code code;
1840   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1841
1842   code = gimple_expr_code (gs);
1843   if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
1844     code = TREE_CODE (gimple_assign_rhs1 (gs));
1845
1846   return code;
1847 }
1848
1849
1850 /* Set CODE to be the code for the expression computed on the RHS of
1851    assignment S.  */
1852
1853 static inline void
1854 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
1855 {
1856   GIMPLE_CHECK (s, GIMPLE_ASSIGN);
1857   s->gsbase.subcode = code;
1858 }
1859
1860
1861 /* Return the gimple rhs class of the code of the expression computed on
1862    the rhs of assignment statement GS.
1863    This will never return GIMPLE_INVALID_RHS.  */
1864
1865 static inline enum gimple_rhs_class
1866 gimple_assign_rhs_class (const_gimple gs)
1867 {
1868   return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
1869 }
1870
1871
1872 /* Return true if S is a type-cast assignment.  */
1873
1874 static inline bool
1875 gimple_assign_cast_p (gimple s)
1876 {
1877   if (is_gimple_assign (s))
1878     {
1879       enum tree_code sc = gimple_assign_rhs_code (s);
1880       return CONVERT_EXPR_CODE_P (sc)
1881              || sc == VIEW_CONVERT_EXPR
1882              || sc == FIX_TRUNC_EXPR;
1883     }
1884
1885   return false;
1886 }
1887
1888
1889 /* Return true if GS is a GIMPLE_CALL.  */
1890
1891 static inline bool
1892 is_gimple_call (const_gimple gs)
1893 {
1894   return gimple_code (gs) == GIMPLE_CALL;
1895 }
1896
1897 /* Return the LHS of call statement GS.  */
1898
1899 static inline tree
1900 gimple_call_lhs (const_gimple gs)
1901 {
1902   GIMPLE_CHECK (gs, GIMPLE_CALL);
1903   return gimple_op (gs, 0);
1904 }
1905
1906
1907 /* Return a pointer to the LHS of call statement GS.  */
1908
1909 static inline tree *
1910 gimple_call_lhs_ptr (const_gimple gs)
1911 {
1912   GIMPLE_CHECK (gs, GIMPLE_CALL);
1913   return gimple_op_ptr (gs, 0);
1914 }
1915
1916
1917 /* Set LHS to be the LHS operand of call statement GS.  */
1918
1919 static inline void
1920 gimple_call_set_lhs (gimple gs, tree lhs)
1921 {
1922   GIMPLE_CHECK (gs, GIMPLE_CALL);
1923   gimple_set_op (gs, 0, lhs);
1924   if (lhs && TREE_CODE (lhs) == SSA_NAME)
1925     SSA_NAME_DEF_STMT (lhs) = gs;
1926 }
1927
1928
1929 /* Return the tree node representing the function called by call
1930    statement GS.  */
1931
1932 static inline tree
1933 gimple_call_fn (const_gimple gs)
1934 {
1935   GIMPLE_CHECK (gs, GIMPLE_CALL);
1936   return gimple_op (gs, 1);
1937 }
1938
1939
1940 /* Return a pointer to the tree node representing the function called by call
1941    statement GS.  */
1942
1943 static inline tree *
1944 gimple_call_fn_ptr (const_gimple gs)
1945 {
1946   GIMPLE_CHECK (gs, GIMPLE_CALL);
1947   return gimple_op_ptr (gs, 1);
1948 }
1949
1950
1951 /* Set FN to be the function called by call statement GS.  */
1952
1953 static inline void
1954 gimple_call_set_fn (gimple gs, tree fn)
1955 {
1956   GIMPLE_CHECK (gs, GIMPLE_CALL);
1957   gimple_set_op (gs, 1, fn);
1958 }
1959
1960
1961 /* Set FNDECL to be the function called by call statement GS.  */
1962
1963 static inline void
1964 gimple_call_set_fndecl (gimple gs, tree decl)
1965 {
1966   GIMPLE_CHECK (gs, GIMPLE_CALL);
1967   gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
1968 }
1969
1970
1971 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
1972    Otherwise return NULL.  This function is analogous to
1973    get_callee_fndecl in tree land.  */
1974
1975 static inline tree
1976 gimple_call_fndecl (const_gimple gs)
1977 {
1978   tree addr = gimple_call_fn (gs);
1979   if (TREE_CODE (addr) == ADDR_EXPR)
1980     return TREE_OPERAND (addr, 0);
1981   return NULL_TREE;
1982 }
1983
1984
1985 /* Return the type returned by call statement GS.  */
1986
1987 static inline tree
1988 gimple_call_return_type (const_gimple gs)
1989 {
1990   tree fn = gimple_call_fn (gs);
1991   tree type = TREE_TYPE (fn);
1992
1993   /* See through the pointer.  */
1994   type = TREE_TYPE (type);
1995
1996   /* The type returned by a FUNCTION_DECL is the type of its
1997      function type.  */
1998   return TREE_TYPE (type);
1999 }
2000
2001
2002 /* Return the static chain for call statement GS.  */
2003
2004 static inline tree
2005 gimple_call_chain (const_gimple gs)
2006 {
2007   GIMPLE_CHECK (gs, GIMPLE_CALL);
2008   return gimple_op (gs, 2);
2009 }
2010
2011
2012 /* Return a pointer to the static chain for call statement GS.  */
2013
2014 static inline tree *
2015 gimple_call_chain_ptr (const_gimple gs)
2016 {
2017   GIMPLE_CHECK (gs, GIMPLE_CALL);
2018   return gimple_op_ptr (gs, 2);
2019 }
2020
2021 /* Set CHAIN to be the static chain for call statement GS.  */
2022
2023 static inline void
2024 gimple_call_set_chain (gimple gs, tree chain)
2025 {
2026   GIMPLE_CHECK (gs, GIMPLE_CALL);
2027
2028   gimple_set_op (gs, 2, chain);
2029 }
2030
2031
2032 /* Return the number of arguments used by call statement GS.  */
2033
2034 static inline unsigned
2035 gimple_call_num_args (const_gimple gs)
2036 {
2037   unsigned num_ops;
2038   GIMPLE_CHECK (gs, GIMPLE_CALL);
2039   num_ops = gimple_num_ops (gs);
2040   return num_ops - 3;
2041 }
2042
2043
2044 /* Return the argument at position INDEX for call statement GS.  */
2045
2046 static inline tree
2047 gimple_call_arg (const_gimple gs, unsigned index)
2048 {
2049   GIMPLE_CHECK (gs, GIMPLE_CALL);
2050   return gimple_op (gs, index + 3);
2051 }
2052
2053
2054 /* Return a pointer to the argument at position INDEX for call
2055    statement GS.  */
2056
2057 static inline tree *
2058 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2059 {
2060   GIMPLE_CHECK (gs, GIMPLE_CALL);
2061   return gimple_op_ptr (gs, index + 3);
2062 }
2063
2064
2065 /* Set ARG to be the argument at position INDEX for call statement GS.  */
2066
2067 static inline void
2068 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2069 {
2070   GIMPLE_CHECK (gs, GIMPLE_CALL);
2071   gimple_set_op (gs, index + 3, arg);
2072 }
2073
2074
2075 /* If TAIL_P is true, mark call statement S as being a tail call
2076    (i.e., a call just before the exit of a function).  These calls are
2077    candidate for tail call optimization.  */
2078
2079 static inline void
2080 gimple_call_set_tail (gimple s, bool tail_p)
2081 {
2082   GIMPLE_CHECK (s, GIMPLE_CALL);
2083   if (tail_p)
2084     s->gsbase.subcode |= GF_CALL_TAILCALL;
2085   else
2086     s->gsbase.subcode &= ~GF_CALL_TAILCALL;
2087 }
2088
2089
2090 /* Return true if GIMPLE_CALL S is marked as a tail call.  */
2091
2092 static inline bool
2093 gimple_call_tail_p (gimple s)
2094 {
2095   GIMPLE_CHECK (s, GIMPLE_CALL);
2096   return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
2097 }
2098
2099
2100 /* Set the inlinable status of GIMPLE_CALL S to INLINABLE_P.  */
2101
2102 static inline void
2103 gimple_call_set_cannot_inline (gimple s, bool inlinable_p)
2104 {
2105   GIMPLE_CHECK (s, GIMPLE_CALL);
2106   if (inlinable_p)
2107     s->gsbase.subcode |= GF_CALL_CANNOT_INLINE;
2108   else
2109     s->gsbase.subcode &= ~GF_CALL_CANNOT_INLINE;
2110 }
2111
2112
2113 /* Return true if GIMPLE_CALL S cannot be inlined.  */
2114
2115 static inline bool
2116 gimple_call_cannot_inline_p (gimple s)
2117 {
2118   GIMPLE_CHECK (s, GIMPLE_CALL);
2119   return (s->gsbase.subcode & GF_CALL_CANNOT_INLINE) != 0;
2120 }
2121
2122
2123 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2124    slot optimization.  This transformation uses the target of the call
2125    expansion as the return slot for calls that return in memory.  */
2126
2127 static inline void
2128 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2129 {
2130   GIMPLE_CHECK (s, GIMPLE_CALL);
2131   if (return_slot_opt_p)
2132     s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
2133   else
2134     s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2135 }
2136
2137
2138 /* Return true if S is marked for return slot optimization.  */
2139
2140 static inline bool
2141 gimple_call_return_slot_opt_p (gimple s)
2142 {
2143   GIMPLE_CHECK (s, GIMPLE_CALL);
2144   return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2145 }
2146
2147
2148 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2149    thunk to the thunked-to function.  */
2150
2151 static inline void
2152 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2153 {
2154   GIMPLE_CHECK (s, GIMPLE_CALL);
2155   if (from_thunk_p)
2156     s->gsbase.subcode |= GF_CALL_FROM_THUNK;
2157   else
2158     s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
2159 }
2160
2161
2162 /* Return true if GIMPLE_CALL S is a jump from a thunk.  */
2163
2164 static inline bool
2165 gimple_call_from_thunk_p (gimple s)
2166 {
2167   GIMPLE_CHECK (s, GIMPLE_CALL);
2168   return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
2169 }
2170
2171
2172 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2173    argument pack in its argument list.  */
2174
2175 static inline void
2176 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2177 {
2178   GIMPLE_CHECK (s, GIMPLE_CALL);
2179   if (pass_arg_pack_p)
2180     s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
2181   else
2182     s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
2183 }
2184
2185
2186 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2187    argument pack in its argument list.  */
2188
2189 static inline bool
2190 gimple_call_va_arg_pack_p (gimple s)
2191 {
2192   GIMPLE_CHECK (s, GIMPLE_CALL);
2193   return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
2194 }
2195
2196
2197 /* Return true if S is a noreturn call.  */
2198
2199 static inline bool
2200 gimple_call_noreturn_p (gimple s)
2201 {
2202   GIMPLE_CHECK (s, GIMPLE_CALL);
2203   return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2204 }
2205
2206
2207 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2208    even if the called function can throw in other cases.  */
2209
2210 static inline void
2211 gimple_call_set_nothrow (gimple s, bool nothrow_p)
2212 {
2213   GIMPLE_CHECK (s, GIMPLE_CALL);
2214   if (nothrow_p)
2215     s->gsbase.subcode |= GF_CALL_NOTHROW;
2216   else
2217     s->gsbase.subcode &= ~GF_CALL_NOTHROW;
2218 }
2219
2220 /* Return true if S is a nothrow call.  */
2221
2222 static inline bool
2223 gimple_call_nothrow_p (gimple s)
2224 {
2225   GIMPLE_CHECK (s, GIMPLE_CALL);
2226   return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2227 }
2228
2229
2230 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL.  */
2231
2232 static inline void
2233 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2234 {
2235   GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2236   GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2237   dest_call->gsbase.subcode = orig_call->gsbase.subcode;
2238 }
2239
2240
2241 /* Return a pointer to the points-to solution for the set of call-used
2242    variables of the call CALL.  */
2243
2244 static inline struct pt_solution *
2245 gimple_call_use_set (gimple call)
2246 {
2247   GIMPLE_CHECK (call, GIMPLE_CALL);
2248   return &call->gimple_call.call_used;
2249 }
2250
2251
2252 /* Return a pointer to the points-to solution for the set of call-used
2253    variables of the call CALL.  */
2254
2255 static inline struct pt_solution *
2256 gimple_call_clobber_set (gimple call)
2257 {
2258   GIMPLE_CHECK (call, GIMPLE_CALL);
2259   return &call->gimple_call.call_clobbered;
2260 }
2261
2262
2263 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2264    non-NULL lhs.  */
2265
2266 static inline bool
2267 gimple_has_lhs (gimple stmt)
2268 {
2269   return (is_gimple_assign (stmt)
2270           || (is_gimple_call (stmt)
2271               && gimple_call_lhs (stmt) != NULL_TREE));
2272 }
2273
2274
2275 /* Return the code of the predicate computed by conditional statement GS.  */
2276
2277 static inline enum tree_code
2278 gimple_cond_code (const_gimple gs)
2279 {
2280   GIMPLE_CHECK (gs, GIMPLE_COND);
2281   return (enum tree_code) gs->gsbase.subcode;
2282 }
2283
2284
2285 /* Set CODE to be the predicate code for the conditional statement GS.  */
2286
2287 static inline void
2288 gimple_cond_set_code (gimple gs, enum tree_code code)
2289 {
2290   GIMPLE_CHECK (gs, GIMPLE_COND);
2291   gs->gsbase.subcode = code;
2292 }
2293
2294
2295 /* Return the LHS of the predicate computed by conditional statement GS.  */
2296
2297 static inline tree
2298 gimple_cond_lhs (const_gimple gs)
2299 {
2300   GIMPLE_CHECK (gs, GIMPLE_COND);
2301   return gimple_op (gs, 0);
2302 }
2303
2304 /* Return the pointer to the LHS of the predicate computed by conditional
2305    statement GS.  */
2306
2307 static inline tree *
2308 gimple_cond_lhs_ptr (const_gimple gs)
2309 {
2310   GIMPLE_CHECK (gs, GIMPLE_COND);
2311   return gimple_op_ptr (gs, 0);
2312 }
2313
2314 /* Set LHS to be the LHS operand of the predicate computed by
2315    conditional statement GS.  */
2316
2317 static inline void
2318 gimple_cond_set_lhs (gimple gs, tree lhs)
2319 {
2320   GIMPLE_CHECK (gs, GIMPLE_COND);
2321   gimple_set_op (gs, 0, lhs);
2322 }
2323
2324
2325 /* Return the RHS operand of the predicate computed by conditional GS.  */
2326
2327 static inline tree
2328 gimple_cond_rhs (const_gimple gs)
2329 {
2330   GIMPLE_CHECK (gs, GIMPLE_COND);
2331   return gimple_op (gs, 1);
2332 }
2333
2334 /* Return the pointer to the RHS operand of the predicate computed by
2335    conditional GS.  */
2336
2337 static inline tree *
2338 gimple_cond_rhs_ptr (const_gimple gs)
2339 {
2340   GIMPLE_CHECK (gs, GIMPLE_COND);
2341   return gimple_op_ptr (gs, 1);
2342 }
2343
2344
2345 /* Set RHS to be the RHS operand of the predicate computed by
2346    conditional statement GS.  */
2347
2348 static inline void
2349 gimple_cond_set_rhs (gimple gs, tree rhs)
2350 {
2351   GIMPLE_CHECK (gs, GIMPLE_COND);
2352   gimple_set_op (gs, 1, rhs);
2353 }
2354
2355
2356 /* Return the label used by conditional statement GS when its
2357    predicate evaluates to true.  */
2358
2359 static inline tree
2360 gimple_cond_true_label (const_gimple gs)
2361 {
2362   GIMPLE_CHECK (gs, GIMPLE_COND);
2363   return gimple_op (gs, 2);
2364 }
2365
2366
2367 /* Set LABEL to be the label used by conditional statement GS when its
2368    predicate evaluates to true.  */
2369
2370 static inline void
2371 gimple_cond_set_true_label (gimple gs, tree label)
2372 {
2373   GIMPLE_CHECK (gs, GIMPLE_COND);
2374   gimple_set_op (gs, 2, label);
2375 }
2376
2377
2378 /* Set LABEL to be the label used by conditional statement GS when its
2379    predicate evaluates to false.  */
2380
2381 static inline void
2382 gimple_cond_set_false_label (gimple gs, tree label)
2383 {
2384   GIMPLE_CHECK (gs, GIMPLE_COND);
2385   gimple_set_op (gs, 3, label);
2386 }
2387
2388
2389 /* Return the label used by conditional statement GS when its
2390    predicate evaluates to false.  */
2391
2392 static inline tree
2393 gimple_cond_false_label (const_gimple gs)
2394 {
2395   GIMPLE_CHECK (gs, GIMPLE_COND);
2396   return gimple_op (gs, 3);
2397 }
2398
2399
2400 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'.  */
2401
2402 static inline void
2403 gimple_cond_make_false (gimple gs)
2404 {
2405   gimple_cond_set_lhs (gs, boolean_true_node);
2406   gimple_cond_set_rhs (gs, boolean_false_node);
2407   gs->gsbase.subcode = EQ_EXPR;
2408 }
2409
2410
2411 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'.  */
2412
2413 static inline void
2414 gimple_cond_make_true (gimple gs)
2415 {
2416   gimple_cond_set_lhs (gs, boolean_true_node);
2417   gimple_cond_set_rhs (gs, boolean_true_node);
2418   gs->gsbase.subcode = EQ_EXPR;
2419 }
2420
2421 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2422   'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2423
2424 static inline bool
2425 gimple_cond_true_p (const_gimple gs)
2426 {
2427   tree lhs = gimple_cond_lhs (gs);
2428   tree rhs = gimple_cond_rhs (gs);
2429   enum tree_code code = gimple_cond_code (gs);
2430
2431   if (lhs != boolean_true_node && lhs != boolean_false_node)
2432     return false;
2433
2434   if (rhs != boolean_true_node && rhs != boolean_false_node)
2435     return false;
2436
2437   if (code == NE_EXPR && lhs != rhs)
2438     return true;
2439
2440   if (code == EQ_EXPR && lhs == rhs)
2441       return true;
2442
2443   return false;
2444 }
2445
2446 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2447    'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2448
2449 static inline bool
2450 gimple_cond_false_p (const_gimple gs)
2451 {
2452   tree lhs = gimple_cond_lhs (gs);
2453   tree rhs = gimple_cond_rhs (gs);
2454   enum tree_code code = gimple_cond_code (gs);
2455
2456   if (lhs != boolean_true_node && lhs != boolean_false_node)
2457     return false;
2458
2459   if (rhs != boolean_true_node && rhs != boolean_false_node)
2460     return false;
2461
2462   if (code == NE_EXPR && lhs == rhs)
2463     return true;
2464
2465   if (code == EQ_EXPR && lhs != rhs)
2466       return true;
2467
2468   return false;
2469 }
2470
2471 /* Check if conditional statement GS is of the form 'if (var != 0)' or
2472    'if (var == 1)' */
2473
2474 static inline bool
2475 gimple_cond_single_var_p (gimple gs)
2476 {
2477   if (gimple_cond_code (gs) == NE_EXPR
2478       && gimple_cond_rhs (gs) == boolean_false_node)
2479     return true;
2480
2481   if (gimple_cond_code (gs) == EQ_EXPR
2482       && gimple_cond_rhs (gs) == boolean_true_node)
2483     return true;
2484
2485   return false;
2486 }
2487
2488 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS.  */
2489
2490 static inline void
2491 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2492 {
2493   gimple_cond_set_code (stmt, code);
2494   gimple_cond_set_lhs (stmt, lhs);
2495   gimple_cond_set_rhs (stmt, rhs);
2496 }
2497
2498 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS.  */
2499
2500 static inline tree
2501 gimple_label_label (const_gimple gs)
2502 {
2503   GIMPLE_CHECK (gs, GIMPLE_LABEL);
2504   return gimple_op (gs, 0);
2505 }
2506
2507
2508 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2509    GS.  */
2510
2511 static inline void
2512 gimple_label_set_label (gimple gs, tree label)
2513 {
2514   GIMPLE_CHECK (gs, GIMPLE_LABEL);
2515   gimple_set_op (gs, 0, label);
2516 }
2517
2518
2519 /* Return the destination of the unconditional jump GS.  */
2520
2521 static inline tree
2522 gimple_goto_dest (const_gimple gs)
2523 {
2524   GIMPLE_CHECK (gs, GIMPLE_GOTO);
2525   return gimple_op (gs, 0);
2526 }
2527
2528
2529 /* Set DEST to be the destination of the unconditonal jump GS.  */
2530
2531 static inline void
2532 gimple_goto_set_dest (gimple gs, tree dest)
2533 {
2534   GIMPLE_CHECK (gs, GIMPLE_GOTO);
2535   gimple_set_op (gs, 0, dest);
2536 }
2537
2538
2539 /* Return the variables declared in the GIMPLE_BIND statement GS.  */
2540
2541 static inline tree
2542 gimple_bind_vars (const_gimple gs)
2543 {
2544   GIMPLE_CHECK (gs, GIMPLE_BIND);
2545   return gs->gimple_bind.vars;
2546 }
2547
2548
2549 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2550    statement GS.  */
2551
2552 static inline void
2553 gimple_bind_set_vars (gimple gs, tree vars)
2554 {
2555   GIMPLE_CHECK (gs, GIMPLE_BIND);
2556   gs->gimple_bind.vars = vars;
2557 }
2558
2559
2560 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2561    statement GS.  */
2562
2563 static inline void
2564 gimple_bind_append_vars (gimple gs, tree vars)
2565 {
2566   GIMPLE_CHECK (gs, GIMPLE_BIND);
2567   gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
2568 }
2569
2570
2571 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS.  */
2572
2573 static inline gimple_seq
2574 gimple_bind_body (gimple gs)
2575 {
2576   GIMPLE_CHECK (gs, GIMPLE_BIND);
2577   return gs->gimple_bind.body;
2578 }
2579
2580
2581 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
2582    statement GS.  */
2583
2584 static inline void
2585 gimple_bind_set_body (gimple gs, gimple_seq seq)
2586 {
2587   GIMPLE_CHECK (gs, GIMPLE_BIND);
2588   gs->gimple_bind.body = seq;
2589 }
2590
2591
2592 /* Append a statement to the end of a GIMPLE_BIND's body.  */
2593
2594 static inline void
2595 gimple_bind_add_stmt (gimple gs, gimple stmt)
2596 {
2597   GIMPLE_CHECK (gs, GIMPLE_BIND);
2598   gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
2599 }
2600
2601
2602 /* Append a sequence of statements to the end of a GIMPLE_BIND's body.  */
2603
2604 static inline void
2605 gimple_bind_add_seq (gimple gs, gimple_seq seq)
2606 {
2607   GIMPLE_CHECK (gs, GIMPLE_BIND);
2608   gimple_seq_add_seq (&gs->gimple_bind.body, seq);
2609 }
2610
2611
2612 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
2613    GS.  This is analogous to the BIND_EXPR_BLOCK field in trees.  */
2614
2615 static inline tree
2616 gimple_bind_block (const_gimple gs)
2617 {
2618   GIMPLE_CHECK (gs, GIMPLE_BIND);
2619   return gs->gimple_bind.block;
2620 }
2621
2622
2623 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
2624    statement GS.  */
2625
2626 static inline void
2627 gimple_bind_set_block (gimple gs, tree block)
2628 {
2629   GIMPLE_CHECK (gs, GIMPLE_BIND);
2630   gcc_gimple_checking_assert (block == NULL_TREE
2631                               || TREE_CODE (block) == BLOCK);
2632   gs->gimple_bind.block = block;
2633 }
2634
2635
2636 /* Return the number of input operands for GIMPLE_ASM GS.  */
2637
2638 static inline unsigned
2639 gimple_asm_ninputs (const_gimple gs)
2640 {
2641   GIMPLE_CHECK (gs, GIMPLE_ASM);
2642   return gs->gimple_asm.ni;
2643 }
2644
2645
2646 /* Return the number of output operands for GIMPLE_ASM GS.  */
2647
2648 static inline unsigned
2649 gimple_asm_noutputs (const_gimple gs)
2650 {
2651   GIMPLE_CHECK (gs, GIMPLE_ASM);
2652   return gs->gimple_asm.no;
2653 }
2654
2655
2656 /* Return the number of clobber operands for GIMPLE_ASM GS.  */
2657
2658 static inline unsigned
2659 gimple_asm_nclobbers (const_gimple gs)
2660 {
2661   GIMPLE_CHECK (gs, GIMPLE_ASM);
2662   return gs->gimple_asm.nc;
2663 }
2664
2665 /* Return the number of label operands for GIMPLE_ASM GS.  */
2666
2667 static inline unsigned
2668 gimple_asm_nlabels (const_gimple gs)
2669 {
2670   GIMPLE_CHECK (gs, GIMPLE_ASM);
2671   return gs->gimple_asm.nl;
2672 }
2673
2674 /* Return input operand INDEX of GIMPLE_ASM GS.  */
2675
2676 static inline tree
2677 gimple_asm_input_op (const_gimple gs, unsigned index)
2678 {
2679   GIMPLE_CHECK (gs, GIMPLE_ASM);
2680   gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
2681   return gimple_op (gs, index);
2682 }
2683
2684 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS.  */
2685
2686 static inline tree *
2687 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
2688 {
2689   GIMPLE_CHECK (gs, GIMPLE_ASM);
2690   gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
2691   return gimple_op_ptr (gs, index);
2692 }
2693
2694
2695 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS.  */
2696
2697 static inline void
2698 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
2699 {
2700   GIMPLE_CHECK (gs, GIMPLE_ASM);
2701   gcc_gimple_checking_assert (index <= gs->gimple_asm.ni
2702                               && TREE_CODE (in_op) == TREE_LIST);
2703   gimple_set_op (gs, index, in_op);
2704 }
2705
2706
2707 /* Return output operand INDEX of GIMPLE_ASM GS.  */
2708
2709 static inline tree
2710 gimple_asm_output_op (const_gimple gs, unsigned index)
2711 {
2712   GIMPLE_CHECK (gs, GIMPLE_ASM);
2713   gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
2714   return gimple_op (gs, index + gs->gimple_asm.ni);
2715 }
2716
2717 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS.  */
2718
2719 static inline tree *
2720 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
2721 {
2722   GIMPLE_CHECK (gs, GIMPLE_ASM);
2723   gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
2724   return gimple_op_ptr (gs, index + gs->gimple_asm.ni);
2725 }
2726
2727
2728 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS.  */
2729
2730 static inline void
2731 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
2732 {
2733   GIMPLE_CHECK (gs, GIMPLE_ASM);
2734   gcc_gimple_checking_assert (index <= gs->gimple_asm.no
2735                               && TREE_CODE (out_op) == TREE_LIST);
2736   gimple_set_op (gs, index + gs->gimple_asm.ni, out_op);
2737 }
2738
2739
2740 /* Return clobber operand INDEX of GIMPLE_ASM GS.  */
2741
2742 static inline tree
2743 gimple_asm_clobber_op (const_gimple gs, unsigned index)
2744 {
2745   GIMPLE_CHECK (gs, GIMPLE_ASM);
2746   gcc_gimple_checking_assert (index <= gs->gimple_asm.nc);
2747   return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
2748 }
2749
2750
2751 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS.  */
2752
2753 static inline void
2754 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
2755 {
2756   GIMPLE_CHECK (gs, GIMPLE_ASM);
2757   gcc_gimple_checking_assert (index <= gs->gimple_asm.nc
2758                               && TREE_CODE (clobber_op) == TREE_LIST);
2759   gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
2760 }
2761
2762 /* Return label operand INDEX of GIMPLE_ASM GS.  */
2763
2764 static inline tree
2765 gimple_asm_label_op (const_gimple gs, unsigned index)
2766 {
2767   GIMPLE_CHECK (gs, GIMPLE_ASM);
2768   gcc_gimple_checking_assert (index <= gs->gimple_asm.nl);
2769   return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
2770 }
2771
2772 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS.  */
2773
2774 static inline void
2775 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
2776 {
2777   GIMPLE_CHECK (gs, GIMPLE_ASM);
2778   gcc_gimple_checking_assert (index <= gs->gimple_asm.nl
2779                               && TREE_CODE (label_op) == TREE_LIST);
2780   gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
2781 }
2782
2783 /* Return the string representing the assembly instruction in
2784    GIMPLE_ASM GS.  */
2785
2786 static inline const char *
2787 gimple_asm_string (const_gimple gs)
2788 {
2789   GIMPLE_CHECK (gs, GIMPLE_ASM);
2790   return gs->gimple_asm.string;
2791 }
2792
2793
2794 /* Return true if GS is an asm statement marked volatile.  */
2795
2796 static inline bool
2797 gimple_asm_volatile_p (const_gimple gs)
2798 {
2799   GIMPLE_CHECK (gs, GIMPLE_ASM);
2800   return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
2801 }
2802
2803
2804 /* If VOLATLE_P is true, mark asm statement GS as volatile.  */
2805
2806 static inline void
2807 gimple_asm_set_volatile (gimple gs, bool volatile_p)
2808 {
2809   GIMPLE_CHECK (gs, GIMPLE_ASM);
2810   if (volatile_p)
2811     gs->gsbase.subcode |= GF_ASM_VOLATILE;
2812   else
2813     gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
2814 }
2815
2816
2817 /* If INPUT_P is true, mark asm GS as an ASM_INPUT.  */
2818
2819 static inline void
2820 gimple_asm_set_input (gimple gs, bool input_p)
2821 {
2822   GIMPLE_CHECK (gs, GIMPLE_ASM);
2823   if (input_p)
2824     gs->gsbase.subcode |= GF_ASM_INPUT;
2825   else
2826     gs->gsbase.subcode &= ~GF_ASM_INPUT;
2827 }
2828
2829
2830 /* Return true if asm GS is an ASM_INPUT.  */
2831
2832 static inline bool
2833 gimple_asm_input_p (const_gimple gs)
2834 {
2835   GIMPLE_CHECK (gs, GIMPLE_ASM);
2836   return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
2837 }
2838
2839
2840 /* Return the types handled by GIMPLE_CATCH statement GS.  */
2841
2842 static inline tree
2843 gimple_catch_types (const_gimple gs)
2844 {
2845   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2846   return gs->gimple_catch.types;
2847 }
2848
2849
2850 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS.  */
2851
2852 static inline tree *
2853 gimple_catch_types_ptr (gimple gs)
2854 {
2855   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2856   return &gs->gimple_catch.types;
2857 }
2858
2859
2860 /* Return the GIMPLE sequence representing the body of the handler of
2861    GIMPLE_CATCH statement GS.  */
2862
2863 static inline gimple_seq
2864 gimple_catch_handler (gimple gs)
2865 {
2866   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2867   return gs->gimple_catch.handler;
2868 }
2869
2870
2871 /* Return a pointer to the GIMPLE sequence representing the body of
2872    the handler of GIMPLE_CATCH statement GS.  */
2873
2874 static inline gimple_seq *
2875 gimple_catch_handler_ptr (gimple gs)
2876 {
2877   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2878   return &gs->gimple_catch.handler;
2879 }
2880
2881
2882 /* Set T to be the set of types handled by GIMPLE_CATCH GS.  */
2883
2884 static inline void
2885 gimple_catch_set_types (gimple gs, tree t)
2886 {
2887   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2888   gs->gimple_catch.types = t;
2889 }
2890
2891
2892 /* Set HANDLER to be the body of GIMPLE_CATCH GS.  */
2893
2894 static inline void
2895 gimple_catch_set_handler (gimple gs, gimple_seq handler)
2896 {
2897   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2898   gs->gimple_catch.handler = handler;
2899 }
2900
2901
2902 /* Return the types handled by GIMPLE_EH_FILTER statement GS.  */
2903
2904 static inline tree
2905 gimple_eh_filter_types (const_gimple gs)
2906 {
2907   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2908   return gs->gimple_eh_filter.types;
2909 }
2910
2911
2912 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
2913    GS.  */
2914
2915 static inline tree *
2916 gimple_eh_filter_types_ptr (gimple gs)
2917 {
2918   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2919   return &gs->gimple_eh_filter.types;
2920 }
2921
2922
2923 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
2924    statement fails.  */
2925
2926 static inline gimple_seq
2927 gimple_eh_filter_failure (gimple gs)
2928 {
2929   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2930   return gs->gimple_eh_filter.failure;
2931 }
2932
2933
2934 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS.  */
2935
2936 static inline void
2937 gimple_eh_filter_set_types (gimple gs, tree types)
2938 {
2939   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2940   gs->gimple_eh_filter.types = types;
2941 }
2942
2943
2944 /* Set FAILURE to be the sequence of statements to execute on failure
2945    for GIMPLE_EH_FILTER GS.  */
2946
2947 static inline void
2948 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
2949 {
2950   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2951   gs->gimple_eh_filter.failure = failure;
2952 }
2953
2954 /* Get the function decl to be called by the MUST_NOT_THROW region.  */
2955
2956 static inline tree
2957 gimple_eh_must_not_throw_fndecl (gimple gs)
2958 {
2959   GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
2960   return gs->gimple_eh_mnt.fndecl;
2961 }
2962
2963 /* Set the function decl to be called by GS to DECL.  */
2964
2965 static inline void
2966 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
2967 {
2968   GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
2969   gs->gimple_eh_mnt.fndecl = decl;
2970 }
2971
2972
2973 /* GIMPLE_TRY accessors. */
2974
2975 /* Return the kind of try block represented by GIMPLE_TRY GS.  This is
2976    either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY.  */
2977
2978 static inline enum gimple_try_flags
2979 gimple_try_kind (const_gimple gs)
2980 {
2981   GIMPLE_CHECK (gs, GIMPLE_TRY);
2982   return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
2983 }
2984
2985
2986 /* Set the kind of try block represented by GIMPLE_TRY GS.  */
2987
2988 static inline void
2989 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
2990 {
2991   GIMPLE_CHECK (gs, GIMPLE_TRY);
2992   gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
2993                               || kind == GIMPLE_TRY_FINALLY);
2994   if (gimple_try_kind (gs) != kind)
2995     gs->gsbase.subcode = (unsigned int) kind;
2996 }
2997
2998
2999 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag.  */
3000
3001 static inline bool
3002 gimple_try_catch_is_cleanup (const_gimple gs)
3003 {
3004   gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
3005   return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3006 }
3007
3008
3009 /* Return the sequence of statements used as the body for GIMPLE_TRY GS.  */
3010
3011 static inline gimple_seq
3012 gimple_try_eval (gimple gs)
3013 {
3014   GIMPLE_CHECK (gs, GIMPLE_TRY);
3015   return gs->gimple_try.eval;
3016 }
3017
3018
3019 /* Return the sequence of statements used as the cleanup body for
3020    GIMPLE_TRY GS.  */
3021
3022 static inline gimple_seq
3023 gimple_try_cleanup (gimple gs)
3024 {
3025   GIMPLE_CHECK (gs, GIMPLE_TRY);
3026   return gs->gimple_try.cleanup;
3027 }
3028
3029
3030 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag.  */
3031
3032 static inline void
3033 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3034 {
3035   gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3036   if (catch_is_cleanup)
3037     g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3038   else
3039     g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3040 }
3041
3042
3043 /* Set EVAL to be the sequence of statements to use as the body for
3044    GIMPLE_TRY GS.  */
3045
3046 static inline void
3047 gimple_try_set_eval (gimple gs, gimple_seq eval)
3048 {
3049   GIMPLE_CHECK (gs, GIMPLE_TRY);
3050   gs->gimple_try.eval = eval;
3051 }
3052
3053
3054 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3055    body for GIMPLE_TRY GS.  */
3056
3057 static inline void
3058 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3059 {
3060   GIMPLE_CHECK (gs, GIMPLE_TRY);
3061   gs->gimple_try.cleanup = cleanup;
3062 }
3063
3064
3065 /* Return the cleanup sequence for cleanup statement GS.  */
3066
3067 static inline gimple_seq
3068 gimple_wce_cleanup (gimple gs)
3069 {
3070   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3071   return gs->gimple_wce.cleanup;
3072 }
3073
3074
3075 /* Set CLEANUP to be the cleanup sequence for GS.  */
3076
3077 static inline void
3078 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3079 {
3080   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3081   gs->gimple_wce.cleanup = cleanup;
3082 }
3083
3084
3085 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple.  */
3086
3087 static inline bool
3088 gimple_wce_cleanup_eh_only (const_gimple gs)
3089 {
3090   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3091   return gs->gsbase.subcode != 0;
3092 }
3093
3094
3095 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple.  */
3096
3097 static inline void
3098 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3099 {
3100   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3101   gs->gsbase.subcode = (unsigned int) eh_only_p;
3102 }
3103
3104
3105 /* Return the maximum number of arguments supported by GIMPLE_PHI GS.  */
3106
3107 static inline unsigned
3108 gimple_phi_capacity (const_gimple gs)
3109 {
3110   GIMPLE_CHECK (gs, GIMPLE_PHI);
3111   return gs->gimple_phi.capacity;
3112 }
3113
3114
3115 /* Return the number of arguments in GIMPLE_PHI GS.  This must always
3116    be exactly the number of incoming edges for the basic block holding
3117    GS.  */
3118
3119 static inline unsigned
3120 gimple_phi_num_args (const_gimple gs)
3121 {
3122   GIMPLE_CHECK (gs, GIMPLE_PHI);
3123   return gs->gimple_phi.nargs;
3124 }
3125
3126
3127 /* Return the SSA name created by GIMPLE_PHI GS.  */
3128
3129 static inline tree
3130 gimple_phi_result (const_gimple gs)
3131 {
3132   GIMPLE_CHECK (gs, GIMPLE_PHI);
3133   return gs->gimple_phi.result;
3134 }
3135
3136 /* Return a pointer to the SSA name created by GIMPLE_PHI GS.  */
3137
3138 static inline tree *
3139 gimple_phi_result_ptr (gimple gs)
3140 {
3141   GIMPLE_CHECK (gs, GIMPLE_PHI);
3142   return &gs->gimple_phi.result;
3143 }
3144
3145 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS.  */
3146
3147 static inline void
3148 gimple_phi_set_result (gimple gs, tree result)
3149 {
3150   GIMPLE_CHECK (gs, GIMPLE_PHI);
3151   gs->gimple_phi.result = result;
3152 }
3153
3154
3155 /* Return the PHI argument corresponding to incoming edge INDEX for
3156    GIMPLE_PHI GS.  */
3157
3158 static inline struct phi_arg_d *
3159 gimple_phi_arg (gimple gs, unsigned index)
3160 {
3161   GIMPLE_CHECK (gs, GIMPLE_PHI);
3162   gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
3163   return &(gs->gimple_phi.args[index]);
3164 }
3165
3166 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3167    for GIMPLE_PHI GS.  */
3168
3169 static inline void
3170 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3171 {
3172   GIMPLE_CHECK (gs, GIMPLE_PHI);
3173   gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
3174   gs->gimple_phi.args[index] = *phiarg;
3175 }
3176
3177 /* Return the region number for GIMPLE_RESX GS.  */
3178
3179 static inline int
3180 gimple_resx_region (const_gimple gs)
3181 {
3182   GIMPLE_CHECK (gs, GIMPLE_RESX);
3183   return gs->gimple_eh_ctrl.region;
3184 }
3185
3186 /* Set REGION to be the region number for GIMPLE_RESX GS.  */
3187
3188 static inline void
3189 gimple_resx_set_region (gimple gs, int region)
3190 {
3191   GIMPLE_CHECK (gs, GIMPLE_RESX);
3192   gs->gimple_eh_ctrl.region = region;
3193 }
3194
3195 /* Return the region number for GIMPLE_EH_DISPATCH GS.  */
3196
3197 static inline int
3198 gimple_eh_dispatch_region (const_gimple gs)
3199 {
3200   GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3201   return gs->gimple_eh_ctrl.region;
3202 }
3203
3204 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS.  */
3205
3206 static inline void
3207 gimple_eh_dispatch_set_region (gimple gs, int region)
3208 {
3209   GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3210   gs->gimple_eh_ctrl.region = region;
3211 }
3212
3213 /* Return the number of labels associated with the switch statement GS.  */
3214
3215 static inline unsigned
3216 gimple_switch_num_labels (const_gimple gs)
3217 {
3218   unsigned num_ops;
3219   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3220   num_ops = gimple_num_ops (gs);
3221   gcc_gimple_checking_assert (num_ops > 1);
3222   return num_ops - 1;
3223 }
3224
3225
3226 /* Set NLABELS to be the number of labels for the switch statement GS.  */
3227
3228 static inline void
3229 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3230 {
3231   GIMPLE_CHECK (g, GIMPLE_SWITCH);
3232   gimple_set_num_ops (g, nlabels + 1);
3233 }
3234
3235
3236 /* Return the index variable used by the switch statement GS.  */
3237
3238 static inline tree
3239 gimple_switch_index (const_gimple gs)
3240 {
3241   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3242   return gimple_op (gs, 0);
3243 }
3244
3245
3246 /* Return a pointer to the index variable for the switch statement GS.  */
3247
3248 static inline tree *
3249 gimple_switch_index_ptr (const_gimple gs)
3250 {
3251   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3252   return gimple_op_ptr (gs, 0);
3253 }
3254
3255
3256 /* Set INDEX to be the index variable for switch statement GS.  */
3257
3258 static inline void
3259 gimple_switch_set_index (gimple gs, tree index)
3260 {
3261   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3262   gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3263   gimple_set_op (gs, 0, index);
3264 }
3265
3266
3267 /* Return the label numbered INDEX.  The default label is 0, followed by any
3268    labels in a switch statement.  */
3269
3270 static inline tree
3271 gimple_switch_label (const_gimple gs, unsigned index)
3272 {
3273   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3274   gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
3275   return gimple_op (gs, index + 1);
3276 }
3277
3278 /* Set the label number INDEX to LABEL.  0 is always the default label.  */
3279
3280 static inline void
3281 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3282 {
3283   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3284   gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
3285                               && (label == NULL_TREE
3286                                   || TREE_CODE (label) == CASE_LABEL_EXPR));
3287   gimple_set_op (gs, index + 1, label);
3288 }
3289
3290 /* Return the default label for a switch statement.  */
3291
3292 static inline tree
3293 gimple_switch_default_label (const_gimple gs)
3294 {
3295   return gimple_switch_label (gs, 0);
3296 }
3297
3298 /* Set the default label for a switch statement.  */
3299
3300 static inline void
3301 gimple_switch_set_default_label (gimple gs, tree label)
3302 {
3303   gimple_switch_set_label (gs, 0, label);
3304 }
3305
3306 /* Return true if GS is a GIMPLE_DEBUG statement.  */
3307
3308 static inline bool
3309 is_gimple_debug (const_gimple gs)
3310 {
3311   return gimple_code (gs) == GIMPLE_DEBUG;
3312 }
3313
3314 /* Return true if S is a GIMPLE_DEBUG BIND statement.  */
3315
3316 static inline bool
3317 gimple_debug_bind_p (const_gimple s)
3318 {
3319   if (is_gimple_debug (s))
3320     return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
3321
3322   return false;
3323 }
3324
3325 /* Return the variable bound in a GIMPLE_DEBUG bind statement.  */
3326
3327 static inline tree
3328 gimple_debug_bind_get_var (gimple dbg)
3329 {
3330   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3331   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3332   return gimple_op (dbg, 0);
3333 }
3334
3335 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3336    statement.  */
3337
3338 static inline tree
3339 gimple_debug_bind_get_value (gimple dbg)
3340 {
3341   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3342   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3343   return gimple_op (dbg, 1);
3344 }
3345
3346 /* Return a pointer to the value bound to the variable in a
3347    GIMPLE_DEBUG bind statement.  */
3348
3349 static inline tree *
3350 gimple_debug_bind_get_value_ptr (gimple dbg)
3351 {
3352   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3353   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3354   return gimple_op_ptr (dbg, 1);
3355 }
3356
3357 /* Set the variable bound in a GIMPLE_DEBUG bind statement.  */
3358
3359 static inline void
3360 gimple_debug_bind_set_var (gimple dbg, tree var)
3361 {
3362   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3363   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3364   gimple_set_op (dbg, 0, var);
3365 }
3366
3367 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3368    statement.  */
3369
3370 static inline void
3371 gimple_debug_bind_set_value (gimple dbg, tree value)
3372 {
3373   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3374   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3375   gimple_set_op (dbg, 1, value);
3376 }
3377
3378 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
3379    optimized away.  */
3380 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
3381
3382 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
3383    statement.  */
3384
3385 static inline void
3386 gimple_debug_bind_reset_value (gimple dbg)
3387 {
3388   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3389   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3390   gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
3391 }
3392
3393 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
3394    value.  */
3395
3396 static inline bool
3397 gimple_debug_bind_has_value_p (gimple dbg)
3398 {
3399   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3400   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3401   return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
3402 }
3403
3404 #undef GIMPLE_DEBUG_BIND_NOVALUE
3405
3406 /* Return the body for the OMP statement GS.  */
3407
3408 static inline gimple_seq
3409 gimple_omp_body (gimple gs)
3410 {
3411   return gs->omp.body;
3412 }
3413
3414 /* Set BODY to be the body for the OMP statement GS.  */
3415
3416 static inline void
3417 gimple_omp_set_body (gimple gs, gimple_seq body)
3418 {
3419   gs->omp.body = body;
3420 }
3421
3422
3423 /* Return the name associated with OMP_CRITICAL statement GS.  */
3424
3425 static inline tree
3426 gimple_omp_critical_name (const_gimple gs)
3427 {
3428   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3429   return gs->gimple_omp_critical.name;
3430 }
3431
3432
3433 /* Return a pointer to the name associated with OMP critical statement GS.  */
3434
3435 static inline tree *
3436 gimple_omp_critical_name_ptr (gimple gs)
3437 {
3438   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3439   return &gs->gimple_omp_critical.name;
3440 }
3441
3442
3443 /* Set NAME to be the name associated with OMP critical statement GS.  */
3444
3445 static inline void
3446 gimple_omp_critical_set_name (gimple gs, tree name)
3447 {
3448   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3449   gs->gimple_omp_critical.name = name;
3450 }
3451
3452
3453 /* Return the clauses associated with OMP_FOR GS.  */
3454
3455 static inline tree
3456 gimple_omp_for_clauses (const_gimple gs)
3457 {
3458   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3459   return gs->gimple_omp_for.clauses;
3460 }
3461
3462
3463 /* Return a pointer to the OMP_FOR GS.  */
3464
3465 static inline tree *
3466 gimple_omp_for_clauses_ptr (gimple gs)
3467 {
3468   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3469   return &gs->gimple_omp_for.clauses;
3470 }
3471
3472
3473 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS.  */
3474
3475 static inline void
3476 gimple_omp_for_set_clauses (gimple gs, tree clauses)
3477 {
3478   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3479   gs->gimple_omp_for.clauses = clauses;
3480 }
3481
3482
3483 /* Get the collapse count of OMP_FOR GS.  */
3484
3485 static inline size_t
3486 gimple_omp_for_collapse (gimple gs)
3487 {
3488   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3489   return gs->gimple_omp_for.collapse;
3490 }
3491
3492
3493 /* Return the index variable for OMP_FOR GS.  */
3494
3495 static inline tree
3496 gimple_omp_for_index (const_gimple gs, size_t i)
3497 {
3498   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3499   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3500   return gs->gimple_omp_for.iter[i].index;
3501 }
3502
3503
3504 /* Return a pointer to the index variable for OMP_FOR GS.  */
3505
3506 static inline tree *
3507 gimple_omp_for_index_ptr (gimple gs, size_t i)
3508 {
3509   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3510   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3511   return &gs->gimple_omp_for.iter[i].index;
3512 }
3513
3514
3515 /* Set INDEX to be the index variable for OMP_FOR GS.  */
3516
3517 static inline void
3518 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
3519 {
3520   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3521   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3522   gs->gimple_omp_for.iter[i].index = index;
3523 }
3524
3525
3526 /* Return the initial value for OMP_FOR GS.  */
3527
3528 static inline tree
3529 gimple_omp_for_initial (const_gimple gs, size_t i)
3530 {
3531   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3532   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3533   return gs->gimple_omp_for.iter[i].initial;
3534 }
3535
3536
3537 /* Return a pointer to the initial value for OMP_FOR GS.  */
3538
3539 static inline tree *
3540 gimple_omp_for_initial_ptr (gimple gs, size_t i)
3541 {
3542   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3543   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3544   return &gs->gimple_omp_for.iter[i].initial;
3545 }
3546
3547
3548 /* Set INITIAL to be the initial value for OMP_FOR GS.  */
3549
3550 static inline void
3551 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
3552 {
3553   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3554   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3555   gs->gimple_omp_for.iter[i].initial = initial;
3556 }
3557
3558
3559 /* Return the final value for OMP_FOR GS.  */
3560
3561 static inline tree
3562 gimple_omp_for_final (const_gimple gs, size_t i)
3563 {
3564   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3565   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3566   return gs->gimple_omp_for.iter[i].final;
3567 }
3568
3569
3570 /* Return a pointer to the final value for OMP_FOR GS.  */
3571
3572 static inline tree *
3573 gimple_omp_for_final_ptr (gimple gs, size_t i)
3574 {
3575   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3576   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3577   return &gs->gimple_omp_for.iter[i].final;
3578 }
3579
3580
3581 /* Set FINAL to be the final value for OMP_FOR GS.  */
3582
3583 static inline void
3584 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
3585 {
3586   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3587   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3588   gs->gimple_omp_for.iter[i].final = final;
3589 }
3590
3591
3592 /* Return the increment value for OMP_FOR GS.  */
3593
3594 static inline tree
3595 gimple_omp_for_incr (const_gimple gs, size_t i)
3596 {
3597   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3598   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3599   return gs->gimple_omp_for.iter[i].incr;
3600 }
3601
3602
3603 /* Return a pointer to the increment value for OMP_FOR GS.  */
3604
3605 static inline tree *
3606 gimple_omp_for_incr_ptr (gimple gs, size_t i)
3607 {
3608   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3609   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3610   return &gs->gimple_omp_for.iter[i].incr;
3611 }
3612
3613
3614 /* Set INCR to be the increment value for OMP_FOR GS.  */
3615
3616 static inline void
3617 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
3618 {
3619   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3620   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3621   gs->gimple_omp_for.iter[i].incr = incr;
3622 }
3623
3624
3625 /* Return the sequence of statements to execute before the OMP_FOR
3626    statement GS starts.  */
3627
3628 static inline gimple_seq
3629 gimple_omp_for_pre_body (gimple gs)
3630 {
3631   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3632   return gs->gimple_omp_for.pre_body;
3633 }
3634
3635
3636 /* Set PRE_BODY to be the sequence of statements to execute before the
3637    OMP_FOR statement GS starts.  */
3638
3639 static inline void
3640 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
3641 {
3642   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3643   gs->gimple_omp_for.pre_body = pre_body;
3644 }
3645
3646
3647 /* Return the clauses associated with OMP_PARALLEL GS.  */
3648
3649 static inline tree
3650 gimple_omp_parallel_clauses (const_gimple gs)
3651 {
3652   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3653   return gs->gimple_omp_parallel.clauses;
3654 }
3655
3656
3657 /* Return a pointer to the clauses associated with OMP_PARALLEL GS.  */
3658
3659 static inline tree *
3660 gimple_omp_parallel_clauses_ptr (gimple gs)
3661 {
3662   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3663   return &gs->gimple_omp_parallel.clauses;
3664 }
3665
3666
3667 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
3668    GS.  */
3669
3670 static inline void
3671 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
3672 {
3673   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3674   gs->gimple_omp_parallel.clauses = clauses;
3675 }
3676
3677
3678 /* Return the child function used to hold the body of OMP_PARALLEL GS.  */
3679
3680 static inline tree
3681 gimple_omp_parallel_child_fn (const_gimple gs)
3682 {
3683   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3684   return gs->gimple_omp_parallel.child_fn;
3685 }
3686
3687 /* Return a pointer to the child function used to hold the body of
3688    OMP_PARALLEL GS.  */
3689
3690 static inline tree *
3691 gimple_omp_parallel_child_fn_ptr (gimple gs)
3692 {
3693   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3694   return &gs->gimple_omp_parallel.child_fn;
3695 }
3696
3697
3698 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS.  */
3699
3700 static inline void
3701 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
3702 {
3703   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3704   gs->gimple_omp_parallel.child_fn = child_fn;
3705 }
3706
3707
3708 /* Return the artificial argument used to send variables and values
3709    from the parent to the children threads in OMP_PARALLEL GS.  */
3710
3711 static inline tree
3712 gimple_omp_parallel_data_arg (const_gimple gs)
3713 {
3714   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3715   return gs->gimple_omp_parallel.data_arg;
3716 }
3717
3718
3719 /* Return a pointer to the data argument for OMP_PARALLEL GS.  */
3720
3721 static inline tree *
3722 gimple_omp_parallel_data_arg_ptr (gimple gs)
3723 {
3724   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3725   return &gs->gimple_omp_parallel.data_arg;
3726 }
3727
3728
3729 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS.  */
3730
3731 static inline void
3732 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
3733 {
3734   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3735   gs->gimple_omp_parallel.data_arg = data_arg;
3736 }
3737
3738
3739 /* Return the clauses associated with OMP_TASK GS.  */
3740
3741 static inline tree
3742 gimple_omp_task_clauses (const_gimple gs)
3743 {
3744   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3745   return gs->gimple_omp_parallel.clauses;
3746 }
3747
3748
3749 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
3750
3751 static inline tree *
3752 gimple_omp_task_clauses_ptr (gimple gs)
3753 {
3754   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3755   return &gs->gimple_omp_parallel.clauses;
3756 }
3757
3758
3759 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
3760    GS.  */
3761
3762 static inline void
3763 gimple_omp_task_set_clauses (gimple gs, tree clauses)
3764 {
3765   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3766   gs->gimple_omp_parallel.clauses = clauses;
3767 }
3768
3769
3770 /* Return the child function used to hold the body of OMP_TASK GS.  */
3771
3772 static inline tree
3773 gimple_omp_task_child_fn (const_gimple gs)
3774 {
3775   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3776   return gs->gimple_omp_parallel.child_fn;
3777 }
3778
3779 /* Return a pointer to the child function used to hold the body of
3780    OMP_TASK GS.  */
3781
3782 static inline tree *
3783 gimple_omp_task_child_fn_ptr (gimple gs)
3784 {
3785   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3786   return &gs->gimple_omp_parallel.child_fn;
3787 }
3788
3789
3790 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
3791
3792 static inline void
3793 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
3794 {
3795   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3796   gs->gimple_omp_parallel.child_fn = child_fn;
3797 }
3798
3799
3800 /* Return the artificial argument used to send variables and values
3801    from the parent to the children threads in OMP_TASK GS.  */
3802
3803 static inline tree
3804 gimple_omp_task_data_arg (const_gimple gs)
3805 {
3806   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3807   return gs->gimple_omp_parallel.data_arg;
3808 }
3809
3810
3811 /* Return a pointer to the data argument for OMP_TASK GS.  */
3812
3813 static inline tree *
3814 gimple_omp_task_data_arg_ptr (gimple gs)
3815 {
3816   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3817   return &gs->gimple_omp_parallel.data_arg;
3818 }
3819
3820
3821 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
3822
3823 static inline void
3824 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
3825 {
3826   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3827   gs->gimple_omp_parallel.data_arg = data_arg;
3828 }
3829
3830
3831 /* Return the clauses associated with OMP_TASK GS.  */
3832
3833 static inline tree
3834 gimple_omp_taskreg_clauses (const_gimple gs)
3835 {
3836   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3837     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3838   return gs->gimple_omp_parallel.clauses;
3839 }
3840
3841
3842 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
3843
3844 static inline tree *
3845 gimple_omp_taskreg_clauses_ptr (gimple gs)
3846 {
3847   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3848     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3849   return &gs->gimple_omp_parallel.clauses;
3850 }
3851
3852
3853 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
3854    GS.  */
3855
3856 static inline void
3857 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
3858 {
3859   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3860     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3861   gs->gimple_omp_parallel.clauses = clauses;
3862 }
3863
3864
3865 /* Return the child function used to hold the body of OMP_TASK GS.  */
3866
3867 static inline tree
3868 gimple_omp_taskreg_child_fn (const_gimple gs)
3869 {
3870   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3871     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3872   return gs->gimple_omp_parallel.child_fn;
3873 }
3874
3875 /* Return a pointer to the child function used to hold the body of
3876    OMP_TASK GS.  */
3877
3878 static inline tree *
3879 gimple_omp_taskreg_child_fn_ptr (gimple gs)
3880 {
3881   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3882     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3883   return &gs->gimple_omp_parallel.child_fn;
3884 }
3885
3886
3887 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
3888
3889 static inline void
3890 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
3891 {
3892   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3893     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3894   gs->gimple_omp_parallel.child_fn = child_fn;
3895 }
3896
3897
3898 /* Return the artificial argument used to send variables and values
3899    from the parent to the children threads in OMP_TASK GS.  */
3900
3901 static inline tree
3902 gimple_omp_taskreg_data_arg (const_gimple gs)
3903 {
3904   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3905     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3906   return gs->gimple_omp_parallel.data_arg;
3907 }
3908
3909
3910 /* Return a pointer to the data argument for OMP_TASK GS.  */
3911
3912 static inline tree *
3913 gimple_omp_taskreg_data_arg_ptr (gimple gs)
3914 {
3915   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3916     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3917   return &gs->gimple_omp_parallel.data_arg;
3918 }
3919
3920
3921 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
3922
3923 static inline void
3924 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
3925 {
3926   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3927     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3928   gs->gimple_omp_parallel.data_arg = data_arg;
3929 }
3930
3931
3932 /* Return the copy function used to hold the body of OMP_TASK GS.  */
3933
3934 static inline tree
3935 gimple_omp_task_copy_fn (const_gimple gs)
3936 {
3937   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3938   return gs->gimple_omp_task.copy_fn;
3939 }
3940
3941 /* Return a pointer to the copy function used to hold the body of
3942    OMP_TASK GS.  */
3943
3944 static inline tree *
3945 gimple_omp_task_copy_fn_ptr (gimple gs)
3946 {
3947   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3948   return &gs->gimple_omp_task.copy_fn;
3949 }
3950
3951
3952 /* Set CHILD_FN to be the copy function for OMP_TASK GS.  */
3953
3954 static inline void
3955 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
3956 {
3957   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3958   gs->gimple_omp_task.copy_fn = copy_fn;
3959 }
3960
3961
3962 /* Return size of the data block in bytes in OMP_TASK GS.  */
3963
3964 static inline tree
3965 gimple_omp_task_arg_size (const_gimple gs)
3966 {
3967   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3968   return gs->gimple_omp_task.arg_size;
3969 }
3970
3971
3972 /* Return a pointer to the data block size for OMP_TASK GS.  */
3973
3974 static inline tree *
3975 gimple_omp_task_arg_size_ptr (gimple gs)
3976 {
3977   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3978   return &gs->gimple_omp_task.arg_size;
3979 }
3980
3981
3982 /* Set ARG_SIZE to be the data block size for OMP_TASK GS.  */
3983
3984 static inline void
3985 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
3986 {
3987   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3988   gs->gimple_omp_task.arg_size = arg_size;
3989 }
3990
3991
3992 /* Return align of the data block in bytes in OMP_TASK GS.  */
3993
3994 static inline tree
3995 gimple_omp_task_arg_align (const_gimple gs)
3996 {
3997   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3998   return gs->gimple_omp_task.arg_align;
3999 }
4000
4001
4002 /* Return a pointer to the data block align for OMP_TASK GS.  */
4003
4004 static inline tree *
4005 gimple_omp_task_arg_align_ptr (gimple gs)
4006 {
4007   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4008   return &gs->gimple_omp_task.arg_align;
4009 }
4010
4011
4012 /* Set ARG_SIZE to be the data block align for OMP_TASK GS.  */
4013
4014 static inline void
4015 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4016 {
4017   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4018   gs->gimple_omp_task.arg_align = arg_align;
4019 }
4020
4021
4022 /* Return the clauses associated with OMP_SINGLE GS.  */
4023
4024 static inline tree
4025 gimple_omp_single_clauses (const_gimple gs)
4026 {
4027   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4028   return gs->gimple_omp_single.clauses;
4029 }
4030
4031
4032 /* Return a pointer to the clauses associated with OMP_SINGLE GS.  */
4033
4034 static inline tree *
4035 gimple_omp_single_clauses_ptr (gimple gs)
4036 {
4037   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4038   return &gs->gimple_omp_single.clauses;
4039 }
4040
4041
4042 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS.  */
4043
4044 static inline void
4045 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4046 {
4047   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4048   gs->gimple_omp_single.clauses = clauses;
4049 }
4050
4051
4052 /* Return the clauses associated with OMP_SECTIONS GS.  */
4053
4054 static inline tree
4055 gimple_omp_sections_clauses (const_gimple gs)
4056 {
4057   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4058   return gs->gimple_omp_sections.clauses;
4059 }
4060
4061
4062 /* Return a pointer to the clauses associated with OMP_SECTIONS GS.  */
4063
4064 static inline tree *
4065 gimple_omp_sections_clauses_ptr (gimple gs)
4066 {
4067   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4068   return &gs->gimple_omp_sections.clauses;
4069 }
4070
4071
4072 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
4073    GS.  */
4074
4075 static inline void
4076 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
4077 {
4078   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4079   gs->gimple_omp_sections.clauses = clauses;
4080 }
4081
4082
4083 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
4084    in GS.  */
4085
4086 static inline tree
4087 gimple_omp_sections_control (const_gimple gs)
4088 {
4089   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4090   return gs->gimple_omp_sections.control;
4091 }
4092
4093
4094 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
4095    GS.  */
4096
4097 static inline tree *
4098 gimple_omp_sections_control_ptr (gimple gs)
4099 {
4100   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4101   return &gs->gimple_omp_sections.control;
4102 }
4103
4104
4105 /* Set CONTROL to be the set of clauses associated with the
4106    GIMPLE_OMP_SECTIONS in GS.  */
4107
4108 static inline void
4109 gimple_omp_sections_set_control (gimple gs, tree control)
4110 {
4111   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4112   gs->gimple_omp_sections.control = control;
4113 }
4114
4115
4116 /* Set COND to be the condition code for OMP_FOR GS.  */
4117
4118 static inline void
4119 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
4120 {
4121   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4122   gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
4123                               && i < gs->gimple_omp_for.collapse);
4124   gs->gimple_omp_for.iter[i].cond = cond;
4125 }
4126
4127
4128 /* Return the condition code associated with OMP_FOR GS.  */
4129
4130 static inline enum tree_code
4131 gimple_omp_for_cond (const_gimple gs, size_t i)
4132 {
4133   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4134   gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4135   return gs->gimple_omp_for.iter[i].cond;
4136 }
4137
4138
4139 /* Set the value being stored in an atomic store.  */
4140
4141 static inline void
4142 gimple_omp_atomic_store_set_val (gimple g, tree val)
4143 {
4144   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4145   g->gimple_omp_atomic_store.val = val;
4146 }
4147
4148
4149 /* Return the value being stored in an atomic store.  */
4150
4151 static inline tree
4152 gimple_omp_atomic_store_val (const_gimple g)
4153 {
4154   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4155   return g->gimple_omp_atomic_store.val;
4156 }
4157
4158
4159 /* Return a pointer to the value being stored in an atomic store.  */
4160
4161 static inline tree *
4162 gimple_omp_atomic_store_val_ptr (gimple g)
4163 {
4164   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4165   return &g->gimple_omp_atomic_store.val;
4166 }
4167
4168
4169 /* Set the LHS of an atomic load.  */
4170
4171 static inline void
4172 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
4173 {
4174   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4175   g->gimple_omp_atomic_load.lhs = lhs;
4176 }
4177
4178
4179 /* Get the LHS of an atomic load.  */
4180
4181 static inline tree
4182 gimple_omp_atomic_load_lhs (const_gimple g)
4183 {
4184   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4185   return g->gimple_omp_atomic_load.lhs;
4186 }
4187
4188
4189 /* Return a pointer to the LHS of an atomic load.  */
4190
4191 static inline tree *
4192 gimple_omp_atomic_load_lhs_ptr (gimple g)
4193 {
4194   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4195   return &g->gimple_omp_atomic_load.lhs;
4196 }
4197
4198
4199 /* Set the RHS of an atomic load.  */
4200
4201 static inline void
4202 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
4203 {
4204   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4205   g->gimple_omp_atomic_load.rhs = rhs;
4206 }
4207
4208
4209 /* Get the RHS of an atomic load.  */
4210
4211 static inline tree
4212 gimple_omp_atomic_load_rhs (const_gimple g)
4213 {
4214   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4215   return g->gimple_omp_atomic_load.rhs;
4216 }
4217
4218
4219 /* Return a pointer to the RHS of an atomic load.  */
4220
4221 static inline tree *
4222 gimple_omp_atomic_load_rhs_ptr (gimple g)
4223 {
4224   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4225   return &g->gimple_omp_atomic_load.rhs;
4226 }
4227
4228
4229 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE.  */
4230
4231 static inline tree
4232 gimple_omp_continue_control_def (const_gimple g)
4233 {
4234   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4235   return g->gimple_omp_continue.control_def;
4236 }
4237
4238 /* The same as above, but return the address.  */
4239
4240 static inline tree *
4241 gimple_omp_continue_control_def_ptr (gimple g)
4242 {
4243   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4244   return &g->gimple_omp_continue.control_def;
4245 }
4246
4247 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE.  */
4248
4249 static inline void
4250 gimple_omp_continue_set_control_def (gimple g, tree def)
4251 {
4252   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4253   g->gimple_omp_continue.control_def = def;
4254 }
4255
4256
4257 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE.  */
4258
4259 static inline tree
4260 gimple_omp_continue_control_use (const_gimple g)
4261 {
4262   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4263   return g->gimple_omp_continue.control_use;
4264 }
4265
4266
4267 /* The same as above, but return the address.  */
4268
4269 static inline tree *
4270 gimple_omp_continue_control_use_ptr (gimple g)
4271 {
4272   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4273   return &g->gimple_omp_continue.control_use;
4274 }
4275
4276
4277 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE.  */
4278
4279 static inline void
4280 gimple_omp_continue_set_control_use (gimple g, tree use)
4281 {
4282   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4283   g->gimple_omp_continue.control_use = use;
4284 }
4285
4286
4287 /* Return a pointer to the return value for GIMPLE_RETURN GS.  */
4288
4289 static inline tree *
4290 gimple_return_retval_ptr (const_gimple gs)
4291 {
4292   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4293   return gimple_op_ptr (gs, 0);
4294 }
4295
4296 /* Return the return value for GIMPLE_RETURN GS.  */
4297
4298 static inline tree
4299 gimple_return_retval (const_gimple gs)
4300 {
4301   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4302   return gimple_op (gs, 0);
4303 }
4304
4305
4306 /* Set RETVAL to be the return value for GIMPLE_RETURN GS.  */
4307
4308 static inline void
4309 gimple_return_set_retval (gimple gs, tree retval)
4310 {
4311   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4312   gimple_set_op (gs, 0, retval);
4313 }
4314
4315
4316 /* Returns true when the gimple statment STMT is any of the OpenMP types.  */
4317
4318 #define CASE_GIMPLE_OMP                         \
4319     case GIMPLE_OMP_PARALLEL:                   \
4320     case GIMPLE_OMP_TASK:                       \
4321     case GIMPLE_OMP_FOR:                        \
4322     case GIMPLE_OMP_SECTIONS:                   \
4323     case GIMPLE_OMP_SECTIONS_SWITCH:            \
4324     case GIMPLE_OMP_SINGLE:                     \
4325     case GIMPLE_OMP_SECTION:                    \
4326     case GIMPLE_OMP_MASTER:                     \
4327     case GIMPLE_OMP_ORDERED:                    \
4328     case GIMPLE_OMP_CRITICAL:                   \
4329     case GIMPLE_OMP_RETURN:                     \
4330     case GIMPLE_OMP_ATOMIC_LOAD:                \
4331     case GIMPLE_OMP_ATOMIC_STORE:               \
4332     case GIMPLE_OMP_CONTINUE
4333
4334 static inline bool
4335 is_gimple_omp (const_gimple stmt)
4336 {
4337   switch (gimple_code (stmt))
4338     {
4339     CASE_GIMPLE_OMP:
4340       return true;
4341     default:
4342       return false;
4343     }
4344 }
4345
4346
4347 /* Returns TRUE if statement G is a GIMPLE_NOP.  */
4348
4349 static inline bool
4350 gimple_nop_p (const_gimple g)
4351 {
4352   return gimple_code (g) == GIMPLE_NOP;
4353 }
4354
4355
4356 /* Return true if GS is a GIMPLE_RESX.  */
4357
4358 static inline bool
4359 is_gimple_resx (const_gimple gs)
4360 {
4361   return gimple_code (gs) == GIMPLE_RESX;
4362 }
4363
4364 /* Return the predictor of GIMPLE_PREDICT statement GS.  */
4365
4366 static inline enum br_predictor
4367 gimple_predict_predictor (gimple gs)
4368 {
4369   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4370   return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
4371 }
4372
4373
4374 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT.  */
4375
4376 static inline void
4377 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
4378 {
4379   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4380   gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
4381                        | (unsigned) predictor;
4382 }
4383
4384
4385 /* Return the outcome of GIMPLE_PREDICT statement GS.  */
4386
4387 static inline enum prediction
4388 gimple_predict_outcome (gimple gs)
4389 {
4390   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4391   return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
4392 }
4393
4394
4395 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME.  */
4396
4397 static inline void
4398 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
4399 {
4400   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4401   if (outcome == TAKEN)
4402     gs->gsbase.subcode |= GF_PREDICT_TAKEN;
4403   else
4404     gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
4405 }
4406
4407
4408 /* Return the type of the main expression computed by STMT.  Return
4409    void_type_node if the statement computes nothing.  */
4410
4411 static inline tree
4412 gimple_expr_type (const_gimple stmt)
4413 {
4414   enum gimple_code code = gimple_code (stmt);
4415
4416   if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
4417     {
4418       tree type;
4419       /* In general we want to pass out a type that can be substituted
4420          for both the RHS and the LHS types if there is a possibly
4421          useless conversion involved.  That means returning the
4422          original RHS type as far as we can reconstruct it.  */
4423       if (code == GIMPLE_CALL)
4424         type = gimple_call_return_type (stmt);
4425       else
4426         switch (gimple_assign_rhs_code (stmt))
4427           {
4428           case POINTER_PLUS_EXPR:
4429             type = TREE_TYPE (gimple_assign_rhs1 (stmt));
4430             break;
4431
4432           default:
4433             /* As fallback use the type of the LHS.  */
4434             type = TREE_TYPE (gimple_get_lhs (stmt));
4435             break;
4436           }
4437       return type;
4438     }
4439   else if (code == GIMPLE_COND)
4440     return boolean_type_node;
4441   else
4442     return void_type_node;
4443 }
4444
4445
4446 /* Return a new iterator pointing to GIMPLE_SEQ's first statement.  */
4447
4448 static inline gimple_stmt_iterator
4449 gsi_start (gimple_seq seq)
4450 {
4451   gimple_stmt_iterator i;
4452
4453   i.ptr = gimple_seq_first (seq);
4454   i.seq = seq;
4455   i.bb = (i.ptr && i.ptr->stmt) ? gimple_bb (i.ptr->stmt) : NULL;
4456
4457   return i;
4458 }
4459
4460
4461 /* Return a new iterator pointing to the first statement in basic block BB.  */
4462
4463 static inline gimple_stmt_iterator
4464 gsi_start_bb (basic_block bb)
4465 {
4466   gimple_stmt_iterator i;
4467   gimple_seq seq;
4468
4469   seq = bb_seq (bb);
4470   i.ptr = gimple_seq_first (seq);
4471   i.seq = seq;
4472   i.bb = bb;
4473
4474   return i;
4475 }
4476
4477
4478 /* Return a new iterator initially pointing to GIMPLE_SEQ's last statement.  */
4479
4480 static inline gimple_stmt_iterator
4481 gsi_last (gimple_seq seq)
4482 {
4483   gimple_stmt_iterator i;
4484
4485   i.ptr = gimple_seq_last (seq);
4486   i.seq = seq;
4487   i.bb = (i.ptr && i.ptr->stmt) ? gimple_bb (i.ptr->stmt) : NULL;
4488
4489   return i;
4490 }
4491
4492
4493 /* Return a new iterator pointing to the last statement in basic block BB.  */
4494
4495 static inline gimple_stmt_iterator
4496 gsi_last_bb (basic_block bb)
4497 {
4498   gimple_stmt_iterator i;
4499   gimple_seq seq;
4500
4501   seq = bb_seq (bb);
4502   i.ptr = gimple_seq_last (seq);
4503   i.seq = seq;
4504   i.bb = bb;
4505
4506   return i;
4507 }
4508
4509
4510 /* Return true if I is at the end of its sequence.  */
4511
4512 static inline bool
4513 gsi_end_p (gimple_stmt_iterator i)
4514 {
4515   return i.ptr == NULL;
4516 }
4517
4518
4519 /* Return true if I is one statement before the end of its sequence.  */
4520
4521 static inline bool
4522 gsi_one_before_end_p (gimple_stmt_iterator i)
4523 {
4524   return i.ptr != NULL && i.ptr->next == NULL;
4525 }
4526
4527
4528 /* Advance the iterator to the next gimple statement.  */
4529
4530 static inline void
4531 gsi_next (gimple_stmt_iterator *i)
4532 {
4533   i->ptr = i->ptr->next;
4534 }
4535
4536 /* Advance the iterator to the previous gimple statement.  */
4537
4538 static inline void
4539 gsi_prev (gimple_stmt_iterator *i)
4540 {
4541   i->ptr = i->ptr->prev;
4542 }
4543
4544 /* Return the current stmt.  */
4545
4546 static inline gimple
4547 gsi_stmt (gimple_stmt_iterator i)
4548 {
4549   return i.ptr->stmt;
4550 }
4551
4552 /* Return a block statement iterator that points to the first non-label
4553    statement in block BB.  */
4554
4555 static inline gimple_stmt_iterator
4556 gsi_after_labels (basic_block bb)
4557 {
4558   gimple_stmt_iterator gsi = gsi_start_bb (bb);
4559
4560   while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
4561     gsi_next (&gsi);
4562
4563   return gsi;
4564 }
4565
4566 /* Advance the iterator to the next non-debug gimple statement.  */
4567
4568 static inline void
4569 gsi_next_nondebug (gimple_stmt_iterator *i)
4570 {
4571   do
4572     {
4573       gsi_next (i);
4574     }
4575   while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
4576 }
4577
4578 /* Advance the iterator to the next non-debug gimple statement.  */
4579
4580 static inline void
4581 gsi_prev_nondebug (gimple_stmt_iterator *i)
4582 {
4583   do
4584     {
4585       gsi_prev (i);
4586     }
4587   while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
4588 }
4589
4590 /* Return a new iterator pointing to the first non-debug statement in
4591    basic block BB.  */
4592
4593 static inline gimple_stmt_iterator
4594 gsi_start_nondebug_bb (basic_block bb)
4595 {
4596   gimple_stmt_iterator i = gsi_start_bb (bb);
4597
4598   if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
4599     gsi_next_nondebug (&i);
4600
4601   return i;
4602 }
4603
4604 /* Return a new iterator pointing to the last non-debug statement in
4605    basic block BB.  */
4606
4607 static inline gimple_stmt_iterator
4608 gsi_last_nondebug_bb (basic_block bb)
4609 {
4610   gimple_stmt_iterator i = gsi_last_bb (bb);
4611
4612   if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
4613     gsi_prev_nondebug (&i);
4614
4615   return i;
4616 }
4617
4618 /* Return a pointer to the current stmt.
4619
4620   NOTE: You may want to use gsi_replace on the iterator itself,
4621   as this performs additional bookkeeping that will not be done
4622   if you simply assign through a pointer returned by gsi_stmt_ptr.  */
4623
4624 static inline gimple *
4625 gsi_stmt_ptr (gimple_stmt_iterator *i)
4626 {
4627   return &i->ptr->stmt;
4628 }
4629
4630
4631 /* Return the basic block associated with this iterator.  */
4632
4633 static inline basic_block
4634 gsi_bb (gimple_stmt_iterator i)
4635 {
4636   return i.bb;
4637 }
4638
4639
4640 /* Return the sequence associated with this iterator.  */
4641
4642 static inline gimple_seq
4643 gsi_seq (gimple_stmt_iterator i)
4644 {
4645   return i.seq;
4646 }
4647
4648
4649 enum gsi_iterator_update
4650 {
4651   GSI_NEW_STMT,         /* Only valid when single statement is added, move
4652                            iterator to it.  */
4653   GSI_SAME_STMT,        /* Leave the iterator at the same statement.  */
4654   GSI_CONTINUE_LINKING  /* Move iterator to whatever position is suitable
4655                            for linking other statements in the same
4656                            direction.  */
4657 };
4658
4659 /* In gimple-iterator.c  */
4660 gimple_stmt_iterator gsi_start_phis (basic_block);
4661 gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
4662 gimple_seq gsi_split_seq_before (gimple_stmt_iterator *);
4663 void gsi_replace (gimple_stmt_iterator *, gimple, bool);
4664 void gsi_insert_before (gimple_stmt_iterator *, gimple,
4665                         enum gsi_iterator_update);
4666 void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
4667                                        enum gsi_iterator_update);
4668 void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
4669                             enum gsi_iterator_update);
4670 void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
4671                                            enum gsi_iterator_update);
4672 void gsi_insert_after (gimple_stmt_iterator *, gimple,
4673                        enum gsi_iterator_update);
4674 void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
4675                                       enum gsi_iterator_update);
4676 void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
4677                            enum gsi_iterator_update);
4678 void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
4679                                           enum gsi_iterator_update);
4680 void gsi_remove (gimple_stmt_iterator *, bool);
4681 gimple_stmt_iterator gsi_for_stmt (gimple);
4682 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
4683 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
4684 void gsi_move_to_bb_end (gimple_stmt_iterator *, struct basic_block_def *);
4685 void gsi_insert_on_edge (edge, gimple);
4686 void gsi_insert_seq_on_edge (edge, gimple_seq);
4687 basic_block gsi_insert_on_edge_immediate (edge, gimple);
4688 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
4689 void gsi_commit_one_edge_insert (edge, basic_block *);
4690 void gsi_commit_edge_inserts (void);
4691 gimple gimple_call_copy_skip_args (gimple, bitmap);
4692
4693
4694 /* Convenience routines to walk all statements of a gimple function.
4695    Note that this is useful exclusively before the code is converted
4696    into SSA form.  Once the program is in SSA form, the standard
4697    operand interface should be used to analyze/modify statements.  */
4698 struct walk_stmt_info
4699 {
4700   /* Points to the current statement being walked.  */
4701   gimple_stmt_iterator gsi;
4702
4703   /* Additional data that the callback functions may want to carry
4704      through the recursion.  */
4705   void *info;
4706
4707   /* Pointer map used to mark visited tree nodes when calling
4708      walk_tree on each operand.  If set to NULL, duplicate tree nodes
4709      will be visited more than once.  */
4710   struct pointer_set_t *pset;
4711
4712   /* Indicates whether the operand being examined may be replaced
4713      with something that matches is_gimple_val (if true) or something
4714      slightly more complicated (if false).  "Something" technically
4715      means the common subset of is_gimple_lvalue and is_gimple_rhs,
4716      but we never try to form anything more complicated than that, so
4717      we don't bother checking.
4718
4719      Also note that CALLBACK should update this flag while walking the
4720      sub-expressions of a statement.  For instance, when walking the
4721      statement 'foo (&var)', the flag VAL_ONLY will initially be set
4722      to true, however, when walking &var, the operand of that
4723      ADDR_EXPR does not need to be a GIMPLE value.  */
4724   bool val_only;
4725
4726   /* True if we are currently walking the LHS of an assignment.  */
4727   bool is_lhs;
4728
4729   /* Optional.  Set to true by the callback functions if they made any
4730      changes.  */
4731   bool changed;
4732
4733   /* True if we're interested in location information.  */
4734   bool want_locations;
4735
4736   /* Operand returned by the callbacks.  This is set when calling
4737      walk_gimple_seq.  If the walk_stmt_fn or walk_tree_fn callback
4738      returns non-NULL, this field will contain the tree returned by
4739      the last callback.  */
4740   tree callback_result;
4741 };
4742
4743 /* Callback for walk_gimple_stmt.  Called for every statement found
4744    during traversal.  The first argument points to the statement to
4745    walk.  The second argument is a flag that the callback sets to
4746    'true' if it the callback handled all the operands and
4747    sub-statements of the statement (the default value of this flag is
4748    'false').  The third argument is an anonymous pointer to data
4749    to be used by the callback.  */
4750 typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
4751                               struct walk_stmt_info *);
4752
4753 gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
4754                         struct walk_stmt_info *);
4755 tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
4756                        struct walk_stmt_info *);
4757 tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
4758
4759 #ifdef GATHER_STATISTICS
4760 /* Enum and arrays used for allocation stats.  Keep in sync with
4761    gimple.c:gimple_alloc_kind_names.  */
4762 enum gimple_alloc_kind
4763 {
4764   gimple_alloc_kind_assign,     /* Assignments.  */
4765   gimple_alloc_kind_phi,        /* PHI nodes.  */
4766   gimple_alloc_kind_cond,       /* Conditionals.  */
4767   gimple_alloc_kind_seq,        /* Sequences.  */
4768   gimple_alloc_kind_rest,       /* Everything else.  */
4769   gimple_alloc_kind_all
4770 };
4771
4772 extern int gimple_alloc_counts[];
4773 extern int gimple_alloc_sizes[];
4774
4775 /* Return the allocation kind for a given stmt CODE.  */
4776 static inline enum gimple_alloc_kind
4777 gimple_alloc_kind (enum gimple_code code)
4778 {
4779   switch (code)
4780     {
4781       case GIMPLE_ASSIGN:
4782         return gimple_alloc_kind_assign;
4783       case GIMPLE_PHI:
4784         return gimple_alloc_kind_phi;
4785       case GIMPLE_COND:
4786         return gimple_alloc_kind_cond;
4787       default:
4788         return gimple_alloc_kind_rest;
4789     }
4790 }
4791 #endif /* GATHER_STATISTICS */
4792
4793 extern void dump_gimple_statistics (void);
4794
4795 /* In gimple-fold.c.  */
4796 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
4797 tree gimple_fold_builtin (gimple);
4798 bool fold_stmt (gimple_stmt_iterator *);
4799 bool fold_stmt_inplace (gimple);
4800 tree maybe_fold_offset_to_reference (location_t, tree, tree, tree);
4801 tree maybe_fold_offset_to_address (location_t, tree, tree, tree);
4802 tree maybe_fold_stmt_addition (location_t, tree, tree, tree);
4803 tree get_symbol_constant_value (tree);
4804 bool may_propagate_address_into_dereference (tree, tree);
4805 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree, 
4806                                         enum tree_code, tree, tree);
4807 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
4808                                        enum tree_code, tree, tree);
4809
4810 #endif  /* GCC_GIMPLE_H */