lto-cgraph.c (get_alias_symbol): Remove weakref sanity check.
[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);
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 /* Return the first node in GIMPLE sequence S. */
1105
1106 static inline gimple_seq_node
1107 gimple_seq_first (gimple_seq s)
1108 {
1109 return s;
1110 }
1111
1112
1113 /* Return the first statement in GIMPLE sequence S. */
1114
1115 static inline gimple
1116 gimple_seq_first_stmt (gimple_seq s)
1117 {
1118 gimple_seq_node n = gimple_seq_first (s);
1119 return n;
1120 }
1121
1122
1123 /* Return the last node in GIMPLE sequence S. */
1124
1125 static inline gimple_seq_node
1126 gimple_seq_last (gimple_seq s)
1127 {
1128 return s ? s->gsbase.prev : NULL;
1129 }
1130
1131
1132 /* Return the last statement in GIMPLE sequence S. */
1133
1134 static inline gimple
1135 gimple_seq_last_stmt (gimple_seq s)
1136 {
1137 gimple_seq_node n = gimple_seq_last (s);
1138 return n;
1139 }
1140
1141
1142 /* Set the last node in GIMPLE sequence *PS to LAST. */
1143
1144 static inline void
1145 gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1146 {
1147 (*ps)->gsbase.prev = last;
1148 }
1149
1150
1151 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1152
1153 static inline void
1154 gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1155 {
1156 *ps = first;
1157 }
1158
1159
1160 /* Return true if GIMPLE sequence S is empty. */
1161
1162 static inline bool
1163 gimple_seq_empty_p (gimple_seq s)
1164 {
1165 return s == NULL;
1166 }
1167
1168 void gimple_seq_add_stmt (gimple_seq *, gimple);
1169
1170 /* Link gimple statement GS to the end of the sequence *SEQ_P. If
1171 *SEQ_P is NULL, a new sequence is allocated. This function is
1172 similar to gimple_seq_add_stmt, but does not scan the operands.
1173 During gimplification, we need to manipulate statement sequences
1174 before the def/use vectors have been constructed. */
1175 void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
1176
1177 /* Allocate a new sequence and initialize its first element with STMT. */
1178
1179 static inline gimple_seq
1180 gimple_seq_alloc_with_stmt (gimple stmt)
1181 {
1182 gimple_seq seq = NULL;
1183 gimple_seq_add_stmt (&seq, stmt);
1184 return seq;
1185 }
1186
1187
1188 /* Returns the sequence of statements in BB. */
1189
1190 static inline gimple_seq
1191 bb_seq (const_basic_block bb)
1192 {
1193 return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1194 }
1195
1196 static inline gimple_seq *
1197 bb_seq_addr (basic_block bb)
1198 {
1199 return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1200 }
1201
1202 /* Sets the sequence of statements in BB to SEQ. */
1203
1204 static inline void
1205 set_bb_seq (basic_block bb, gimple_seq seq)
1206 {
1207 gcc_checking_assert (!(bb->flags & BB_RTL));
1208 bb->il.gimple.seq = seq;
1209 }
1210
1211
1212 /* Return the code for GIMPLE statement G. */
1213
1214 static inline enum gimple_code
1215 gimple_code (const_gimple g)
1216 {
1217 return g->gsbase.code;
1218 }
1219
1220
1221 /* Return the GSS code used by a GIMPLE code. */
1222
1223 static inline enum gimple_statement_structure_enum
1224 gss_for_code (enum gimple_code code)
1225 {
1226 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1227 return gss_for_code_[code];
1228 }
1229
1230
1231 /* Return which GSS code is used by GS. */
1232
1233 static inline enum gimple_statement_structure_enum
1234 gimple_statement_structure (gimple gs)
1235 {
1236 return gss_for_code (gimple_code (gs));
1237 }
1238
1239
1240 /* Return true if statement G has sub-statements. This is only true for
1241 High GIMPLE statements. */
1242
1243 static inline bool
1244 gimple_has_substatements (gimple g)
1245 {
1246 switch (gimple_code (g))
1247 {
1248 case GIMPLE_BIND:
1249 case GIMPLE_CATCH:
1250 case GIMPLE_EH_FILTER:
1251 case GIMPLE_EH_ELSE:
1252 case GIMPLE_TRY:
1253 case GIMPLE_OMP_FOR:
1254 case GIMPLE_OMP_MASTER:
1255 case GIMPLE_OMP_ORDERED:
1256 case GIMPLE_OMP_SECTION:
1257 case GIMPLE_OMP_PARALLEL:
1258 case GIMPLE_OMP_TASK:
1259 case GIMPLE_OMP_SECTIONS:
1260 case GIMPLE_OMP_SINGLE:
1261 case GIMPLE_OMP_CRITICAL:
1262 case GIMPLE_WITH_CLEANUP_EXPR:
1263 case GIMPLE_TRANSACTION:
1264 return true;
1265
1266 default:
1267 return false;
1268 }
1269 }
1270
1271
1272 /* Return the basic block holding statement G. */
1273
1274 static inline basic_block
1275 gimple_bb (const_gimple g)
1276 {
1277 return g->gsbase.bb;
1278 }
1279
1280
1281 /* Return the lexical scope block holding statement G. */
1282
1283 static inline tree
1284 gimple_block (const_gimple g)
1285 {
1286 return LOCATION_BLOCK (g->gsbase.location);
1287 }
1288
1289
1290 /* Set BLOCK to be the lexical scope block holding statement G. */
1291
1292 static inline void
1293 gimple_set_block (gimple g, tree block)
1294 {
1295 if (block)
1296 g->gsbase.location =
1297 COMBINE_LOCATION_DATA (line_table, g->gsbase.location, block);
1298 else
1299 g->gsbase.location = LOCATION_LOCUS (g->gsbase.location);
1300 }
1301
1302
1303 /* Return location information for statement G. */
1304
1305 static inline location_t
1306 gimple_location (const_gimple g)
1307 {
1308 return g->gsbase.location;
1309 }
1310
1311 /* Return pointer to location information for statement G. */
1312
1313 static inline const location_t *
1314 gimple_location_ptr (const_gimple g)
1315 {
1316 return &g->gsbase.location;
1317 }
1318
1319
1320 /* Set location information for statement G. */
1321
1322 static inline void
1323 gimple_set_location (gimple g, location_t location)
1324 {
1325 g->gsbase.location = location;
1326 }
1327
1328
1329 /* Return true if G contains location information. */
1330
1331 static inline bool
1332 gimple_has_location (const_gimple g)
1333 {
1334 return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1335 }
1336
1337
1338 /* Return the file name of the location of STMT. */
1339
1340 static inline const char *
1341 gimple_filename (const_gimple stmt)
1342 {
1343 return LOCATION_FILE (gimple_location (stmt));
1344 }
1345
1346
1347 /* Return the line number of the location of STMT. */
1348
1349 static inline int
1350 gimple_lineno (const_gimple stmt)
1351 {
1352 return LOCATION_LINE (gimple_location (stmt));
1353 }
1354
1355
1356 /* Determine whether SEQ is a singleton. */
1357
1358 static inline bool
1359 gimple_seq_singleton_p (gimple_seq seq)
1360 {
1361 return ((gimple_seq_first (seq) != NULL)
1362 && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1363 }
1364
1365 /* Return true if no warnings should be emitted for statement STMT. */
1366
1367 static inline bool
1368 gimple_no_warning_p (const_gimple stmt)
1369 {
1370 return stmt->gsbase.no_warning;
1371 }
1372
1373 /* Set the no_warning flag of STMT to NO_WARNING. */
1374
1375 static inline void
1376 gimple_set_no_warning (gimple stmt, bool no_warning)
1377 {
1378 stmt->gsbase.no_warning = (unsigned) no_warning;
1379 }
1380
1381 /* Set the visited status on statement STMT to VISITED_P. */
1382
1383 static inline void
1384 gimple_set_visited (gimple stmt, bool visited_p)
1385 {
1386 stmt->gsbase.visited = (unsigned) visited_p;
1387 }
1388
1389
1390 /* Return the visited status for statement STMT. */
1391
1392 static inline bool
1393 gimple_visited_p (gimple stmt)
1394 {
1395 return stmt->gsbase.visited;
1396 }
1397
1398
1399 /* Set pass local flag PLF on statement STMT to VAL_P. */
1400
1401 static inline void
1402 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1403 {
1404 if (val_p)
1405 stmt->gsbase.plf |= (unsigned int) plf;
1406 else
1407 stmt->gsbase.plf &= ~((unsigned int) plf);
1408 }
1409
1410
1411 /* Return the value of pass local flag PLF on statement STMT. */
1412
1413 static inline unsigned int
1414 gimple_plf (gimple stmt, enum plf_mask plf)
1415 {
1416 return stmt->gsbase.plf & ((unsigned int) plf);
1417 }
1418
1419
1420 /* Set the UID of statement. */
1421
1422 static inline void
1423 gimple_set_uid (gimple g, unsigned uid)
1424 {
1425 g->gsbase.uid = uid;
1426 }
1427
1428
1429 /* Return the UID of statement. */
1430
1431 static inline unsigned
1432 gimple_uid (const_gimple g)
1433 {
1434 return g->gsbase.uid;
1435 }
1436
1437
1438 /* Make statement G a singleton sequence. */
1439
1440 static inline void
1441 gimple_init_singleton (gimple g)
1442 {
1443 g->gsbase.next = NULL;
1444 g->gsbase.prev = g;
1445 }
1446
1447
1448 /* Return true if GIMPLE statement G has register or memory operands. */
1449
1450 static inline bool
1451 gimple_has_ops (const_gimple g)
1452 {
1453 return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1454 }
1455
1456
1457 /* Return true if GIMPLE statement G has memory operands. */
1458
1459 static inline bool
1460 gimple_has_mem_ops (const_gimple g)
1461 {
1462 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1463 }
1464
1465
1466 /* Return the set of USE operands for statement G. */
1467
1468 static inline struct use_optype_d *
1469 gimple_use_ops (const_gimple g)
1470 {
1471 if (!gimple_has_ops (g))
1472 return NULL;
1473 return g->gsops.opbase.use_ops;
1474 }
1475
1476
1477 /* Set USE to be the set of USE operands for statement G. */
1478
1479 static inline void
1480 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1481 {
1482 gcc_gimple_checking_assert (gimple_has_ops (g));
1483 g->gsops.opbase.use_ops = use;
1484 }
1485
1486
1487 /* Return the set of VUSE operand for statement G. */
1488
1489 static inline use_operand_p
1490 gimple_vuse_op (const_gimple g)
1491 {
1492 struct use_optype_d *ops;
1493 if (!gimple_has_mem_ops (g))
1494 return NULL_USE_OPERAND_P;
1495 ops = g->gsops.opbase.use_ops;
1496 if (ops
1497 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
1498 return USE_OP_PTR (ops);
1499 return NULL_USE_OPERAND_P;
1500 }
1501
1502 /* Return the set of VDEF operand for statement G. */
1503
1504 static inline def_operand_p
1505 gimple_vdef_op (gimple g)
1506 {
1507 if (!gimple_has_mem_ops (g))
1508 return NULL_DEF_OPERAND_P;
1509 if (g->gsmembase.vdef)
1510 return &g->gsmembase.vdef;
1511 return NULL_DEF_OPERAND_P;
1512 }
1513
1514
1515 /* Return the single VUSE operand of the statement G. */
1516
1517 static inline tree
1518 gimple_vuse (const_gimple g)
1519 {
1520 if (!gimple_has_mem_ops (g))
1521 return NULL_TREE;
1522 return g->gsmembase.vuse;
1523 }
1524
1525 /* Return the single VDEF operand of the statement G. */
1526
1527 static inline tree
1528 gimple_vdef (const_gimple g)
1529 {
1530 if (!gimple_has_mem_ops (g))
1531 return NULL_TREE;
1532 return g->gsmembase.vdef;
1533 }
1534
1535 /* Return the single VUSE operand of the statement G. */
1536
1537 static inline tree *
1538 gimple_vuse_ptr (gimple g)
1539 {
1540 if (!gimple_has_mem_ops (g))
1541 return NULL;
1542 return &g->gsmembase.vuse;
1543 }
1544
1545 /* Return the single VDEF operand of the statement G. */
1546
1547 static inline tree *
1548 gimple_vdef_ptr (gimple g)
1549 {
1550 if (!gimple_has_mem_ops (g))
1551 return NULL;
1552 return &g->gsmembase.vdef;
1553 }
1554
1555 /* Set the single VUSE operand of the statement G. */
1556
1557 static inline void
1558 gimple_set_vuse (gimple g, tree vuse)
1559 {
1560 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1561 g->gsmembase.vuse = vuse;
1562 }
1563
1564 /* Set the single VDEF operand of the statement G. */
1565
1566 static inline void
1567 gimple_set_vdef (gimple g, tree vdef)
1568 {
1569 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1570 g->gsmembase.vdef = vdef;
1571 }
1572
1573
1574 /* Return true if statement G has operands and the modified field has
1575 been set. */
1576
1577 static inline bool
1578 gimple_modified_p (const_gimple g)
1579 {
1580 return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
1581 }
1582
1583
1584 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1585 a MODIFIED field. */
1586
1587 static inline void
1588 gimple_set_modified (gimple s, bool modifiedp)
1589 {
1590 if (gimple_has_ops (s))
1591 s->gsbase.modified = (unsigned) modifiedp;
1592 }
1593
1594
1595 /* Return the tree code for the expression computed by STMT. This is
1596 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1597 GIMPLE_CALL, return CALL_EXPR as the expression code for
1598 consistency. This is useful when the caller needs to deal with the
1599 three kinds of computation that GIMPLE supports. */
1600
1601 static inline enum tree_code
1602 gimple_expr_code (const_gimple stmt)
1603 {
1604 enum gimple_code code = gimple_code (stmt);
1605 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1606 return (enum tree_code) stmt->gsbase.subcode;
1607 else
1608 {
1609 gcc_gimple_checking_assert (code == GIMPLE_CALL);
1610 return CALL_EXPR;
1611 }
1612 }
1613
1614
1615 /* Mark statement S as modified, and update it. */
1616
1617 static inline void
1618 update_stmt (gimple s)
1619 {
1620 if (gimple_has_ops (s))
1621 {
1622 gimple_set_modified (s, true);
1623 update_stmt_operands (s);
1624 }
1625 }
1626
1627 /* Update statement S if it has been optimized. */
1628
1629 static inline void
1630 update_stmt_if_modified (gimple s)
1631 {
1632 if (gimple_modified_p (s))
1633 update_stmt_operands (s);
1634 }
1635
1636 /* Return true if statement STMT contains volatile operands. */
1637
1638 static inline bool
1639 gimple_has_volatile_ops (const_gimple stmt)
1640 {
1641 if (gimple_has_mem_ops (stmt))
1642 return stmt->gsbase.has_volatile_ops;
1643 else
1644 return false;
1645 }
1646
1647
1648 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1649
1650 static inline void
1651 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1652 {
1653 if (gimple_has_mem_ops (stmt))
1654 stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
1655 }
1656
1657 /* Return true if BB is in a transaction. */
1658
1659 static inline bool
1660 block_in_transaction (basic_block bb)
1661 {
1662 return flag_tm && bb->flags & BB_IN_TRANSACTION;
1663 }
1664
1665 /* Return true if STMT is in a transaction. */
1666
1667 static inline bool
1668 gimple_in_transaction (gimple stmt)
1669 {
1670 return block_in_transaction (gimple_bb (stmt));
1671 }
1672
1673 /* Return true if statement STMT may access memory. */
1674
1675 static inline bool
1676 gimple_references_memory_p (gimple stmt)
1677 {
1678 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1679 }
1680
1681
1682 /* Return the subcode for OMP statement S. */
1683
1684 static inline unsigned
1685 gimple_omp_subcode (const_gimple s)
1686 {
1687 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1688 && gimple_code (s) <= GIMPLE_OMP_SINGLE);
1689 return s->gsbase.subcode;
1690 }
1691
1692 /* Set the subcode for OMP statement S to SUBCODE. */
1693
1694 static inline void
1695 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1696 {
1697 /* We only have 16 bits for the subcode. Assert that we are not
1698 overflowing it. */
1699 gcc_gimple_checking_assert (subcode < (1 << 16));
1700 s->gsbase.subcode = subcode;
1701 }
1702
1703 /* Set the nowait flag on OMP_RETURN statement S. */
1704
1705 static inline void
1706 gimple_omp_return_set_nowait (gimple s)
1707 {
1708 GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1709 s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
1710 }
1711
1712
1713 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1714 flag set. */
1715
1716 static inline bool
1717 gimple_omp_return_nowait_p (const_gimple g)
1718 {
1719 GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1720 return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1721 }
1722
1723
1724 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1725 flag set. */
1726
1727 static inline bool
1728 gimple_omp_section_last_p (const_gimple g)
1729 {
1730 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1731 return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1732 }
1733
1734
1735 /* Set the GF_OMP_SECTION_LAST flag on G. */
1736
1737 static inline void
1738 gimple_omp_section_set_last (gimple g)
1739 {
1740 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1741 g->gsbase.subcode |= GF_OMP_SECTION_LAST;
1742 }
1743
1744
1745 /* Return true if OMP parallel statement G has the
1746 GF_OMP_PARALLEL_COMBINED flag set. */
1747
1748 static inline bool
1749 gimple_omp_parallel_combined_p (const_gimple g)
1750 {
1751 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1752 return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1753 }
1754
1755
1756 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1757 value of COMBINED_P. */
1758
1759 static inline void
1760 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1761 {
1762 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1763 if (combined_p)
1764 g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
1765 else
1766 g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
1767 }
1768
1769
1770 /* Return true if OMP atomic load/store statement G has the
1771 GF_OMP_ATOMIC_NEED_VALUE flag set. */
1772
1773 static inline bool
1774 gimple_omp_atomic_need_value_p (const_gimple g)
1775 {
1776 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1777 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1778 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
1779 }
1780
1781
1782 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
1783
1784 static inline void
1785 gimple_omp_atomic_set_need_value (gimple g)
1786 {
1787 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1788 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1789 g->gsbase.subcode |= GF_OMP_ATOMIC_NEED_VALUE;
1790 }
1791
1792
1793 /* Return the number of operands for statement GS. */
1794
1795 static inline unsigned
1796 gimple_num_ops (const_gimple gs)
1797 {
1798 return gs->gsbase.num_ops;
1799 }
1800
1801
1802 /* Set the number of operands for statement GS. */
1803
1804 static inline void
1805 gimple_set_num_ops (gimple gs, unsigned num_ops)
1806 {
1807 gs->gsbase.num_ops = num_ops;
1808 }
1809
1810
1811 /* Return the array of operands for statement GS. */
1812
1813 static inline tree *
1814 gimple_ops (gimple gs)
1815 {
1816 size_t off;
1817
1818 /* All the tuples have their operand vector at the very bottom
1819 of the structure. Note that those structures that do not
1820 have an operand vector have a zero offset. */
1821 off = gimple_ops_offset_[gimple_statement_structure (gs)];
1822 gcc_gimple_checking_assert (off != 0);
1823
1824 return (tree *) ((char *) gs + off);
1825 }
1826
1827
1828 /* Return operand I for statement GS. */
1829
1830 static inline tree
1831 gimple_op (const_gimple gs, unsigned i)
1832 {
1833 if (gimple_has_ops (gs))
1834 {
1835 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1836 return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1837 }
1838 else
1839 return NULL_TREE;
1840 }
1841
1842 /* Return a pointer to operand I for statement GS. */
1843
1844 static inline tree *
1845 gimple_op_ptr (const_gimple gs, unsigned i)
1846 {
1847 if (gimple_has_ops (gs))
1848 {
1849 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1850 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1851 }
1852 else
1853 return NULL;
1854 }
1855
1856 /* Set operand I of statement GS to OP. */
1857
1858 static inline void
1859 gimple_set_op (gimple gs, unsigned i, tree op)
1860 {
1861 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1862
1863 /* Note. It may be tempting to assert that OP matches
1864 is_gimple_operand, but that would be wrong. Different tuples
1865 accept slightly different sets of tree operands. Each caller
1866 should perform its own validation. */
1867 gimple_ops (gs)[i] = op;
1868 }
1869
1870 /* Return true if GS is a GIMPLE_ASSIGN. */
1871
1872 static inline bool
1873 is_gimple_assign (const_gimple gs)
1874 {
1875 return gimple_code (gs) == GIMPLE_ASSIGN;
1876 }
1877
1878 /* Determine if expression CODE is one of the valid expressions that can
1879 be used on the RHS of GIMPLE assignments. */
1880
1881 static inline enum gimple_rhs_class
1882 get_gimple_rhs_class (enum tree_code code)
1883 {
1884 return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1885 }
1886
1887 /* Return the LHS of assignment statement GS. */
1888
1889 static inline tree
1890 gimple_assign_lhs (const_gimple gs)
1891 {
1892 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1893 return gimple_op (gs, 0);
1894 }
1895
1896
1897 /* Return a pointer to the LHS of assignment statement GS. */
1898
1899 static inline tree *
1900 gimple_assign_lhs_ptr (const_gimple gs)
1901 {
1902 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1903 return gimple_op_ptr (gs, 0);
1904 }
1905
1906
1907 /* Set LHS to be the LHS operand of assignment statement GS. */
1908
1909 static inline void
1910 gimple_assign_set_lhs (gimple gs, tree lhs)
1911 {
1912 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1913 gimple_set_op (gs, 0, lhs);
1914
1915 if (lhs && TREE_CODE (lhs) == SSA_NAME)
1916 SSA_NAME_DEF_STMT (lhs) = gs;
1917 }
1918
1919
1920 /* Return the first operand on the RHS of assignment statement GS. */
1921
1922 static inline tree
1923 gimple_assign_rhs1 (const_gimple gs)
1924 {
1925 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1926 return gimple_op (gs, 1);
1927 }
1928
1929
1930 /* Return a pointer to the first operand on the RHS of assignment
1931 statement GS. */
1932
1933 static inline tree *
1934 gimple_assign_rhs1_ptr (const_gimple gs)
1935 {
1936 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1937 return gimple_op_ptr (gs, 1);
1938 }
1939
1940 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
1941
1942 static inline void
1943 gimple_assign_set_rhs1 (gimple gs, tree rhs)
1944 {
1945 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1946
1947 gimple_set_op (gs, 1, rhs);
1948 }
1949
1950
1951 /* Return the second operand on the RHS of assignment statement GS.
1952 If GS does not have two operands, NULL is returned instead. */
1953
1954 static inline tree
1955 gimple_assign_rhs2 (const_gimple gs)
1956 {
1957 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1958
1959 if (gimple_num_ops (gs) >= 3)
1960 return gimple_op (gs, 2);
1961 else
1962 return NULL_TREE;
1963 }
1964
1965
1966 /* Return a pointer to the second operand on the RHS of assignment
1967 statement GS. */
1968
1969 static inline tree *
1970 gimple_assign_rhs2_ptr (const_gimple gs)
1971 {
1972 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1973 return gimple_op_ptr (gs, 2);
1974 }
1975
1976
1977 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
1978
1979 static inline void
1980 gimple_assign_set_rhs2 (gimple gs, tree rhs)
1981 {
1982 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1983
1984 gimple_set_op (gs, 2, rhs);
1985 }
1986
1987 /* Return the third operand on the RHS of assignment statement GS.
1988 If GS does not have two operands, NULL is returned instead. */
1989
1990 static inline tree
1991 gimple_assign_rhs3 (const_gimple gs)
1992 {
1993 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1994
1995 if (gimple_num_ops (gs) >= 4)
1996 return gimple_op (gs, 3);
1997 else
1998 return NULL_TREE;
1999 }
2000
2001 /* Return a pointer to the third operand on the RHS of assignment
2002 statement GS. */
2003
2004 static inline tree *
2005 gimple_assign_rhs3_ptr (const_gimple gs)
2006 {
2007 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2008 return gimple_op_ptr (gs, 3);
2009 }
2010
2011
2012 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2013
2014 static inline void
2015 gimple_assign_set_rhs3 (gimple gs, tree rhs)
2016 {
2017 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2018
2019 gimple_set_op (gs, 3, rhs);
2020 }
2021
2022 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
2023 to see only a maximum of two operands. */
2024
2025 static inline void
2026 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2027 tree op1, tree op2)
2028 {
2029 gimple_assign_set_rhs_with_ops_1 (gsi, code, op1, op2, NULL);
2030 }
2031
2032 /* A wrapper around extract_ops_from_tree_1, for callers which expect
2033 to see only a maximum of two operands. */
2034
2035 static inline void
2036 extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0,
2037 tree *op1)
2038 {
2039 tree op2;
2040 extract_ops_from_tree_1 (expr, code, op0, op1, &op2);
2041 gcc_assert (op2 == NULL_TREE);
2042 }
2043
2044 /* Returns true if GS is a nontemporal move. */
2045
2046 static inline bool
2047 gimple_assign_nontemporal_move_p (const_gimple gs)
2048 {
2049 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2050 return gs->gsbase.nontemporal_move;
2051 }
2052
2053 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2054
2055 static inline void
2056 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
2057 {
2058 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2059 gs->gsbase.nontemporal_move = nontemporal;
2060 }
2061
2062
2063 /* Return the code of the expression computed on the rhs of assignment
2064 statement GS. In case that the RHS is a single object, returns the
2065 tree code of the object. */
2066
2067 static inline enum tree_code
2068 gimple_assign_rhs_code (const_gimple gs)
2069 {
2070 enum tree_code code;
2071 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2072
2073 code = (enum tree_code) gs->gsbase.subcode;
2074 /* While we initially set subcode to the TREE_CODE of the rhs for
2075 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2076 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2077 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2078 code = TREE_CODE (gimple_assign_rhs1 (gs));
2079
2080 return code;
2081 }
2082
2083
2084 /* Set CODE to be the code for the expression computed on the RHS of
2085 assignment S. */
2086
2087 static inline void
2088 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
2089 {
2090 GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2091 s->gsbase.subcode = code;
2092 }
2093
2094
2095 /* Return the gimple rhs class of the code of the expression computed on
2096 the rhs of assignment statement GS.
2097 This will never return GIMPLE_INVALID_RHS. */
2098
2099 static inline enum gimple_rhs_class
2100 gimple_assign_rhs_class (const_gimple gs)
2101 {
2102 return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2103 }
2104
2105 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2106 there is no operator associated with the assignment itself.
2107 Unlike gimple_assign_copy_p, this predicate returns true for
2108 any RHS operand, including those that perform an operation
2109 and do not have the semantics of a copy, such as COND_EXPR. */
2110
2111 static inline bool
2112 gimple_assign_single_p (gimple gs)
2113 {
2114 return (is_gimple_assign (gs)
2115 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2116 }
2117
2118 /* Return true if GS performs a store to its lhs. */
2119
2120 static inline bool
2121 gimple_store_p (gimple gs)
2122 {
2123 tree lhs = gimple_get_lhs (gs);
2124 return lhs && !is_gimple_reg (lhs);
2125 }
2126
2127 /* Return true if GS is an assignment that loads from its rhs1. */
2128
2129 static inline bool
2130 gimple_assign_load_p (gimple gs)
2131 {
2132 tree rhs;
2133 if (!gimple_assign_single_p (gs))
2134 return false;
2135 rhs = gimple_assign_rhs1 (gs);
2136 if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
2137 return true;
2138 rhs = get_base_address (rhs);
2139 return (DECL_P (rhs)
2140 || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
2141 }
2142
2143
2144 /* Return true if S is a type-cast assignment. */
2145
2146 static inline bool
2147 gimple_assign_cast_p (gimple s)
2148 {
2149 if (is_gimple_assign (s))
2150 {
2151 enum tree_code sc = gimple_assign_rhs_code (s);
2152 return CONVERT_EXPR_CODE_P (sc)
2153 || sc == VIEW_CONVERT_EXPR
2154 || sc == FIX_TRUNC_EXPR;
2155 }
2156
2157 return false;
2158 }
2159
2160 /* Return true if S is a clobber statement. */
2161
2162 static inline bool
2163 gimple_clobber_p (gimple s)
2164 {
2165 return gimple_assign_single_p (s)
2166 && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2167 }
2168
2169 /* Return true if GS is a GIMPLE_CALL. */
2170
2171 static inline bool
2172 is_gimple_call (const_gimple gs)
2173 {
2174 return gimple_code (gs) == GIMPLE_CALL;
2175 }
2176
2177 /* Return the LHS of call statement GS. */
2178
2179 static inline tree
2180 gimple_call_lhs (const_gimple gs)
2181 {
2182 GIMPLE_CHECK (gs, GIMPLE_CALL);
2183 return gimple_op (gs, 0);
2184 }
2185
2186
2187 /* Return a pointer to the LHS of call statement GS. */
2188
2189 static inline tree *
2190 gimple_call_lhs_ptr (const_gimple gs)
2191 {
2192 GIMPLE_CHECK (gs, GIMPLE_CALL);
2193 return gimple_op_ptr (gs, 0);
2194 }
2195
2196
2197 /* Set LHS to be the LHS operand of call statement GS. */
2198
2199 static inline void
2200 gimple_call_set_lhs (gimple gs, tree lhs)
2201 {
2202 GIMPLE_CHECK (gs, GIMPLE_CALL);
2203 gimple_set_op (gs, 0, lhs);
2204 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2205 SSA_NAME_DEF_STMT (lhs) = gs;
2206 }
2207
2208
2209 /* Return true if call GS calls an internal-only function, as enumerated
2210 by internal_fn. */
2211
2212 static inline bool
2213 gimple_call_internal_p (const_gimple gs)
2214 {
2215 GIMPLE_CHECK (gs, GIMPLE_CALL);
2216 return (gs->gsbase.subcode & GF_CALL_INTERNAL) != 0;
2217 }
2218
2219
2220 /* Return the target of internal call GS. */
2221
2222 static inline enum internal_fn
2223 gimple_call_internal_fn (const_gimple gs)
2224 {
2225 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2226 return gs->gimple_call.u.internal_fn;
2227 }
2228
2229
2230 /* Return the function type of the function called by GS. */
2231
2232 static inline tree
2233 gimple_call_fntype (const_gimple gs)
2234 {
2235 GIMPLE_CHECK (gs, GIMPLE_CALL);
2236 if (gimple_call_internal_p (gs))
2237 return NULL_TREE;
2238 return gs->gimple_call.u.fntype;
2239 }
2240
2241 /* Set the type of the function called by GS to FNTYPE. */
2242
2243 static inline void
2244 gimple_call_set_fntype (gimple gs, tree fntype)
2245 {
2246 GIMPLE_CHECK (gs, GIMPLE_CALL);
2247 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2248 gs->gimple_call.u.fntype = fntype;
2249 }
2250
2251
2252 /* Return the tree node representing the function called by call
2253 statement GS. */
2254
2255 static inline tree
2256 gimple_call_fn (const_gimple gs)
2257 {
2258 GIMPLE_CHECK (gs, GIMPLE_CALL);
2259 return gimple_op (gs, 1);
2260 }
2261
2262 /* Return a pointer to the tree node representing the function called by call
2263 statement GS. */
2264
2265 static inline tree *
2266 gimple_call_fn_ptr (const_gimple gs)
2267 {
2268 GIMPLE_CHECK (gs, GIMPLE_CALL);
2269 return gimple_op_ptr (gs, 1);
2270 }
2271
2272
2273 /* Set FN to be the function called by call statement GS. */
2274
2275 static inline void
2276 gimple_call_set_fn (gimple gs, tree fn)
2277 {
2278 GIMPLE_CHECK (gs, GIMPLE_CALL);
2279 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2280 gimple_set_op (gs, 1, fn);
2281 }
2282
2283
2284 /* Set FNDECL to be the function called by call statement GS. */
2285
2286 static inline void
2287 gimple_call_set_fndecl (gimple gs, tree decl)
2288 {
2289 GIMPLE_CHECK (gs, GIMPLE_CALL);
2290 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2291 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
2292 }
2293
2294
2295 /* Set internal function FN to be the function called by call statement GS. */
2296
2297 static inline void
2298 gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
2299 {
2300 GIMPLE_CHECK (gs, GIMPLE_CALL);
2301 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2302 gs->gimple_call.u.internal_fn = fn;
2303 }
2304
2305
2306 /* Given a valid GIMPLE_CALL function address return the FUNCTION_DECL
2307 associated with the callee if known. Otherwise return NULL_TREE. */
2308
2309 static inline tree
2310 gimple_call_addr_fndecl (const_tree fn)
2311 {
2312 if (fn && TREE_CODE (fn) == ADDR_EXPR)
2313 {
2314 tree fndecl = TREE_OPERAND (fn, 0);
2315 if (TREE_CODE (fndecl) == MEM_REF
2316 && TREE_CODE (TREE_OPERAND (fndecl, 0)) == ADDR_EXPR
2317 && integer_zerop (TREE_OPERAND (fndecl, 1)))
2318 fndecl = TREE_OPERAND (TREE_OPERAND (fndecl, 0), 0);
2319 if (TREE_CODE (fndecl) == FUNCTION_DECL)
2320 return fndecl;
2321 }
2322 return NULL_TREE;
2323 }
2324
2325 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2326 Otherwise return NULL. This function is analogous to
2327 get_callee_fndecl in tree land. */
2328
2329 static inline tree
2330 gimple_call_fndecl (const_gimple gs)
2331 {
2332 return gimple_call_addr_fndecl (gimple_call_fn (gs));
2333 }
2334
2335
2336 /* Return the type returned by call statement GS. */
2337
2338 static inline tree
2339 gimple_call_return_type (const_gimple gs)
2340 {
2341 tree type = gimple_call_fntype (gs);
2342
2343 if (type == NULL_TREE)
2344 return TREE_TYPE (gimple_call_lhs (gs));
2345
2346 /* The type returned by a function is the type of its
2347 function type. */
2348 return TREE_TYPE (type);
2349 }
2350
2351
2352 /* Return the static chain for call statement GS. */
2353
2354 static inline tree
2355 gimple_call_chain (const_gimple gs)
2356 {
2357 GIMPLE_CHECK (gs, GIMPLE_CALL);
2358 return gimple_op (gs, 2);
2359 }
2360
2361
2362 /* Return a pointer to the static chain for call statement GS. */
2363
2364 static inline tree *
2365 gimple_call_chain_ptr (const_gimple gs)
2366 {
2367 GIMPLE_CHECK (gs, GIMPLE_CALL);
2368 return gimple_op_ptr (gs, 2);
2369 }
2370
2371 /* Set CHAIN to be the static chain for call statement GS. */
2372
2373 static inline void
2374 gimple_call_set_chain (gimple gs, tree chain)
2375 {
2376 GIMPLE_CHECK (gs, GIMPLE_CALL);
2377
2378 gimple_set_op (gs, 2, chain);
2379 }
2380
2381
2382 /* Return the number of arguments used by call statement GS. */
2383
2384 static inline unsigned
2385 gimple_call_num_args (const_gimple gs)
2386 {
2387 unsigned num_ops;
2388 GIMPLE_CHECK (gs, GIMPLE_CALL);
2389 num_ops = gimple_num_ops (gs);
2390 return num_ops - 3;
2391 }
2392
2393
2394 /* Return the argument at position INDEX for call statement GS. */
2395
2396 static inline tree
2397 gimple_call_arg (const_gimple gs, unsigned index)
2398 {
2399 GIMPLE_CHECK (gs, GIMPLE_CALL);
2400 return gimple_op (gs, index + 3);
2401 }
2402
2403
2404 /* Return a pointer to the argument at position INDEX for call
2405 statement GS. */
2406
2407 static inline tree *
2408 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2409 {
2410 GIMPLE_CHECK (gs, GIMPLE_CALL);
2411 return gimple_op_ptr (gs, index + 3);
2412 }
2413
2414
2415 /* Set ARG to be the argument at position INDEX for call statement GS. */
2416
2417 static inline void
2418 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2419 {
2420 GIMPLE_CHECK (gs, GIMPLE_CALL);
2421 gimple_set_op (gs, index + 3, arg);
2422 }
2423
2424
2425 /* If TAIL_P is true, mark call statement S as being a tail call
2426 (i.e., a call just before the exit of a function). These calls are
2427 candidate for tail call optimization. */
2428
2429 static inline void
2430 gimple_call_set_tail (gimple s, bool tail_p)
2431 {
2432 GIMPLE_CHECK (s, GIMPLE_CALL);
2433 if (tail_p)
2434 s->gsbase.subcode |= GF_CALL_TAILCALL;
2435 else
2436 s->gsbase.subcode &= ~GF_CALL_TAILCALL;
2437 }
2438
2439
2440 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2441
2442 static inline bool
2443 gimple_call_tail_p (gimple s)
2444 {
2445 GIMPLE_CHECK (s, GIMPLE_CALL);
2446 return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
2447 }
2448
2449
2450 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2451 slot optimization. This transformation uses the target of the call
2452 expansion as the return slot for calls that return in memory. */
2453
2454 static inline void
2455 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2456 {
2457 GIMPLE_CHECK (s, GIMPLE_CALL);
2458 if (return_slot_opt_p)
2459 s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
2460 else
2461 s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2462 }
2463
2464
2465 /* Return true if S is marked for return slot optimization. */
2466
2467 static inline bool
2468 gimple_call_return_slot_opt_p (gimple s)
2469 {
2470 GIMPLE_CHECK (s, GIMPLE_CALL);
2471 return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2472 }
2473
2474
2475 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2476 thunk to the thunked-to function. */
2477
2478 static inline void
2479 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2480 {
2481 GIMPLE_CHECK (s, GIMPLE_CALL);
2482 if (from_thunk_p)
2483 s->gsbase.subcode |= GF_CALL_FROM_THUNK;
2484 else
2485 s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
2486 }
2487
2488
2489 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2490
2491 static inline bool
2492 gimple_call_from_thunk_p (gimple s)
2493 {
2494 GIMPLE_CHECK (s, GIMPLE_CALL);
2495 return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
2496 }
2497
2498
2499 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2500 argument pack in its argument list. */
2501
2502 static inline void
2503 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2504 {
2505 GIMPLE_CHECK (s, GIMPLE_CALL);
2506 if (pass_arg_pack_p)
2507 s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
2508 else
2509 s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
2510 }
2511
2512
2513 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2514 argument pack in its argument list. */
2515
2516 static inline bool
2517 gimple_call_va_arg_pack_p (gimple s)
2518 {
2519 GIMPLE_CHECK (s, GIMPLE_CALL);
2520 return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
2521 }
2522
2523
2524 /* Return true if S is a noreturn call. */
2525
2526 static inline bool
2527 gimple_call_noreturn_p (gimple s)
2528 {
2529 GIMPLE_CHECK (s, GIMPLE_CALL);
2530 return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2531 }
2532
2533
2534 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2535 even if the called function can throw in other cases. */
2536
2537 static inline void
2538 gimple_call_set_nothrow (gimple s, bool nothrow_p)
2539 {
2540 GIMPLE_CHECK (s, GIMPLE_CALL);
2541 if (nothrow_p)
2542 s->gsbase.subcode |= GF_CALL_NOTHROW;
2543 else
2544 s->gsbase.subcode &= ~GF_CALL_NOTHROW;
2545 }
2546
2547 /* Return true if S is a nothrow call. */
2548
2549 static inline bool
2550 gimple_call_nothrow_p (gimple s)
2551 {
2552 GIMPLE_CHECK (s, GIMPLE_CALL);
2553 return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2554 }
2555
2556 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2557 is known to be emitted for VLA objects. Those are wrapped by
2558 stack_save/stack_restore calls and hence can't lead to unbounded
2559 stack growth even when they occur in loops. */
2560
2561 static inline void
2562 gimple_call_set_alloca_for_var (gimple s, bool for_var)
2563 {
2564 GIMPLE_CHECK (s, GIMPLE_CALL);
2565 if (for_var)
2566 s->gsbase.subcode |= GF_CALL_ALLOCA_FOR_VAR;
2567 else
2568 s->gsbase.subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
2569 }
2570
2571 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2572
2573 static inline bool
2574 gimple_call_alloca_for_var_p (gimple s)
2575 {
2576 GIMPLE_CHECK (s, GIMPLE_CALL);
2577 return (s->gsbase.subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
2578 }
2579
2580 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2581
2582 static inline void
2583 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2584 {
2585 GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2586 GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2587 dest_call->gsbase.subcode = orig_call->gsbase.subcode;
2588 }
2589
2590
2591 /* Return a pointer to the points-to solution for the set of call-used
2592 variables of the call CALL. */
2593
2594 static inline struct pt_solution *
2595 gimple_call_use_set (gimple call)
2596 {
2597 GIMPLE_CHECK (call, GIMPLE_CALL);
2598 return &call->gimple_call.call_used;
2599 }
2600
2601
2602 /* Return a pointer to the points-to solution for the set of call-used
2603 variables of the call CALL. */
2604
2605 static inline struct pt_solution *
2606 gimple_call_clobber_set (gimple call)
2607 {
2608 GIMPLE_CHECK (call, GIMPLE_CALL);
2609 return &call->gimple_call.call_clobbered;
2610 }
2611
2612
2613 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2614 non-NULL lhs. */
2615
2616 static inline bool
2617 gimple_has_lhs (gimple stmt)
2618 {
2619 return (is_gimple_assign (stmt)
2620 || (is_gimple_call (stmt)
2621 && gimple_call_lhs (stmt) != NULL_TREE));
2622 }
2623
2624
2625 /* Return the code of the predicate computed by conditional statement GS. */
2626
2627 static inline enum tree_code
2628 gimple_cond_code (const_gimple gs)
2629 {
2630 GIMPLE_CHECK (gs, GIMPLE_COND);
2631 return (enum tree_code) gs->gsbase.subcode;
2632 }
2633
2634
2635 /* Set CODE to be the predicate code for the conditional statement GS. */
2636
2637 static inline void
2638 gimple_cond_set_code (gimple gs, enum tree_code code)
2639 {
2640 GIMPLE_CHECK (gs, GIMPLE_COND);
2641 gs->gsbase.subcode = code;
2642 }
2643
2644
2645 /* Return the LHS of the predicate computed by conditional statement GS. */
2646
2647 static inline tree
2648 gimple_cond_lhs (const_gimple gs)
2649 {
2650 GIMPLE_CHECK (gs, GIMPLE_COND);
2651 return gimple_op (gs, 0);
2652 }
2653
2654 /* Return the pointer to the LHS of the predicate computed by conditional
2655 statement GS. */
2656
2657 static inline tree *
2658 gimple_cond_lhs_ptr (const_gimple gs)
2659 {
2660 GIMPLE_CHECK (gs, GIMPLE_COND);
2661 return gimple_op_ptr (gs, 0);
2662 }
2663
2664 /* Set LHS to be the LHS operand of the predicate computed by
2665 conditional statement GS. */
2666
2667 static inline void
2668 gimple_cond_set_lhs (gimple gs, tree lhs)
2669 {
2670 GIMPLE_CHECK (gs, GIMPLE_COND);
2671 gimple_set_op (gs, 0, lhs);
2672 }
2673
2674
2675 /* Return the RHS operand of the predicate computed by conditional GS. */
2676
2677 static inline tree
2678 gimple_cond_rhs (const_gimple gs)
2679 {
2680 GIMPLE_CHECK (gs, GIMPLE_COND);
2681 return gimple_op (gs, 1);
2682 }
2683
2684 /* Return the pointer to the RHS operand of the predicate computed by
2685 conditional GS. */
2686
2687 static inline tree *
2688 gimple_cond_rhs_ptr (const_gimple gs)
2689 {
2690 GIMPLE_CHECK (gs, GIMPLE_COND);
2691 return gimple_op_ptr (gs, 1);
2692 }
2693
2694
2695 /* Set RHS to be the RHS operand of the predicate computed by
2696 conditional statement GS. */
2697
2698 static inline void
2699 gimple_cond_set_rhs (gimple gs, tree rhs)
2700 {
2701 GIMPLE_CHECK (gs, GIMPLE_COND);
2702 gimple_set_op (gs, 1, rhs);
2703 }
2704
2705
2706 /* Return the label used by conditional statement GS when its
2707 predicate evaluates to true. */
2708
2709 static inline tree
2710 gimple_cond_true_label (const_gimple gs)
2711 {
2712 GIMPLE_CHECK (gs, GIMPLE_COND);
2713 return gimple_op (gs, 2);
2714 }
2715
2716
2717 /* Set LABEL to be the label used by conditional statement GS when its
2718 predicate evaluates to true. */
2719
2720 static inline void
2721 gimple_cond_set_true_label (gimple gs, tree label)
2722 {
2723 GIMPLE_CHECK (gs, GIMPLE_COND);
2724 gimple_set_op (gs, 2, label);
2725 }
2726
2727
2728 /* Set LABEL to be the label used by conditional statement GS when its
2729 predicate evaluates to false. */
2730
2731 static inline void
2732 gimple_cond_set_false_label (gimple gs, tree label)
2733 {
2734 GIMPLE_CHECK (gs, GIMPLE_COND);
2735 gimple_set_op (gs, 3, label);
2736 }
2737
2738
2739 /* Return the label used by conditional statement GS when its
2740 predicate evaluates to false. */
2741
2742 static inline tree
2743 gimple_cond_false_label (const_gimple gs)
2744 {
2745 GIMPLE_CHECK (gs, GIMPLE_COND);
2746 return gimple_op (gs, 3);
2747 }
2748
2749
2750 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
2751
2752 static inline void
2753 gimple_cond_make_false (gimple gs)
2754 {
2755 gimple_cond_set_lhs (gs, boolean_true_node);
2756 gimple_cond_set_rhs (gs, boolean_false_node);
2757 gs->gsbase.subcode = EQ_EXPR;
2758 }
2759
2760
2761 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
2762
2763 static inline void
2764 gimple_cond_make_true (gimple gs)
2765 {
2766 gimple_cond_set_lhs (gs, boolean_true_node);
2767 gimple_cond_set_rhs (gs, boolean_true_node);
2768 gs->gsbase.subcode = EQ_EXPR;
2769 }
2770
2771 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2772 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2773
2774 static inline bool
2775 gimple_cond_true_p (const_gimple gs)
2776 {
2777 tree lhs = gimple_cond_lhs (gs);
2778 tree rhs = gimple_cond_rhs (gs);
2779 enum tree_code code = gimple_cond_code (gs);
2780
2781 if (lhs != boolean_true_node && lhs != boolean_false_node)
2782 return false;
2783
2784 if (rhs != boolean_true_node && rhs != boolean_false_node)
2785 return false;
2786
2787 if (code == NE_EXPR && lhs != rhs)
2788 return true;
2789
2790 if (code == EQ_EXPR && lhs == rhs)
2791 return true;
2792
2793 return false;
2794 }
2795
2796 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2797 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2798
2799 static inline bool
2800 gimple_cond_false_p (const_gimple gs)
2801 {
2802 tree lhs = gimple_cond_lhs (gs);
2803 tree rhs = gimple_cond_rhs (gs);
2804 enum tree_code code = gimple_cond_code (gs);
2805
2806 if (lhs != boolean_true_node && lhs != boolean_false_node)
2807 return false;
2808
2809 if (rhs != boolean_true_node && rhs != boolean_false_node)
2810 return false;
2811
2812 if (code == NE_EXPR && lhs == rhs)
2813 return true;
2814
2815 if (code == EQ_EXPR && lhs != rhs)
2816 return true;
2817
2818 return false;
2819 }
2820
2821 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
2822
2823 static inline void
2824 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2825 {
2826 gimple_cond_set_code (stmt, code);
2827 gimple_cond_set_lhs (stmt, lhs);
2828 gimple_cond_set_rhs (stmt, rhs);
2829 }
2830
2831 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
2832
2833 static inline tree
2834 gimple_label_label (const_gimple gs)
2835 {
2836 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2837 return gimple_op (gs, 0);
2838 }
2839
2840
2841 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2842 GS. */
2843
2844 static inline void
2845 gimple_label_set_label (gimple gs, tree label)
2846 {
2847 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2848 gimple_set_op (gs, 0, label);
2849 }
2850
2851
2852 /* Return the destination of the unconditional jump GS. */
2853
2854 static inline tree
2855 gimple_goto_dest (const_gimple gs)
2856 {
2857 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2858 return gimple_op (gs, 0);
2859 }
2860
2861
2862 /* Set DEST to be the destination of the unconditonal jump GS. */
2863
2864 static inline void
2865 gimple_goto_set_dest (gimple gs, tree dest)
2866 {
2867 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2868 gimple_set_op (gs, 0, dest);
2869 }
2870
2871
2872 /* Return the variables declared in the GIMPLE_BIND statement GS. */
2873
2874 static inline tree
2875 gimple_bind_vars (const_gimple gs)
2876 {
2877 GIMPLE_CHECK (gs, GIMPLE_BIND);
2878 return gs->gimple_bind.vars;
2879 }
2880
2881
2882 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2883 statement GS. */
2884
2885 static inline void
2886 gimple_bind_set_vars (gimple gs, tree vars)
2887 {
2888 GIMPLE_CHECK (gs, GIMPLE_BIND);
2889 gs->gimple_bind.vars = vars;
2890 }
2891
2892
2893 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2894 statement GS. */
2895
2896 static inline void
2897 gimple_bind_append_vars (gimple gs, tree vars)
2898 {
2899 GIMPLE_CHECK (gs, GIMPLE_BIND);
2900 gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
2901 }
2902
2903
2904 static inline gimple_seq *
2905 gimple_bind_body_ptr (gimple gs)
2906 {
2907 GIMPLE_CHECK (gs, GIMPLE_BIND);
2908 return &gs->gimple_bind.body;
2909 }
2910
2911 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
2912
2913 static inline gimple_seq
2914 gimple_bind_body (gimple gs)
2915 {
2916 return *gimple_bind_body_ptr (gs);
2917 }
2918
2919
2920 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
2921 statement GS. */
2922
2923 static inline void
2924 gimple_bind_set_body (gimple gs, gimple_seq seq)
2925 {
2926 GIMPLE_CHECK (gs, GIMPLE_BIND);
2927 gs->gimple_bind.body = seq;
2928 }
2929
2930
2931 /* Append a statement to the end of a GIMPLE_BIND's body. */
2932
2933 static inline void
2934 gimple_bind_add_stmt (gimple gs, gimple stmt)
2935 {
2936 GIMPLE_CHECK (gs, GIMPLE_BIND);
2937 gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
2938 }
2939
2940
2941 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
2942
2943 static inline void
2944 gimple_bind_add_seq (gimple gs, gimple_seq seq)
2945 {
2946 GIMPLE_CHECK (gs, GIMPLE_BIND);
2947 gimple_seq_add_seq (&gs->gimple_bind.body, seq);
2948 }
2949
2950
2951 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
2952 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
2953
2954 static inline tree
2955 gimple_bind_block (const_gimple gs)
2956 {
2957 GIMPLE_CHECK (gs, GIMPLE_BIND);
2958 return gs->gimple_bind.block;
2959 }
2960
2961
2962 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
2963 statement GS. */
2964
2965 static inline void
2966 gimple_bind_set_block (gimple gs, tree block)
2967 {
2968 GIMPLE_CHECK (gs, GIMPLE_BIND);
2969 gcc_gimple_checking_assert (block == NULL_TREE
2970 || TREE_CODE (block) == BLOCK);
2971 gs->gimple_bind.block = block;
2972 }
2973
2974
2975 /* Return the number of input operands for GIMPLE_ASM GS. */
2976
2977 static inline unsigned
2978 gimple_asm_ninputs (const_gimple gs)
2979 {
2980 GIMPLE_CHECK (gs, GIMPLE_ASM);
2981 return gs->gimple_asm.ni;
2982 }
2983
2984
2985 /* Return the number of output operands for GIMPLE_ASM GS. */
2986
2987 static inline unsigned
2988 gimple_asm_noutputs (const_gimple gs)
2989 {
2990 GIMPLE_CHECK (gs, GIMPLE_ASM);
2991 return gs->gimple_asm.no;
2992 }
2993
2994
2995 /* Return the number of clobber operands for GIMPLE_ASM GS. */
2996
2997 static inline unsigned
2998 gimple_asm_nclobbers (const_gimple gs)
2999 {
3000 GIMPLE_CHECK (gs, GIMPLE_ASM);
3001 return gs->gimple_asm.nc;
3002 }
3003
3004 /* Return the number of label operands for GIMPLE_ASM GS. */
3005
3006 static inline unsigned
3007 gimple_asm_nlabels (const_gimple gs)
3008 {
3009 GIMPLE_CHECK (gs, GIMPLE_ASM);
3010 return gs->gimple_asm.nl;
3011 }
3012
3013 /* Return input operand INDEX of GIMPLE_ASM GS. */
3014
3015 static inline tree
3016 gimple_asm_input_op (const_gimple gs, unsigned index)
3017 {
3018 GIMPLE_CHECK (gs, GIMPLE_ASM);
3019 gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
3020 return gimple_op (gs, index + gs->gimple_asm.no);
3021 }
3022
3023 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
3024
3025 static inline tree *
3026 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
3027 {
3028 GIMPLE_CHECK (gs, GIMPLE_ASM);
3029 gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
3030 return gimple_op_ptr (gs, index + gs->gimple_asm.no);
3031 }
3032
3033
3034 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
3035
3036 static inline void
3037 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
3038 {
3039 GIMPLE_CHECK (gs, GIMPLE_ASM);
3040 gcc_gimple_checking_assert (index < gs->gimple_asm.ni
3041 && TREE_CODE (in_op) == TREE_LIST);
3042 gimple_set_op (gs, index + gs->gimple_asm.no, in_op);
3043 }
3044
3045
3046 /* Return output operand INDEX of GIMPLE_ASM GS. */
3047
3048 static inline tree
3049 gimple_asm_output_op (const_gimple gs, unsigned index)
3050 {
3051 GIMPLE_CHECK (gs, GIMPLE_ASM);
3052 gcc_gimple_checking_assert (index < gs->gimple_asm.no);
3053 return gimple_op (gs, index);
3054 }
3055
3056 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
3057
3058 static inline tree *
3059 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
3060 {
3061 GIMPLE_CHECK (gs, GIMPLE_ASM);
3062 gcc_gimple_checking_assert (index < gs->gimple_asm.no);
3063 return gimple_op_ptr (gs, index);
3064 }
3065
3066
3067 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
3068
3069 static inline void
3070 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
3071 {
3072 GIMPLE_CHECK (gs, GIMPLE_ASM);
3073 gcc_gimple_checking_assert (index < gs->gimple_asm.no
3074 && TREE_CODE (out_op) == TREE_LIST);
3075 gimple_set_op (gs, index, out_op);
3076 }
3077
3078
3079 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3080
3081 static inline tree
3082 gimple_asm_clobber_op (const_gimple gs, unsigned index)
3083 {
3084 GIMPLE_CHECK (gs, GIMPLE_ASM);
3085 gcc_gimple_checking_assert (index < gs->gimple_asm.nc);
3086 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
3087 }
3088
3089
3090 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3091
3092 static inline void
3093 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
3094 {
3095 GIMPLE_CHECK (gs, GIMPLE_ASM);
3096 gcc_gimple_checking_assert (index < gs->gimple_asm.nc
3097 && TREE_CODE (clobber_op) == TREE_LIST);
3098 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
3099 }
3100
3101 /* Return label operand INDEX of GIMPLE_ASM GS. */
3102
3103 static inline tree
3104 gimple_asm_label_op (const_gimple gs, unsigned index)
3105 {
3106 GIMPLE_CHECK (gs, GIMPLE_ASM);
3107 gcc_gimple_checking_assert (index < gs->gimple_asm.nl);
3108 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
3109 }
3110
3111 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3112
3113 static inline void
3114 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
3115 {
3116 GIMPLE_CHECK (gs, GIMPLE_ASM);
3117 gcc_gimple_checking_assert (index < gs->gimple_asm.nl
3118 && TREE_CODE (label_op) == TREE_LIST);
3119 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
3120 }
3121
3122 /* Return the string representing the assembly instruction in
3123 GIMPLE_ASM GS. */
3124
3125 static inline const char *
3126 gimple_asm_string (const_gimple gs)
3127 {
3128 GIMPLE_CHECK (gs, GIMPLE_ASM);
3129 return gs->gimple_asm.string;
3130 }
3131
3132
3133 /* Return true if GS is an asm statement marked volatile. */
3134
3135 static inline bool
3136 gimple_asm_volatile_p (const_gimple gs)
3137 {
3138 GIMPLE_CHECK (gs, GIMPLE_ASM);
3139 return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
3140 }
3141
3142
3143 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3144
3145 static inline void
3146 gimple_asm_set_volatile (gimple gs, bool volatile_p)
3147 {
3148 GIMPLE_CHECK (gs, GIMPLE_ASM);
3149 if (volatile_p)
3150 gs->gsbase.subcode |= GF_ASM_VOLATILE;
3151 else
3152 gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
3153 }
3154
3155
3156 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3157
3158 static inline void
3159 gimple_asm_set_input (gimple gs, bool input_p)
3160 {
3161 GIMPLE_CHECK (gs, GIMPLE_ASM);
3162 if (input_p)
3163 gs->gsbase.subcode |= GF_ASM_INPUT;
3164 else
3165 gs->gsbase.subcode &= ~GF_ASM_INPUT;
3166 }
3167
3168
3169 /* Return true if asm GS is an ASM_INPUT. */
3170
3171 static inline bool
3172 gimple_asm_input_p (const_gimple gs)
3173 {
3174 GIMPLE_CHECK (gs, GIMPLE_ASM);
3175 return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
3176 }
3177
3178
3179 /* Return the types handled by GIMPLE_CATCH statement GS. */
3180
3181 static inline tree
3182 gimple_catch_types (const_gimple gs)
3183 {
3184 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3185 return gs->gimple_catch.types;
3186 }
3187
3188
3189 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3190
3191 static inline tree *
3192 gimple_catch_types_ptr (gimple gs)
3193 {
3194 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3195 return &gs->gimple_catch.types;
3196 }
3197
3198
3199 /* Return a pointer to the GIMPLE sequence representing the body of
3200 the handler of GIMPLE_CATCH statement GS. */
3201
3202 static inline gimple_seq *
3203 gimple_catch_handler_ptr (gimple gs)
3204 {
3205 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3206 return &gs->gimple_catch.handler;
3207 }
3208
3209
3210 /* Return the GIMPLE sequence representing the body of the handler of
3211 GIMPLE_CATCH statement GS. */
3212
3213 static inline gimple_seq
3214 gimple_catch_handler (gimple gs)
3215 {
3216 return *gimple_catch_handler_ptr (gs);
3217 }
3218
3219
3220 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3221
3222 static inline void
3223 gimple_catch_set_types (gimple gs, tree t)
3224 {
3225 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3226 gs->gimple_catch.types = t;
3227 }
3228
3229
3230 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3231
3232 static inline void
3233 gimple_catch_set_handler (gimple gs, gimple_seq handler)
3234 {
3235 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3236 gs->gimple_catch.handler = handler;
3237 }
3238
3239
3240 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3241
3242 static inline tree
3243 gimple_eh_filter_types (const_gimple gs)
3244 {
3245 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3246 return gs->gimple_eh_filter.types;
3247 }
3248
3249
3250 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3251 GS. */
3252
3253 static inline tree *
3254 gimple_eh_filter_types_ptr (gimple gs)
3255 {
3256 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3257 return &gs->gimple_eh_filter.types;
3258 }
3259
3260
3261 /* Return a pointer to the sequence of statement to execute when
3262 GIMPLE_EH_FILTER statement fails. */
3263
3264 static inline gimple_seq *
3265 gimple_eh_filter_failure_ptr (gimple gs)
3266 {
3267 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3268 return &gs->gimple_eh_filter.failure;
3269 }
3270
3271
3272 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3273 statement fails. */
3274
3275 static inline gimple_seq
3276 gimple_eh_filter_failure (gimple gs)
3277 {
3278 return *gimple_eh_filter_failure_ptr (gs);
3279 }
3280
3281
3282 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3283
3284 static inline void
3285 gimple_eh_filter_set_types (gimple gs, tree types)
3286 {
3287 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3288 gs->gimple_eh_filter.types = types;
3289 }
3290
3291
3292 /* Set FAILURE to be the sequence of statements to execute on failure
3293 for GIMPLE_EH_FILTER GS. */
3294
3295 static inline void
3296 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
3297 {
3298 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3299 gs->gimple_eh_filter.failure = failure;
3300 }
3301
3302 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3303
3304 static inline tree
3305 gimple_eh_must_not_throw_fndecl (gimple gs)
3306 {
3307 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3308 return gs->gimple_eh_mnt.fndecl;
3309 }
3310
3311 /* Set the function decl to be called by GS to DECL. */
3312
3313 static inline void
3314 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
3315 {
3316 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3317 gs->gimple_eh_mnt.fndecl = decl;
3318 }
3319
3320 /* GIMPLE_EH_ELSE accessors. */
3321
3322 static inline gimple_seq *
3323 gimple_eh_else_n_body_ptr (gimple gs)
3324 {
3325 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3326 return &gs->gimple_eh_else.n_body;
3327 }
3328
3329 static inline gimple_seq
3330 gimple_eh_else_n_body (gimple gs)
3331 {
3332 return *gimple_eh_else_n_body_ptr (gs);
3333 }
3334
3335 static inline gimple_seq *
3336 gimple_eh_else_e_body_ptr (gimple gs)
3337 {
3338 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3339 return &gs->gimple_eh_else.e_body;
3340 }
3341
3342 static inline gimple_seq
3343 gimple_eh_else_e_body (gimple gs)
3344 {
3345 return *gimple_eh_else_e_body_ptr (gs);
3346 }
3347
3348 static inline void
3349 gimple_eh_else_set_n_body (gimple gs, gimple_seq seq)
3350 {
3351 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3352 gs->gimple_eh_else.n_body = seq;
3353 }
3354
3355 static inline void
3356 gimple_eh_else_set_e_body (gimple gs, gimple_seq seq)
3357 {
3358 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3359 gs->gimple_eh_else.e_body = seq;
3360 }
3361
3362 /* GIMPLE_TRY accessors. */
3363
3364 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3365 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3366
3367 static inline enum gimple_try_flags
3368 gimple_try_kind (const_gimple gs)
3369 {
3370 GIMPLE_CHECK (gs, GIMPLE_TRY);
3371 return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
3372 }
3373
3374
3375 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3376
3377 static inline void
3378 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
3379 {
3380 GIMPLE_CHECK (gs, GIMPLE_TRY);
3381 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
3382 || kind == GIMPLE_TRY_FINALLY);
3383 if (gimple_try_kind (gs) != kind)
3384 gs->gsbase.subcode = (unsigned int) kind;
3385 }
3386
3387
3388 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3389
3390 static inline bool
3391 gimple_try_catch_is_cleanup (const_gimple gs)
3392 {
3393 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
3394 return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3395 }
3396
3397
3398 /* Return a pointer to the sequence of statements used as the
3399 body for GIMPLE_TRY GS. */
3400
3401 static inline gimple_seq *
3402 gimple_try_eval_ptr (gimple gs)
3403 {
3404 GIMPLE_CHECK (gs, GIMPLE_TRY);
3405 return &gs->gimple_try.eval;
3406 }
3407
3408
3409 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3410
3411 static inline gimple_seq
3412 gimple_try_eval (gimple gs)
3413 {
3414 return *gimple_try_eval_ptr (gs);
3415 }
3416
3417
3418 /* Return a pointer to the sequence of statements used as the cleanup body for
3419 GIMPLE_TRY GS. */
3420
3421 static inline gimple_seq *
3422 gimple_try_cleanup_ptr (gimple gs)
3423 {
3424 GIMPLE_CHECK (gs, GIMPLE_TRY);
3425 return &gs->gimple_try.cleanup;
3426 }
3427
3428
3429 /* Return the sequence of statements used as the cleanup body for
3430 GIMPLE_TRY GS. */
3431
3432 static inline gimple_seq
3433 gimple_try_cleanup (gimple gs)
3434 {
3435 return *gimple_try_cleanup_ptr (gs);
3436 }
3437
3438
3439 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3440
3441 static inline void
3442 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3443 {
3444 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3445 if (catch_is_cleanup)
3446 g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3447 else
3448 g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3449 }
3450
3451
3452 /* Set EVAL to be the sequence of statements to use as the body for
3453 GIMPLE_TRY GS. */
3454
3455 static inline void
3456 gimple_try_set_eval (gimple gs, gimple_seq eval)
3457 {
3458 GIMPLE_CHECK (gs, GIMPLE_TRY);
3459 gs->gimple_try.eval = eval;
3460 }
3461
3462
3463 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3464 body for GIMPLE_TRY GS. */
3465
3466 static inline void
3467 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3468 {
3469 GIMPLE_CHECK (gs, GIMPLE_TRY);
3470 gs->gimple_try.cleanup = cleanup;
3471 }
3472
3473
3474 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3475
3476 static inline gimple_seq *
3477 gimple_wce_cleanup_ptr (gimple gs)
3478 {
3479 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3480 return &gs->gimple_wce.cleanup;
3481 }
3482
3483
3484 /* Return the cleanup sequence for cleanup statement GS. */
3485
3486 static inline gimple_seq
3487 gimple_wce_cleanup (gimple gs)
3488 {
3489 return *gimple_wce_cleanup_ptr (gs);
3490 }
3491
3492
3493 /* Set CLEANUP to be the cleanup sequence for GS. */
3494
3495 static inline void
3496 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3497 {
3498 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3499 gs->gimple_wce.cleanup = cleanup;
3500 }
3501
3502
3503 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3504
3505 static inline bool
3506 gimple_wce_cleanup_eh_only (const_gimple gs)
3507 {
3508 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3509 return gs->gsbase.subcode != 0;
3510 }
3511
3512
3513 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3514
3515 static inline void
3516 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3517 {
3518 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3519 gs->gsbase.subcode = (unsigned int) eh_only_p;
3520 }
3521
3522
3523 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3524
3525 static inline unsigned
3526 gimple_phi_capacity (const_gimple gs)
3527 {
3528 GIMPLE_CHECK (gs, GIMPLE_PHI);
3529 return gs->gimple_phi.capacity;
3530 }
3531
3532
3533 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3534 be exactly the number of incoming edges for the basic block holding
3535 GS. */
3536
3537 static inline unsigned
3538 gimple_phi_num_args (const_gimple gs)
3539 {
3540 GIMPLE_CHECK (gs, GIMPLE_PHI);
3541 return gs->gimple_phi.nargs;
3542 }
3543
3544
3545 /* Return the SSA name created by GIMPLE_PHI GS. */
3546
3547 static inline tree
3548 gimple_phi_result (const_gimple gs)
3549 {
3550 GIMPLE_CHECK (gs, GIMPLE_PHI);
3551 return gs->gimple_phi.result;
3552 }
3553
3554 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3555
3556 static inline tree *
3557 gimple_phi_result_ptr (gimple gs)
3558 {
3559 GIMPLE_CHECK (gs, GIMPLE_PHI);
3560 return &gs->gimple_phi.result;
3561 }
3562
3563 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3564
3565 static inline void
3566 gimple_phi_set_result (gimple gs, tree result)
3567 {
3568 GIMPLE_CHECK (gs, GIMPLE_PHI);
3569 gs->gimple_phi.result = result;
3570 if (result && TREE_CODE (result) == SSA_NAME)
3571 SSA_NAME_DEF_STMT (result) = gs;
3572 }
3573
3574
3575 /* Return the PHI argument corresponding to incoming edge INDEX for
3576 GIMPLE_PHI GS. */
3577
3578 static inline struct phi_arg_d *
3579 gimple_phi_arg (gimple gs, unsigned index)
3580 {
3581 GIMPLE_CHECK (gs, GIMPLE_PHI);
3582 gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
3583 return &(gs->gimple_phi.args[index]);
3584 }
3585
3586 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3587 for GIMPLE_PHI GS. */
3588
3589 static inline void
3590 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3591 {
3592 GIMPLE_CHECK (gs, GIMPLE_PHI);
3593 gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
3594 gs->gimple_phi.args[index] = *phiarg;
3595 }
3596
3597 /* Return the region number for GIMPLE_RESX GS. */
3598
3599 static inline int
3600 gimple_resx_region (const_gimple gs)
3601 {
3602 GIMPLE_CHECK (gs, GIMPLE_RESX);
3603 return gs->gimple_eh_ctrl.region;
3604 }
3605
3606 /* Set REGION to be the region number for GIMPLE_RESX GS. */
3607
3608 static inline void
3609 gimple_resx_set_region (gimple gs, int region)
3610 {
3611 GIMPLE_CHECK (gs, GIMPLE_RESX);
3612 gs->gimple_eh_ctrl.region = region;
3613 }
3614
3615 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
3616
3617 static inline int
3618 gimple_eh_dispatch_region (const_gimple gs)
3619 {
3620 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3621 return gs->gimple_eh_ctrl.region;
3622 }
3623
3624 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
3625
3626 static inline void
3627 gimple_eh_dispatch_set_region (gimple gs, int region)
3628 {
3629 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3630 gs->gimple_eh_ctrl.region = region;
3631 }
3632
3633 /* Return the number of labels associated with the switch statement GS. */
3634
3635 static inline unsigned
3636 gimple_switch_num_labels (const_gimple gs)
3637 {
3638 unsigned num_ops;
3639 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3640 num_ops = gimple_num_ops (gs);
3641 gcc_gimple_checking_assert (num_ops > 1);
3642 return num_ops - 1;
3643 }
3644
3645
3646 /* Set NLABELS to be the number of labels for the switch statement GS. */
3647
3648 static inline void
3649 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3650 {
3651 GIMPLE_CHECK (g, GIMPLE_SWITCH);
3652 gimple_set_num_ops (g, nlabels + 1);
3653 }
3654
3655
3656 /* Return the index variable used by the switch statement GS. */
3657
3658 static inline tree
3659 gimple_switch_index (const_gimple gs)
3660 {
3661 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3662 return gimple_op (gs, 0);
3663 }
3664
3665
3666 /* Return a pointer to the index variable for the switch statement GS. */
3667
3668 static inline tree *
3669 gimple_switch_index_ptr (const_gimple gs)
3670 {
3671 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3672 return gimple_op_ptr (gs, 0);
3673 }
3674
3675
3676 /* Set INDEX to be the index variable for switch statement GS. */
3677
3678 static inline void
3679 gimple_switch_set_index (gimple gs, tree index)
3680 {
3681 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3682 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3683 gimple_set_op (gs, 0, index);
3684 }
3685
3686
3687 /* Return the label numbered INDEX. The default label is 0, followed by any
3688 labels in a switch statement. */
3689
3690 static inline tree
3691 gimple_switch_label (const_gimple gs, unsigned index)
3692 {
3693 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3694 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
3695 return gimple_op (gs, index + 1);
3696 }
3697
3698 /* Set the label number INDEX to LABEL. 0 is always the default label. */
3699
3700 static inline void
3701 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3702 {
3703 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3704 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
3705 && (label == NULL_TREE
3706 || TREE_CODE (label) == CASE_LABEL_EXPR));
3707 gimple_set_op (gs, index + 1, label);
3708 }
3709
3710 /* Return the default label for a switch statement. */
3711
3712 static inline tree
3713 gimple_switch_default_label (const_gimple gs)
3714 {
3715 tree label = gimple_switch_label (gs, 0);
3716 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3717 return label;
3718 }
3719
3720 /* Set the default label for a switch statement. */
3721
3722 static inline void
3723 gimple_switch_set_default_label (gimple gs, tree label)
3724 {
3725 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3726 gimple_switch_set_label (gs, 0, label);
3727 }
3728
3729 /* Return true if GS is a GIMPLE_DEBUG statement. */
3730
3731 static inline bool
3732 is_gimple_debug (const_gimple gs)
3733 {
3734 return gimple_code (gs) == GIMPLE_DEBUG;
3735 }
3736
3737 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
3738
3739 static inline bool
3740 gimple_debug_bind_p (const_gimple s)
3741 {
3742 if (is_gimple_debug (s))
3743 return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
3744
3745 return false;
3746 }
3747
3748 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
3749
3750 static inline tree
3751 gimple_debug_bind_get_var (gimple dbg)
3752 {
3753 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3754 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3755 return gimple_op (dbg, 0);
3756 }
3757
3758 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3759 statement. */
3760
3761 static inline tree
3762 gimple_debug_bind_get_value (gimple dbg)
3763 {
3764 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3765 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3766 return gimple_op (dbg, 1);
3767 }
3768
3769 /* Return a pointer to the value bound to the variable in a
3770 GIMPLE_DEBUG bind statement. */
3771
3772 static inline tree *
3773 gimple_debug_bind_get_value_ptr (gimple dbg)
3774 {
3775 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3776 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3777 return gimple_op_ptr (dbg, 1);
3778 }
3779
3780 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
3781
3782 static inline void
3783 gimple_debug_bind_set_var (gimple dbg, tree var)
3784 {
3785 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3786 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3787 gimple_set_op (dbg, 0, var);
3788 }
3789
3790 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3791 statement. */
3792
3793 static inline void
3794 gimple_debug_bind_set_value (gimple dbg, tree value)
3795 {
3796 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3797 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3798 gimple_set_op (dbg, 1, value);
3799 }
3800
3801 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
3802 optimized away. */
3803 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
3804
3805 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
3806 statement. */
3807
3808 static inline void
3809 gimple_debug_bind_reset_value (gimple dbg)
3810 {
3811 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3812 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3813 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
3814 }
3815
3816 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
3817 value. */
3818
3819 static inline bool
3820 gimple_debug_bind_has_value_p (gimple dbg)
3821 {
3822 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3823 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3824 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
3825 }
3826
3827 #undef GIMPLE_DEBUG_BIND_NOVALUE
3828
3829 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
3830
3831 static inline bool
3832 gimple_debug_source_bind_p (const_gimple s)
3833 {
3834 if (is_gimple_debug (s))
3835 return s->gsbase.subcode == GIMPLE_DEBUG_SOURCE_BIND;
3836
3837 return false;
3838 }
3839
3840 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
3841
3842 static inline tree
3843 gimple_debug_source_bind_get_var (gimple dbg)
3844 {
3845 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3846 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3847 return gimple_op (dbg, 0);
3848 }
3849
3850 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
3851 statement. */
3852
3853 static inline tree
3854 gimple_debug_source_bind_get_value (gimple dbg)
3855 {
3856 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3857 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3858 return gimple_op (dbg, 1);
3859 }
3860
3861 /* Return a pointer to the value bound to the variable in a
3862 GIMPLE_DEBUG source bind statement. */
3863
3864 static inline tree *
3865 gimple_debug_source_bind_get_value_ptr (gimple dbg)
3866 {
3867 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3868 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3869 return gimple_op_ptr (dbg, 1);
3870 }
3871
3872 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
3873
3874 static inline void
3875 gimple_debug_source_bind_set_var (gimple dbg, tree var)
3876 {
3877 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3878 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3879 gimple_set_op (dbg, 0, var);
3880 }
3881
3882 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
3883 statement. */
3884
3885 static inline void
3886 gimple_debug_source_bind_set_value (gimple dbg, tree value)
3887 {
3888 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3889 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3890 gimple_set_op (dbg, 1, value);
3891 }
3892
3893 /* Return a pointer to the body for the OMP statement GS. */
3894
3895 static inline gimple_seq *
3896 gimple_omp_body_ptr (gimple gs)
3897 {
3898 return &gs->omp.body;
3899 }
3900
3901 /* Return the body for the OMP statement GS. */
3902
3903 static inline gimple_seq
3904 gimple_omp_body (gimple gs)
3905 {
3906 return *gimple_omp_body_ptr (gs);
3907 }
3908
3909 /* Set BODY to be the body for the OMP statement GS. */
3910
3911 static inline void
3912 gimple_omp_set_body (gimple gs, gimple_seq body)
3913 {
3914 gs->omp.body = body;
3915 }
3916
3917
3918 /* Return the name associated with OMP_CRITICAL statement GS. */
3919
3920 static inline tree
3921 gimple_omp_critical_name (const_gimple gs)
3922 {
3923 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3924 return gs->gimple_omp_critical.name;
3925 }
3926
3927
3928 /* Return a pointer to the name associated with OMP critical statement GS. */
3929
3930 static inline tree *
3931 gimple_omp_critical_name_ptr (gimple gs)
3932 {
3933 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3934 return &gs->gimple_omp_critical.name;
3935 }
3936
3937
3938 /* Set NAME to be the name associated with OMP critical statement GS. */
3939
3940 static inline void
3941 gimple_omp_critical_set_name (gimple gs, tree name)
3942 {
3943 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3944 gs->gimple_omp_critical.name = name;
3945 }
3946
3947
3948 /* Return the clauses associated with OMP_FOR GS. */
3949
3950 static inline tree
3951 gimple_omp_for_clauses (const_gimple gs)
3952 {
3953 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3954 return gs->gimple_omp_for.clauses;
3955 }
3956
3957
3958 /* Return a pointer to the OMP_FOR GS. */
3959
3960 static inline tree *
3961 gimple_omp_for_clauses_ptr (gimple gs)
3962 {
3963 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3964 return &gs->gimple_omp_for.clauses;
3965 }
3966
3967
3968 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
3969
3970 static inline void
3971 gimple_omp_for_set_clauses (gimple gs, tree clauses)
3972 {
3973 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3974 gs->gimple_omp_for.clauses = clauses;
3975 }
3976
3977
3978 /* Get the collapse count of OMP_FOR GS. */
3979
3980 static inline size_t
3981 gimple_omp_for_collapse (gimple gs)
3982 {
3983 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3984 return gs->gimple_omp_for.collapse;
3985 }
3986
3987
3988 /* Return the index variable for OMP_FOR GS. */
3989
3990 static inline tree
3991 gimple_omp_for_index (const_gimple gs, size_t i)
3992 {
3993 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3994 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3995 return gs->gimple_omp_for.iter[i].index;
3996 }
3997
3998
3999 /* Return a pointer to the index variable for OMP_FOR GS. */
4000
4001 static inline tree *
4002 gimple_omp_for_index_ptr (gimple gs, size_t i)
4003 {
4004 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4005 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4006 return &gs->gimple_omp_for.iter[i].index;
4007 }
4008
4009
4010 /* Set INDEX to be the index variable for OMP_FOR GS. */
4011
4012 static inline void
4013 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
4014 {
4015 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4016 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4017 gs->gimple_omp_for.iter[i].index = index;
4018 }
4019
4020
4021 /* Return the initial value for OMP_FOR GS. */
4022
4023 static inline tree
4024 gimple_omp_for_initial (const_gimple gs, size_t i)
4025 {
4026 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4027 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4028 return gs->gimple_omp_for.iter[i].initial;
4029 }
4030
4031
4032 /* Return a pointer to the initial value for OMP_FOR GS. */
4033
4034 static inline tree *
4035 gimple_omp_for_initial_ptr (gimple gs, size_t i)
4036 {
4037 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4038 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4039 return &gs->gimple_omp_for.iter[i].initial;
4040 }
4041
4042
4043 /* Set INITIAL to be the initial value for OMP_FOR GS. */
4044
4045 static inline void
4046 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
4047 {
4048 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4049 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4050 gs->gimple_omp_for.iter[i].initial = initial;
4051 }
4052
4053
4054 /* Return the final value for OMP_FOR GS. */
4055
4056 static inline tree
4057 gimple_omp_for_final (const_gimple gs, size_t i)
4058 {
4059 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4060 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4061 return gs->gimple_omp_for.iter[i].final;
4062 }
4063
4064
4065 /* Return a pointer to the final value for OMP_FOR GS. */
4066
4067 static inline tree *
4068 gimple_omp_for_final_ptr (gimple gs, size_t i)
4069 {
4070 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4071 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4072 return &gs->gimple_omp_for.iter[i].final;
4073 }
4074
4075
4076 /* Set FINAL to be the final value for OMP_FOR GS. */
4077
4078 static inline void
4079 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
4080 {
4081 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4082 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4083 gs->gimple_omp_for.iter[i].final = final;
4084 }
4085
4086
4087 /* Return the increment value for OMP_FOR GS. */
4088
4089 static inline tree
4090 gimple_omp_for_incr (const_gimple gs, size_t i)
4091 {
4092 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4093 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4094 return gs->gimple_omp_for.iter[i].incr;
4095 }
4096
4097
4098 /* Return a pointer to the increment value for OMP_FOR GS. */
4099
4100 static inline tree *
4101 gimple_omp_for_incr_ptr (gimple gs, size_t i)
4102 {
4103 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4104 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4105 return &gs->gimple_omp_for.iter[i].incr;
4106 }
4107
4108
4109 /* Set INCR to be the increment value for OMP_FOR GS. */
4110
4111 static inline void
4112 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
4113 {
4114 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4115 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4116 gs->gimple_omp_for.iter[i].incr = incr;
4117 }
4118
4119
4120 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4121 statement GS starts. */
4122
4123 static inline gimple_seq *
4124 gimple_omp_for_pre_body_ptr (gimple gs)
4125 {
4126 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4127 return &gs->gimple_omp_for.pre_body;
4128 }
4129
4130
4131 /* Return the sequence of statements to execute before the OMP_FOR
4132 statement GS starts. */
4133
4134 static inline gimple_seq
4135 gimple_omp_for_pre_body (gimple gs)
4136 {
4137 return *gimple_omp_for_pre_body_ptr (gs);
4138 }
4139
4140
4141 /* Set PRE_BODY to be the sequence of statements to execute before the
4142 OMP_FOR statement GS starts. */
4143
4144 static inline void
4145 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
4146 {
4147 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4148 gs->gimple_omp_for.pre_body = pre_body;
4149 }
4150
4151
4152 /* Return the clauses associated with OMP_PARALLEL GS. */
4153
4154 static inline tree
4155 gimple_omp_parallel_clauses (const_gimple gs)
4156 {
4157 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4158 return gs->gimple_omp_parallel.clauses;
4159 }
4160
4161
4162 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4163
4164 static inline tree *
4165 gimple_omp_parallel_clauses_ptr (gimple gs)
4166 {
4167 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4168 return &gs->gimple_omp_parallel.clauses;
4169 }
4170
4171
4172 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4173 GS. */
4174
4175 static inline void
4176 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
4177 {
4178 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4179 gs->gimple_omp_parallel.clauses = clauses;
4180 }
4181
4182
4183 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4184
4185 static inline tree
4186 gimple_omp_parallel_child_fn (const_gimple gs)
4187 {
4188 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4189 return gs->gimple_omp_parallel.child_fn;
4190 }
4191
4192 /* Return a pointer to the child function used to hold the body of
4193 OMP_PARALLEL GS. */
4194
4195 static inline tree *
4196 gimple_omp_parallel_child_fn_ptr (gimple gs)
4197 {
4198 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4199 return &gs->gimple_omp_parallel.child_fn;
4200 }
4201
4202
4203 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4204
4205 static inline void
4206 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
4207 {
4208 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4209 gs->gimple_omp_parallel.child_fn = child_fn;
4210 }
4211
4212
4213 /* Return the artificial argument used to send variables and values
4214 from the parent to the children threads in OMP_PARALLEL GS. */
4215
4216 static inline tree
4217 gimple_omp_parallel_data_arg (const_gimple gs)
4218 {
4219 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4220 return gs->gimple_omp_parallel.data_arg;
4221 }
4222
4223
4224 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4225
4226 static inline tree *
4227 gimple_omp_parallel_data_arg_ptr (gimple gs)
4228 {
4229 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4230 return &gs->gimple_omp_parallel.data_arg;
4231 }
4232
4233
4234 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4235
4236 static inline void
4237 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
4238 {
4239 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4240 gs->gimple_omp_parallel.data_arg = data_arg;
4241 }
4242
4243
4244 /* Return the clauses associated with OMP_TASK GS. */
4245
4246 static inline tree
4247 gimple_omp_task_clauses (const_gimple gs)
4248 {
4249 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4250 return gs->gimple_omp_parallel.clauses;
4251 }
4252
4253
4254 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4255
4256 static inline tree *
4257 gimple_omp_task_clauses_ptr (gimple gs)
4258 {
4259 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4260 return &gs->gimple_omp_parallel.clauses;
4261 }
4262
4263
4264 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4265 GS. */
4266
4267 static inline void
4268 gimple_omp_task_set_clauses (gimple gs, tree clauses)
4269 {
4270 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4271 gs->gimple_omp_parallel.clauses = clauses;
4272 }
4273
4274
4275 /* Return the child function used to hold the body of OMP_TASK GS. */
4276
4277 static inline tree
4278 gimple_omp_task_child_fn (const_gimple gs)
4279 {
4280 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4281 return gs->gimple_omp_parallel.child_fn;
4282 }
4283
4284 /* Return a pointer to the child function used to hold the body of
4285 OMP_TASK GS. */
4286
4287 static inline tree *
4288 gimple_omp_task_child_fn_ptr (gimple gs)
4289 {
4290 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4291 return &gs->gimple_omp_parallel.child_fn;
4292 }
4293
4294
4295 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4296
4297 static inline void
4298 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
4299 {
4300 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4301 gs->gimple_omp_parallel.child_fn = child_fn;
4302 }
4303
4304
4305 /* Return the artificial argument used to send variables and values
4306 from the parent to the children threads in OMP_TASK GS. */
4307
4308 static inline tree
4309 gimple_omp_task_data_arg (const_gimple gs)
4310 {
4311 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4312 return gs->gimple_omp_parallel.data_arg;
4313 }
4314
4315
4316 /* Return a pointer to the data argument for OMP_TASK GS. */
4317
4318 static inline tree *
4319 gimple_omp_task_data_arg_ptr (gimple gs)
4320 {
4321 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4322 return &gs->gimple_omp_parallel.data_arg;
4323 }
4324
4325
4326 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4327
4328 static inline void
4329 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
4330 {
4331 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4332 gs->gimple_omp_parallel.data_arg = data_arg;
4333 }
4334
4335
4336 /* Return the clauses associated with OMP_TASK GS. */
4337
4338 static inline tree
4339 gimple_omp_taskreg_clauses (const_gimple gs)
4340 {
4341 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4342 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4343 return gs->gimple_omp_parallel.clauses;
4344 }
4345
4346
4347 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4348
4349 static inline tree *
4350 gimple_omp_taskreg_clauses_ptr (gimple gs)
4351 {
4352 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4353 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4354 return &gs->gimple_omp_parallel.clauses;
4355 }
4356
4357
4358 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4359 GS. */
4360
4361 static inline void
4362 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
4363 {
4364 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4365 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4366 gs->gimple_omp_parallel.clauses = clauses;
4367 }
4368
4369
4370 /* Return the child function used to hold the body of OMP_TASK GS. */
4371
4372 static inline tree
4373 gimple_omp_taskreg_child_fn (const_gimple gs)
4374 {
4375 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4376 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4377 return gs->gimple_omp_parallel.child_fn;
4378 }
4379
4380 /* Return a pointer to the child function used to hold the body of
4381 OMP_TASK GS. */
4382
4383 static inline tree *
4384 gimple_omp_taskreg_child_fn_ptr (gimple gs)
4385 {
4386 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4387 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4388 return &gs->gimple_omp_parallel.child_fn;
4389 }
4390
4391
4392 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4393
4394 static inline void
4395 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
4396 {
4397 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4398 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4399 gs->gimple_omp_parallel.child_fn = child_fn;
4400 }
4401
4402
4403 /* Return the artificial argument used to send variables and values
4404 from the parent to the children threads in OMP_TASK GS. */
4405
4406 static inline tree
4407 gimple_omp_taskreg_data_arg (const_gimple gs)
4408 {
4409 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4410 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4411 return gs->gimple_omp_parallel.data_arg;
4412 }
4413
4414
4415 /* Return a pointer to the data argument for OMP_TASK GS. */
4416
4417 static inline tree *
4418 gimple_omp_taskreg_data_arg_ptr (gimple gs)
4419 {
4420 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4421 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4422 return &gs->gimple_omp_parallel.data_arg;
4423 }
4424
4425
4426 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4427
4428 static inline void
4429 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
4430 {
4431 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4432 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4433 gs->gimple_omp_parallel.data_arg = data_arg;
4434 }
4435
4436
4437 /* Return the copy function used to hold the body of OMP_TASK GS. */
4438
4439 static inline tree
4440 gimple_omp_task_copy_fn (const_gimple gs)
4441 {
4442 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4443 return gs->gimple_omp_task.copy_fn;
4444 }
4445
4446 /* Return a pointer to the copy function used to hold the body of
4447 OMP_TASK GS. */
4448
4449 static inline tree *
4450 gimple_omp_task_copy_fn_ptr (gimple gs)
4451 {
4452 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4453 return &gs->gimple_omp_task.copy_fn;
4454 }
4455
4456
4457 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
4458
4459 static inline void
4460 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
4461 {
4462 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4463 gs->gimple_omp_task.copy_fn = copy_fn;
4464 }
4465
4466
4467 /* Return size of the data block in bytes in OMP_TASK GS. */
4468
4469 static inline tree
4470 gimple_omp_task_arg_size (const_gimple gs)
4471 {
4472 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4473 return gs->gimple_omp_task.arg_size;
4474 }
4475
4476
4477 /* Return a pointer to the data block size for OMP_TASK GS. */
4478
4479 static inline tree *
4480 gimple_omp_task_arg_size_ptr (gimple gs)
4481 {
4482 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4483 return &gs->gimple_omp_task.arg_size;
4484 }
4485
4486
4487 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
4488
4489 static inline void
4490 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
4491 {
4492 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4493 gs->gimple_omp_task.arg_size = arg_size;
4494 }
4495
4496
4497 /* Return align of the data block in bytes in OMP_TASK GS. */
4498
4499 static inline tree
4500 gimple_omp_task_arg_align (const_gimple gs)
4501 {
4502 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4503 return gs->gimple_omp_task.arg_align;
4504 }
4505
4506
4507 /* Return a pointer to the data block align for OMP_TASK GS. */
4508
4509 static inline tree *
4510 gimple_omp_task_arg_align_ptr (gimple gs)
4511 {
4512 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4513 return &gs->gimple_omp_task.arg_align;
4514 }
4515
4516
4517 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
4518
4519 static inline void
4520 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4521 {
4522 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4523 gs->gimple_omp_task.arg_align = arg_align;
4524 }
4525
4526
4527 /* Return the clauses associated with OMP_SINGLE GS. */
4528
4529 static inline tree
4530 gimple_omp_single_clauses (const_gimple gs)
4531 {
4532 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4533 return gs->gimple_omp_single.clauses;
4534 }
4535
4536
4537 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
4538
4539 static inline tree *
4540 gimple_omp_single_clauses_ptr (gimple gs)
4541 {
4542 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4543 return &gs->gimple_omp_single.clauses;
4544 }
4545
4546
4547 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
4548
4549 static inline void
4550 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4551 {
4552 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4553 gs->gimple_omp_single.clauses = clauses;
4554 }
4555
4556
4557 /* Return the clauses associated with OMP_SECTIONS GS. */
4558
4559 static inline tree
4560 gimple_omp_sections_clauses (const_gimple gs)
4561 {
4562 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4563 return gs->gimple_omp_sections.clauses;
4564 }
4565
4566
4567 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
4568
4569 static inline tree *
4570 gimple_omp_sections_clauses_ptr (gimple gs)
4571 {
4572 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4573 return &gs->gimple_omp_sections.clauses;
4574 }
4575
4576
4577 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
4578 GS. */
4579
4580 static inline void
4581 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
4582 {
4583 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4584 gs->gimple_omp_sections.clauses = clauses;
4585 }
4586
4587
4588 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
4589 in GS. */
4590
4591 static inline tree
4592 gimple_omp_sections_control (const_gimple gs)
4593 {
4594 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4595 return gs->gimple_omp_sections.control;
4596 }
4597
4598
4599 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
4600 GS. */
4601
4602 static inline tree *
4603 gimple_omp_sections_control_ptr (gimple gs)
4604 {
4605 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4606 return &gs->gimple_omp_sections.control;
4607 }
4608
4609
4610 /* Set CONTROL to be the set of clauses associated with the
4611 GIMPLE_OMP_SECTIONS in GS. */
4612
4613 static inline void
4614 gimple_omp_sections_set_control (gimple gs, tree control)
4615 {
4616 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4617 gs->gimple_omp_sections.control = control;
4618 }
4619
4620
4621 /* Set COND to be the condition code for OMP_FOR GS. */
4622
4623 static inline void
4624 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
4625 {
4626 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4627 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
4628 && i < gs->gimple_omp_for.collapse);
4629 gs->gimple_omp_for.iter[i].cond = cond;
4630 }
4631
4632
4633 /* Return the condition code associated with OMP_FOR GS. */
4634
4635 static inline enum tree_code
4636 gimple_omp_for_cond (const_gimple gs, size_t i)
4637 {
4638 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4639 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4640 return gs->gimple_omp_for.iter[i].cond;
4641 }
4642
4643
4644 /* Set the value being stored in an atomic store. */
4645
4646 static inline void
4647 gimple_omp_atomic_store_set_val (gimple g, tree val)
4648 {
4649 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4650 g->gimple_omp_atomic_store.val = val;
4651 }
4652
4653
4654 /* Return the value being stored in an atomic store. */
4655
4656 static inline tree
4657 gimple_omp_atomic_store_val (const_gimple g)
4658 {
4659 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4660 return g->gimple_omp_atomic_store.val;
4661 }
4662
4663
4664 /* Return a pointer to the value being stored in an atomic store. */
4665
4666 static inline tree *
4667 gimple_omp_atomic_store_val_ptr (gimple g)
4668 {
4669 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4670 return &g->gimple_omp_atomic_store.val;
4671 }
4672
4673
4674 /* Set the LHS of an atomic load. */
4675
4676 static inline void
4677 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
4678 {
4679 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4680 g->gimple_omp_atomic_load.lhs = lhs;
4681 }
4682
4683
4684 /* Get the LHS of an atomic load. */
4685
4686 static inline tree
4687 gimple_omp_atomic_load_lhs (const_gimple g)
4688 {
4689 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4690 return g->gimple_omp_atomic_load.lhs;
4691 }
4692
4693
4694 /* Return a pointer to the LHS of an atomic load. */
4695
4696 static inline tree *
4697 gimple_omp_atomic_load_lhs_ptr (gimple g)
4698 {
4699 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4700 return &g->gimple_omp_atomic_load.lhs;
4701 }
4702
4703
4704 /* Set the RHS of an atomic load. */
4705
4706 static inline void
4707 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
4708 {
4709 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4710 g->gimple_omp_atomic_load.rhs = rhs;
4711 }
4712
4713
4714 /* Get the RHS of an atomic load. */
4715
4716 static inline tree
4717 gimple_omp_atomic_load_rhs (const_gimple g)
4718 {
4719 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4720 return g->gimple_omp_atomic_load.rhs;
4721 }
4722
4723
4724 /* Return a pointer to the RHS of an atomic load. */
4725
4726 static inline tree *
4727 gimple_omp_atomic_load_rhs_ptr (gimple g)
4728 {
4729 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4730 return &g->gimple_omp_atomic_load.rhs;
4731 }
4732
4733
4734 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4735
4736 static inline tree
4737 gimple_omp_continue_control_def (const_gimple g)
4738 {
4739 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4740 return g->gimple_omp_continue.control_def;
4741 }
4742
4743 /* The same as above, but return the address. */
4744
4745 static inline tree *
4746 gimple_omp_continue_control_def_ptr (gimple g)
4747 {
4748 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4749 return &g->gimple_omp_continue.control_def;
4750 }
4751
4752 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4753
4754 static inline void
4755 gimple_omp_continue_set_control_def (gimple g, tree def)
4756 {
4757 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4758 g->gimple_omp_continue.control_def = def;
4759 }
4760
4761
4762 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4763
4764 static inline tree
4765 gimple_omp_continue_control_use (const_gimple g)
4766 {
4767 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4768 return g->gimple_omp_continue.control_use;
4769 }
4770
4771
4772 /* The same as above, but return the address. */
4773
4774 static inline tree *
4775 gimple_omp_continue_control_use_ptr (gimple g)
4776 {
4777 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4778 return &g->gimple_omp_continue.control_use;
4779 }
4780
4781
4782 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4783
4784 static inline void
4785 gimple_omp_continue_set_control_use (gimple g, tree use)
4786 {
4787 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4788 g->gimple_omp_continue.control_use = use;
4789 }
4790
4791 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
4792
4793 static inline gimple_seq *
4794 gimple_transaction_body_ptr (gimple gs)
4795 {
4796 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4797 return &gs->gimple_transaction.body;
4798 }
4799
4800 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
4801
4802 static inline gimple_seq
4803 gimple_transaction_body (gimple gs)
4804 {
4805 return *gimple_transaction_body_ptr (gs);
4806 }
4807
4808 /* Return the label associated with a GIMPLE_TRANSACTION. */
4809
4810 static inline tree
4811 gimple_transaction_label (const_gimple gs)
4812 {
4813 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4814 return gs->gimple_transaction.label;
4815 }
4816
4817 static inline tree *
4818 gimple_transaction_label_ptr (gimple gs)
4819 {
4820 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4821 return &gs->gimple_transaction.label;
4822 }
4823
4824 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
4825
4826 static inline unsigned int
4827 gimple_transaction_subcode (const_gimple gs)
4828 {
4829 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4830 return gs->gsbase.subcode;
4831 }
4832
4833 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
4834
4835 static inline void
4836 gimple_transaction_set_body (gimple gs, gimple_seq body)
4837 {
4838 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4839 gs->gimple_transaction.body = body;
4840 }
4841
4842 /* Set the label associated with a GIMPLE_TRANSACTION. */
4843
4844 static inline void
4845 gimple_transaction_set_label (gimple gs, tree label)
4846 {
4847 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4848 gs->gimple_transaction.label = label;
4849 }
4850
4851 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
4852
4853 static inline void
4854 gimple_transaction_set_subcode (gimple gs, unsigned int subcode)
4855 {
4856 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4857 gs->gsbase.subcode = subcode;
4858 }
4859
4860
4861 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
4862
4863 static inline tree *
4864 gimple_return_retval_ptr (const_gimple gs)
4865 {
4866 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4867 return gimple_op_ptr (gs, 0);
4868 }
4869
4870 /* Return the return value for GIMPLE_RETURN GS. */
4871
4872 static inline tree
4873 gimple_return_retval (const_gimple gs)
4874 {
4875 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4876 return gimple_op (gs, 0);
4877 }
4878
4879
4880 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
4881
4882 static inline void
4883 gimple_return_set_retval (gimple gs, tree retval)
4884 {
4885 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4886 gimple_set_op (gs, 0, retval);
4887 }
4888
4889
4890 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
4891
4892 #define CASE_GIMPLE_OMP \
4893 case GIMPLE_OMP_PARALLEL: \
4894 case GIMPLE_OMP_TASK: \
4895 case GIMPLE_OMP_FOR: \
4896 case GIMPLE_OMP_SECTIONS: \
4897 case GIMPLE_OMP_SECTIONS_SWITCH: \
4898 case GIMPLE_OMP_SINGLE: \
4899 case GIMPLE_OMP_SECTION: \
4900 case GIMPLE_OMP_MASTER: \
4901 case GIMPLE_OMP_ORDERED: \
4902 case GIMPLE_OMP_CRITICAL: \
4903 case GIMPLE_OMP_RETURN: \
4904 case GIMPLE_OMP_ATOMIC_LOAD: \
4905 case GIMPLE_OMP_ATOMIC_STORE: \
4906 case GIMPLE_OMP_CONTINUE
4907
4908 static inline bool
4909 is_gimple_omp (const_gimple stmt)
4910 {
4911 switch (gimple_code (stmt))
4912 {
4913 CASE_GIMPLE_OMP:
4914 return true;
4915 default:
4916 return false;
4917 }
4918 }
4919
4920
4921 /* Returns TRUE if statement G is a GIMPLE_NOP. */
4922
4923 static inline bool
4924 gimple_nop_p (const_gimple g)
4925 {
4926 return gimple_code (g) == GIMPLE_NOP;
4927 }
4928
4929
4930 /* Return true if GS is a GIMPLE_RESX. */
4931
4932 static inline bool
4933 is_gimple_resx (const_gimple gs)
4934 {
4935 return gimple_code (gs) == GIMPLE_RESX;
4936 }
4937
4938 /* Return the predictor of GIMPLE_PREDICT statement GS. */
4939
4940 static inline enum br_predictor
4941 gimple_predict_predictor (gimple gs)
4942 {
4943 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4944 return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
4945 }
4946
4947
4948 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
4949
4950 static inline void
4951 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
4952 {
4953 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4954 gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
4955 | (unsigned) predictor;
4956 }
4957
4958
4959 /* Return the outcome of GIMPLE_PREDICT statement GS. */
4960
4961 static inline enum prediction
4962 gimple_predict_outcome (gimple gs)
4963 {
4964 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4965 return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
4966 }
4967
4968
4969 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
4970
4971 static inline void
4972 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
4973 {
4974 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4975 if (outcome == TAKEN)
4976 gs->gsbase.subcode |= GF_PREDICT_TAKEN;
4977 else
4978 gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
4979 }
4980
4981
4982 /* Return the type of the main expression computed by STMT. Return
4983 void_type_node if the statement computes nothing. */
4984
4985 static inline tree
4986 gimple_expr_type (const_gimple stmt)
4987 {
4988 enum gimple_code code = gimple_code (stmt);
4989
4990 if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
4991 {
4992 tree type;
4993 /* In general we want to pass out a type that can be substituted
4994 for both the RHS and the LHS types if there is a possibly
4995 useless conversion involved. That means returning the
4996 original RHS type as far as we can reconstruct it. */
4997 if (code == GIMPLE_CALL)
4998 type = gimple_call_return_type (stmt);
4999 else
5000 switch (gimple_assign_rhs_code (stmt))
5001 {
5002 case POINTER_PLUS_EXPR:
5003 type = TREE_TYPE (gimple_assign_rhs1 (stmt));
5004 break;
5005
5006 default:
5007 /* As fallback use the type of the LHS. */
5008 type = TREE_TYPE (gimple_get_lhs (stmt));
5009 break;
5010 }
5011 return type;
5012 }
5013 else if (code == GIMPLE_COND)
5014 return boolean_type_node;
5015 else
5016 return void_type_node;
5017 }
5018
5019 /* Return true if TYPE is a suitable type for a scalar register variable. */
5020
5021 static inline bool
5022 is_gimple_reg_type (tree type)
5023 {
5024 return !AGGREGATE_TYPE_P (type);
5025 }
5026
5027 /* Return a new iterator pointing to GIMPLE_SEQ's first statement. */
5028
5029 static inline gimple_stmt_iterator
5030 gsi_start_1 (gimple_seq *seq)
5031 {
5032 gimple_stmt_iterator i;
5033
5034 i.ptr = gimple_seq_first (*seq);
5035 i.seq = seq;
5036 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
5037
5038 return i;
5039 }
5040
5041 #define gsi_start(x) gsi_start_1(&(x))
5042
5043 static inline gimple_stmt_iterator
5044 gsi_none (void)
5045 {
5046 gimple_stmt_iterator i;
5047 i.ptr = NULL;
5048 i.seq = NULL;
5049 i.bb = NULL;
5050 return i;
5051 }
5052
5053 /* Return a new iterator pointing to the first statement in basic block BB. */
5054
5055 static inline gimple_stmt_iterator
5056 gsi_start_bb (basic_block bb)
5057 {
5058 gimple_stmt_iterator i;
5059 gimple_seq *seq;
5060
5061 seq = bb_seq_addr (bb);
5062 i.ptr = gimple_seq_first (*seq);
5063 i.seq = seq;
5064 i.bb = bb;
5065
5066 return i;
5067 }
5068
5069
5070 /* Return a new iterator initially pointing to GIMPLE_SEQ's last statement. */
5071
5072 static inline gimple_stmt_iterator
5073 gsi_last_1 (gimple_seq *seq)
5074 {
5075 gimple_stmt_iterator i;
5076
5077 i.ptr = gimple_seq_last (*seq);
5078 i.seq = seq;
5079 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
5080
5081 return i;
5082 }
5083
5084 #define gsi_last(x) gsi_last_1(&(x))
5085
5086 /* Return a new iterator pointing to the last statement in basic block BB. */
5087
5088 static inline gimple_stmt_iterator
5089 gsi_last_bb (basic_block bb)
5090 {
5091 gimple_stmt_iterator i;
5092 gimple_seq *seq;
5093
5094 seq = bb_seq_addr (bb);
5095 i.ptr = gimple_seq_last (*seq);
5096 i.seq = seq;
5097 i.bb = bb;
5098
5099 return i;
5100 }
5101
5102
5103 /* Return true if I is at the end of its sequence. */
5104
5105 static inline bool
5106 gsi_end_p (gimple_stmt_iterator i)
5107 {
5108 return i.ptr == NULL;
5109 }
5110
5111
5112 /* Return true if I is one statement before the end of its sequence. */
5113
5114 static inline bool
5115 gsi_one_before_end_p (gimple_stmt_iterator i)
5116 {
5117 return i.ptr != NULL && i.ptr->gsbase.next == NULL;
5118 }
5119
5120
5121 /* Advance the iterator to the next gimple statement. */
5122
5123 static inline void
5124 gsi_next (gimple_stmt_iterator *i)
5125 {
5126 i->ptr = i->ptr->gsbase.next;
5127 }
5128
5129 /* Advance the iterator to the previous gimple statement. */
5130
5131 static inline void
5132 gsi_prev (gimple_stmt_iterator *i)
5133 {
5134 gimple prev = i->ptr->gsbase.prev;
5135 if (prev->gsbase.next)
5136 i->ptr = prev;
5137 else
5138 i->ptr = NULL;
5139 }
5140
5141 /* Return the current stmt. */
5142
5143 static inline gimple
5144 gsi_stmt (gimple_stmt_iterator i)
5145 {
5146 return i.ptr;
5147 }
5148
5149 /* Return a block statement iterator that points to the first non-label
5150 statement in block BB. */
5151
5152 static inline gimple_stmt_iterator
5153 gsi_after_labels (basic_block bb)
5154 {
5155 gimple_stmt_iterator gsi = gsi_start_bb (bb);
5156
5157 while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
5158 gsi_next (&gsi);
5159
5160 return gsi;
5161 }
5162
5163 /* Advance the iterator to the next non-debug gimple statement. */
5164
5165 static inline void
5166 gsi_next_nondebug (gimple_stmt_iterator *i)
5167 {
5168 do
5169 {
5170 gsi_next (i);
5171 }
5172 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5173 }
5174
5175 /* Advance the iterator to the next non-debug gimple statement. */
5176
5177 static inline void
5178 gsi_prev_nondebug (gimple_stmt_iterator *i)
5179 {
5180 do
5181 {
5182 gsi_prev (i);
5183 }
5184 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5185 }
5186
5187 /* Return a new iterator pointing to the first non-debug statement in
5188 basic block BB. */
5189
5190 static inline gimple_stmt_iterator
5191 gsi_start_nondebug_bb (basic_block bb)
5192 {
5193 gimple_stmt_iterator i = gsi_start_bb (bb);
5194
5195 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5196 gsi_next_nondebug (&i);
5197
5198 return i;
5199 }
5200
5201 /* Return a new iterator pointing to the last non-debug statement in
5202 basic block BB. */
5203
5204 static inline gimple_stmt_iterator
5205 gsi_last_nondebug_bb (basic_block bb)
5206 {
5207 gimple_stmt_iterator i = gsi_last_bb (bb);
5208
5209 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5210 gsi_prev_nondebug (&i);
5211
5212 return i;
5213 }
5214
5215
5216 /* Return the basic block associated with this iterator. */
5217
5218 static inline basic_block
5219 gsi_bb (gimple_stmt_iterator i)
5220 {
5221 return i.bb;
5222 }
5223
5224
5225 /* Return the sequence associated with this iterator. */
5226
5227 static inline gimple_seq
5228 gsi_seq (gimple_stmt_iterator i)
5229 {
5230 return *i.seq;
5231 }
5232
5233
5234 enum gsi_iterator_update
5235 {
5236 GSI_NEW_STMT, /* Only valid when single statement is added, move
5237 iterator to it. */
5238 GSI_SAME_STMT, /* Leave the iterator at the same statement. */
5239 GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable
5240 for linking other statements in the same
5241 direction. */
5242 };
5243
5244 /* In gimple-iterator.c */
5245 gimple_stmt_iterator gsi_start_phis (basic_block);
5246 gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
5247 void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
5248 void gsi_set_stmt (gimple_stmt_iterator *, gimple);
5249 void gsi_replace (gimple_stmt_iterator *, gimple, bool);
5250 void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
5251 void gsi_insert_before (gimple_stmt_iterator *, gimple,
5252 enum gsi_iterator_update);
5253 void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
5254 enum gsi_iterator_update);
5255 void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
5256 enum gsi_iterator_update);
5257 void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
5258 enum gsi_iterator_update);
5259 void gsi_insert_after (gimple_stmt_iterator *, gimple,
5260 enum gsi_iterator_update);
5261 void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
5262 enum gsi_iterator_update);
5263 void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
5264 enum gsi_iterator_update);
5265 void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
5266 enum gsi_iterator_update);
5267 bool gsi_remove (gimple_stmt_iterator *, bool);
5268 gimple_stmt_iterator gsi_for_stmt (gimple);
5269 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
5270 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
5271 void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
5272 void gsi_insert_on_edge (edge, gimple);
5273 void gsi_insert_seq_on_edge (edge, gimple_seq);
5274 basic_block gsi_insert_on_edge_immediate (edge, gimple);
5275 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
5276 void gsi_commit_one_edge_insert (edge, basic_block *);
5277 void gsi_commit_edge_inserts (void);
5278 gimple gimple_call_copy_skip_args (gimple, bitmap);
5279
5280
5281 /* Convenience routines to walk all statements of a gimple function.
5282 Note that this is useful exclusively before the code is converted
5283 into SSA form. Once the program is in SSA form, the standard
5284 operand interface should be used to analyze/modify statements. */
5285 struct walk_stmt_info
5286 {
5287 /* Points to the current statement being walked. */
5288 gimple_stmt_iterator gsi;
5289
5290 /* Additional data that the callback functions may want to carry
5291 through the recursion. */
5292 void *info;
5293
5294 /* Pointer map used to mark visited tree nodes when calling
5295 walk_tree on each operand. If set to NULL, duplicate tree nodes
5296 will be visited more than once. */
5297 struct pointer_set_t *pset;
5298
5299 /* Operand returned by the callbacks. This is set when calling
5300 walk_gimple_seq. If the walk_stmt_fn or walk_tree_fn callback
5301 returns non-NULL, this field will contain the tree returned by
5302 the last callback. */
5303 tree callback_result;
5304
5305 /* Indicates whether the operand being examined may be replaced
5306 with something that matches is_gimple_val (if true) or something
5307 slightly more complicated (if false). "Something" technically
5308 means the common subset of is_gimple_lvalue and is_gimple_rhs,
5309 but we never try to form anything more complicated than that, so
5310 we don't bother checking.
5311
5312 Also note that CALLBACK should update this flag while walking the
5313 sub-expressions of a statement. For instance, when walking the
5314 statement 'foo (&var)', the flag VAL_ONLY will initially be set
5315 to true, however, when walking &var, the operand of that
5316 ADDR_EXPR does not need to be a GIMPLE value. */
5317 BOOL_BITFIELD val_only : 1;
5318
5319 /* True if we are currently walking the LHS of an assignment. */
5320 BOOL_BITFIELD is_lhs : 1;
5321
5322 /* Optional. Set to true by the callback functions if they made any
5323 changes. */
5324 BOOL_BITFIELD changed : 1;
5325
5326 /* True if we're interested in location information. */
5327 BOOL_BITFIELD want_locations : 1;
5328
5329 /* True if we've removed the statement that was processed. */
5330 BOOL_BITFIELD removed_stmt : 1;
5331 };
5332
5333 /* Callback for walk_gimple_stmt. Called for every statement found
5334 during traversal. The first argument points to the statement to
5335 walk. The second argument is a flag that the callback sets to
5336 'true' if it the callback handled all the operands and
5337 sub-statements of the statement (the default value of this flag is
5338 'false'). The third argument is an anonymous pointer to data
5339 to be used by the callback. */
5340 typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
5341 struct walk_stmt_info *);
5342
5343 gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
5344 struct walk_stmt_info *);
5345 gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
5346 struct walk_stmt_info *);
5347 tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
5348 struct walk_stmt_info *);
5349 tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
5350
5351 /* Enum and arrays used for allocation stats. Keep in sync with
5352 gimple.c:gimple_alloc_kind_names. */
5353 enum gimple_alloc_kind
5354 {
5355 gimple_alloc_kind_assign, /* Assignments. */
5356 gimple_alloc_kind_phi, /* PHI nodes. */
5357 gimple_alloc_kind_cond, /* Conditionals. */
5358 gimple_alloc_kind_rest, /* Everything else. */
5359 gimple_alloc_kind_all
5360 };
5361
5362 extern int gimple_alloc_counts[];
5363 extern int gimple_alloc_sizes[];
5364
5365 /* Return the allocation kind for a given stmt CODE. */
5366 static inline enum gimple_alloc_kind
5367 gimple_alloc_kind (enum gimple_code code)
5368 {
5369 switch (code)
5370 {
5371 case GIMPLE_ASSIGN:
5372 return gimple_alloc_kind_assign;
5373 case GIMPLE_PHI:
5374 return gimple_alloc_kind_phi;
5375 case GIMPLE_COND:
5376 return gimple_alloc_kind_cond;
5377 default:
5378 return gimple_alloc_kind_rest;
5379 }
5380 }
5381
5382 extern void dump_gimple_statistics (void);
5383
5384 /* In gimple-fold.c. */
5385 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
5386 tree gimple_fold_builtin (gimple);
5387 bool fold_stmt (gimple_stmt_iterator *);
5388 bool fold_stmt_inplace (gimple_stmt_iterator *);
5389 tree get_symbol_constant_value (tree);
5390 tree canonicalize_constructor_val (tree, tree);
5391 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree,
5392 enum tree_code, tree, tree);
5393 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
5394 enum tree_code, tree, tree);
5395
5396 bool gimple_val_nonnegative_real_p (tree);
5397
5398
5399 /* Set the location of all statements in SEQ to LOC. */
5400
5401 static inline void
5402 gimple_seq_set_location (gimple_seq seq, location_t loc)
5403 {
5404 for (gimple_stmt_iterator i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
5405 gimple_set_location (gsi_stmt (i), loc);
5406 }
5407
5408 #endif /* GCC_GIMPLE_H */