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