rs6000: inline ldouble __gcc_qsub
[official-gcc.git] / gcc / gimple.h
blob479a1c70b1f1bb437b13c442ad6d2b600abf6a5c
1 /* Gimple IR definitions.
3 Copyright (C) 2007-2021 Free Software Foundation, Inc.
4 Contributed by Aldy Hernandez <aldyh@redhat.com>
6 This file is part of GCC.
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.
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.
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/>. */
22 #ifndef GCC_GIMPLE_H
23 #define GCC_GIMPLE_H
25 #include "tree-ssa-alias.h"
26 #include "gimple-expr.h"
28 typedef gimple *gimple_seq_node;
30 enum gimple_code {
31 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
32 #include "gimple.def"
33 #undef DEFGSCODE
34 LAST_AND_UNUSED_GIMPLE_CODE
37 extern const char *const gimple_code_name[];
38 extern const unsigned char gimple_rhs_class_table[];
40 /* Strip the outermost pointer, from tr1/type_traits. */
41 template<typename T> struct remove_pointer { typedef T type; };
42 template<typename T> struct remove_pointer<T *> { typedef T type; };
44 /* Error out if a gimple tuple is addressed incorrectly. */
45 #if defined ENABLE_GIMPLE_CHECKING
46 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
47 extern void gimple_check_failed (const gimple *, const char *, int, \
48 const char *, enum gimple_code, \
49 enum tree_code) ATTRIBUTE_NORETURN \
50 ATTRIBUTE_COLD;
52 #define GIMPLE_CHECK(GS, CODE) \
53 do { \
54 const gimple *__gs = (GS); \
55 if (gimple_code (__gs) != (CODE)) \
56 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
57 (CODE), ERROR_MARK); \
58 } while (0)
59 template <typename T>
60 static inline T
61 GIMPLE_CHECK2(const gimple *gs,
62 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
63 const char *file = __builtin_FILE (),
64 int line = __builtin_LINE (),
65 const char *fun = __builtin_FUNCTION ())
66 #else
67 const char *file = __FILE__,
68 int line = __LINE__,
69 const char *fun = NULL)
70 #endif
72 T ret = dyn_cast <T> (gs);
73 if (!ret)
74 gimple_check_failed (gs, file, line, fun,
75 remove_pointer<T>::type::code_, ERROR_MARK);
76 return ret;
78 template <typename T>
79 static inline T
80 GIMPLE_CHECK2(gimple *gs,
81 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
82 const char *file = __builtin_FILE (),
83 int line = __builtin_LINE (),
84 const char *fun = __builtin_FUNCTION ())
85 #else
86 const char *file = __FILE__,
87 int line = __LINE__,
88 const char *fun = NULL)
89 #endif
91 T ret = dyn_cast <T> (gs);
92 if (!ret)
93 gimple_check_failed (gs, file, line, fun,
94 remove_pointer<T>::type::code_, ERROR_MARK);
95 return ret;
97 #else /* not ENABLE_GIMPLE_CHECKING */
98 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
99 #define GIMPLE_CHECK(GS, CODE) (void)0
100 template <typename T>
101 static inline T
102 GIMPLE_CHECK2(gimple *gs)
104 return as_a <T> (gs);
106 template <typename T>
107 static inline T
108 GIMPLE_CHECK2(const gimple *gs)
110 return as_a <T> (gs);
112 #endif
114 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
115 get_gimple_rhs_class. */
116 enum gimple_rhs_class
118 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
119 GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
120 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
121 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
122 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
123 name, a _DECL, a _REF, etc. */
126 /* Specific flags for individual GIMPLE statements. These flags are
127 always stored in gimple.subcode and they may only be
128 defined for statement codes that do not use subcodes.
130 Values for the masks can overlap as long as the overlapping values
131 are never used in the same statement class.
133 The maximum mask value that can be defined is 1 << 15 (i.e., each
134 statement code can hold up to 16 bitflags).
136 Keep this list sorted. */
137 enum gf_mask {
138 GF_ASM_INPUT = 1 << 0,
139 GF_ASM_VOLATILE = 1 << 1,
140 GF_ASM_INLINE = 1 << 2,
141 GF_CALL_FROM_THUNK = 1 << 0,
142 GF_CALL_RETURN_SLOT_OPT = 1 << 1,
143 GF_CALL_TAILCALL = 1 << 2,
144 GF_CALL_VA_ARG_PACK = 1 << 3,
145 GF_CALL_NOTHROW = 1 << 4,
146 GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
147 GF_CALL_INTERNAL = 1 << 6,
148 GF_CALL_CTRL_ALTERING = 1 << 7,
149 GF_CALL_MUST_TAIL_CALL = 1 << 9,
150 GF_CALL_BY_DESCRIPTOR = 1 << 10,
151 GF_CALL_NOCF_CHECK = 1 << 11,
152 GF_CALL_FROM_NEW_OR_DELETE = 1 << 12,
153 GF_OMP_PARALLEL_COMBINED = 1 << 0,
154 GF_OMP_TASK_TASKLOOP = 1 << 0,
155 GF_OMP_TASK_TASKWAIT = 1 << 1,
156 GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
157 GF_OMP_FOR_KIND_FOR = 0,
158 GF_OMP_FOR_KIND_DISTRIBUTE = 1,
159 GF_OMP_FOR_KIND_TASKLOOP = 2,
160 GF_OMP_FOR_KIND_OACC_LOOP = 4,
161 GF_OMP_FOR_KIND_SIMD = 5,
162 GF_OMP_FOR_COMBINED = 1 << 3,
163 GF_OMP_FOR_COMBINED_INTO = 1 << 4,
164 GF_OMP_TARGET_KIND_MASK = (1 << 5) - 1,
165 GF_OMP_TARGET_KIND_REGION = 0,
166 GF_OMP_TARGET_KIND_DATA = 1,
167 GF_OMP_TARGET_KIND_UPDATE = 2,
168 GF_OMP_TARGET_KIND_ENTER_DATA = 3,
169 GF_OMP_TARGET_KIND_EXIT_DATA = 4,
170 GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
171 GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
172 GF_OMP_TARGET_KIND_OACC_SERIAL = 7,
173 GF_OMP_TARGET_KIND_OACC_DATA = 8,
174 GF_OMP_TARGET_KIND_OACC_UPDATE = 9,
175 GF_OMP_TARGET_KIND_OACC_ENTER_DATA = 10,
176 GF_OMP_TARGET_KIND_OACC_EXIT_DATA = 11,
177 GF_OMP_TARGET_KIND_OACC_DECLARE = 12,
178 GF_OMP_TARGET_KIND_OACC_HOST_DATA = 13,
179 /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
180 decomposed part, parallelized. */
181 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED = 14,
182 /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
183 decomposed part, "gang-single". */
184 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE = 15,
185 /* A 'GF_OMP_TARGET_KIND_OACC_DATA' representing an OpenACC 'kernels'
186 decomposed parts' 'data' construct. */
187 GF_OMP_TARGET_KIND_OACC_DATA_KERNELS = 16,
188 GF_OMP_TEAMS_HOST = 1 << 0,
190 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
191 a thread synchronization via some sort of barrier. The exact barrier
192 that would otherwise be emitted is dependent on the OMP statement with
193 which this return is associated. */
194 GF_OMP_RETURN_NOWAIT = 1 << 0,
196 GF_OMP_SECTION_LAST = 1 << 0,
197 GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 3) - 1,
198 GF_OMP_ATOMIC_NEED_VALUE = 1 << 3,
199 GF_PREDICT_TAKEN = 1 << 15
202 /* This subcode tells apart different kinds of stmts that are not used
203 for codegen, but rather to retain debug information. */
204 enum gimple_debug_subcode {
205 GIMPLE_DEBUG_BIND = 0,
206 GIMPLE_DEBUG_SOURCE_BIND = 1,
207 GIMPLE_DEBUG_BEGIN_STMT = 2,
208 GIMPLE_DEBUG_INLINE_ENTRY = 3
211 /* Masks for selecting a pass local flag (PLF) to work on. These
212 masks are used by gimple_set_plf and gimple_plf. */
213 enum plf_mask {
214 GF_PLF_1 = 1 << 0,
215 GF_PLF_2 = 1 << 1
218 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
219 are for 64 bit hosts. */
221 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
222 chain_next ("%h.next"), variable_size))
223 gimple
225 /* [ WORD 1 ]
226 Main identifying code for a tuple. */
227 ENUM_BITFIELD(gimple_code) code : 8;
229 /* Nonzero if a warning should not be emitted on this tuple. */
230 unsigned int no_warning : 1;
232 /* Nonzero if this tuple has been visited. Passes are responsible
233 for clearing this bit before using it. */
234 unsigned int visited : 1;
236 /* Nonzero if this tuple represents a non-temporal move. */
237 unsigned int nontemporal_move : 1;
239 /* Pass local flags. These flags are free for any pass to use as
240 they see fit. Passes should not assume that these flags contain
241 any useful value when the pass starts. Any initial state that
242 the pass requires should be set on entry to the pass. See
243 gimple_set_plf and gimple_plf for usage. */
244 unsigned int plf : 2;
246 /* Nonzero if this statement has been modified and needs to have its
247 operands rescanned. */
248 unsigned modified : 1;
250 /* Nonzero if this statement contains volatile operands. */
251 unsigned has_volatile_ops : 1;
253 /* Padding to get subcode to 16 bit alignment. */
254 unsigned pad : 1;
256 /* The SUBCODE field can be used for tuple-specific flags for tuples
257 that do not require subcodes. Note that SUBCODE should be at
258 least as wide as tree codes, as several tuples store tree codes
259 in there. */
260 unsigned int subcode : 16;
262 /* UID of this statement. This is used by passes that want to
263 assign IDs to statements. It must be assigned and used by each
264 pass. By default it should be assumed to contain garbage. */
265 unsigned uid;
267 /* [ WORD 2 ]
268 Locus information for debug info. */
269 location_t location;
271 /* Number of operands in this tuple. */
272 unsigned num_ops;
274 /* [ WORD 3 ]
275 Basic block holding this statement. */
276 basic_block bb;
278 /* [ WORD 4-5 ]
279 Linked lists of gimple statements. The next pointers form
280 a NULL terminated list, the prev pointers are a cyclic list.
281 A gimple statement is hence also a double-ended list of
282 statements, with the pointer itself being the first element,
283 and the prev pointer being the last. */
284 gimple *next;
285 gimple *GTY((skip)) prev;
289 /* Base structure for tuples with operands. */
291 /* This gimple subclass has no tag value. */
292 struct GTY(())
293 gimple_statement_with_ops_base : public gimple
295 /* [ WORD 1-6 ] : base class */
297 /* [ WORD 7 ]
298 SSA operand vectors. NOTE: It should be possible to
299 amalgamate these vectors with the operand vector OP. However,
300 the SSA operand vectors are organized differently and contain
301 more information (like immediate use chaining). */
302 struct use_optype_d GTY((skip (""))) *use_ops;
306 /* Statements that take register operands. */
308 struct GTY((tag("GSS_WITH_OPS")))
309 gimple_statement_with_ops : public gimple_statement_with_ops_base
311 /* [ WORD 1-7 ] : base class */
313 /* [ WORD 8 ]
314 Operand vector. NOTE! This must always be the last field
315 of this structure. In particular, this means that this
316 structure cannot be embedded inside another one. */
317 tree GTY((length ("%h.num_ops"))) op[1];
321 /* Base for statements that take both memory and register operands. */
323 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
324 gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
326 /* [ WORD 1-7 ] : base class */
328 /* [ WORD 8-9 ]
329 Virtual operands for this statement. The GC will pick them
330 up via the ssa_names array. */
331 tree GTY((skip (""))) vdef;
332 tree GTY((skip (""))) vuse;
336 /* Statements that take both memory and register operands. */
338 struct GTY((tag("GSS_WITH_MEM_OPS")))
339 gimple_statement_with_memory_ops :
340 public gimple_statement_with_memory_ops_base
342 /* [ WORD 1-9 ] : base class */
344 /* [ WORD 10 ]
345 Operand vector. NOTE! This must always be the last field
346 of this structure. In particular, this means that this
347 structure cannot be embedded inside another one. */
348 tree GTY((length ("%h.num_ops"))) op[1];
352 /* Call statements that take both memory and register operands. */
354 struct GTY((tag("GSS_CALL")))
355 gcall : public gimple_statement_with_memory_ops_base
357 /* [ WORD 1-9 ] : base class */
359 /* [ WORD 10-13 ] */
360 struct pt_solution call_used;
361 struct pt_solution call_clobbered;
363 /* [ WORD 14 ] */
364 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
365 tree GTY ((tag ("0"))) fntype;
366 enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
367 } u;
369 /* [ WORD 15 ]
370 Operand vector. NOTE! This must always be the last field
371 of this structure. In particular, this means that this
372 structure cannot be embedded inside another one. */
373 tree GTY((length ("%h.num_ops"))) op[1];
375 static const enum gimple_code code_ = GIMPLE_CALL;
379 /* OMP statements. */
381 struct GTY((tag("GSS_OMP")))
382 gimple_statement_omp : public gimple
384 /* [ WORD 1-6 ] : base class */
386 /* [ WORD 7 ] */
387 gimple_seq body;
391 /* GIMPLE_BIND */
393 struct GTY((tag("GSS_BIND")))
394 gbind : public gimple
396 /* [ WORD 1-6 ] : base class */
398 /* [ WORD 7 ]
399 Variables declared in this scope. */
400 tree vars;
402 /* [ WORD 8 ]
403 This is different than the BLOCK field in gimple,
404 which is analogous to TREE_BLOCK (i.e., the lexical block holding
405 this statement). This field is the equivalent of BIND_EXPR_BLOCK
406 in tree land (i.e., the lexical scope defined by this bind). See
407 gimple-low.c. */
408 tree block;
410 /* [ WORD 9 ] */
411 gimple_seq body;
415 /* GIMPLE_CATCH */
417 struct GTY((tag("GSS_CATCH")))
418 gcatch : public gimple
420 /* [ WORD 1-6 ] : base class */
422 /* [ WORD 7 ] */
423 tree types;
425 /* [ WORD 8 ] */
426 gimple_seq handler;
430 /* GIMPLE_EH_FILTER */
432 struct GTY((tag("GSS_EH_FILTER")))
433 geh_filter : public gimple
435 /* [ WORD 1-6 ] : base class */
437 /* [ WORD 7 ]
438 Filter types. */
439 tree types;
441 /* [ WORD 8 ]
442 Failure actions. */
443 gimple_seq failure;
446 /* GIMPLE_EH_ELSE */
448 struct GTY((tag("GSS_EH_ELSE")))
449 geh_else : public gimple
451 /* [ WORD 1-6 ] : base class */
453 /* [ WORD 7,8 ] */
454 gimple_seq n_body, e_body;
457 /* GIMPLE_EH_MUST_NOT_THROW */
459 struct GTY((tag("GSS_EH_MNT")))
460 geh_mnt : public gimple
462 /* [ WORD 1-6 ] : base class */
464 /* [ WORD 7 ] Abort function decl. */
465 tree fndecl;
468 /* GIMPLE_PHI */
470 struct GTY((tag("GSS_PHI")))
471 gphi : public gimple
473 /* [ WORD 1-6 ] : base class */
475 /* [ WORD 7 ] */
476 unsigned capacity;
477 unsigned nargs;
479 /* [ WORD 8 ] */
480 tree result;
482 /* [ WORD 9 ] */
483 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
487 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
489 struct GTY((tag("GSS_EH_CTRL")))
490 gimple_statement_eh_ctrl : public gimple
492 /* [ WORD 1-6 ] : base class */
494 /* [ WORD 7 ]
495 Exception region number. */
496 int region;
499 struct GTY((tag("GSS_EH_CTRL")))
500 gresx : public gimple_statement_eh_ctrl
502 /* No extra fields; adds invariant:
503 stmt->code == GIMPLE_RESX. */
506 struct GTY((tag("GSS_EH_CTRL")))
507 geh_dispatch : public gimple_statement_eh_ctrl
509 /* No extra fields; adds invariant:
510 stmt->code == GIMPLE_EH_DISPATH. */
514 /* GIMPLE_TRY */
516 struct GTY((tag("GSS_TRY")))
517 gtry : public gimple
519 /* [ WORD 1-6 ] : base class */
521 /* [ WORD 7 ]
522 Expression to evaluate. */
523 gimple_seq eval;
525 /* [ WORD 8 ]
526 Cleanup expression. */
527 gimple_seq cleanup;
530 /* Kind of GIMPLE_TRY statements. */
531 enum gimple_try_flags
533 /* A try/catch. */
534 GIMPLE_TRY_CATCH = 1 << 0,
536 /* A try/finally. */
537 GIMPLE_TRY_FINALLY = 1 << 1,
538 GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
540 /* Analogous to TRY_CATCH_IS_CLEANUP. */
541 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
544 /* GIMPLE_WITH_CLEANUP_EXPR */
546 struct GTY((tag("GSS_WCE")))
547 gimple_statement_wce : public gimple
549 /* [ WORD 1-6 ] : base class */
551 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
552 executed if an exception is thrown, not on normal exit of its
553 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
554 in TARGET_EXPRs. */
556 /* [ WORD 7 ]
557 Cleanup expression. */
558 gimple_seq cleanup;
562 /* GIMPLE_ASM */
564 struct GTY((tag("GSS_ASM")))
565 gasm : public gimple_statement_with_memory_ops_base
567 /* [ WORD 1-9 ] : base class */
569 /* [ WORD 10 ]
570 __asm__ statement. */
571 const char *string;
573 /* [ WORD 11 ]
574 Number of inputs, outputs, clobbers, labels. */
575 unsigned char ni;
576 unsigned char no;
577 unsigned char nc;
578 unsigned char nl;
580 /* [ WORD 12 ]
581 Operand vector. NOTE! This must always be the last field
582 of this structure. In particular, this means that this
583 structure cannot be embedded inside another one. */
584 tree GTY((length ("%h.num_ops"))) op[1];
587 /* GIMPLE_OMP_CRITICAL */
589 struct GTY((tag("GSS_OMP_CRITICAL")))
590 gomp_critical : public gimple_statement_omp
592 /* [ WORD 1-7 ] : base class */
594 /* [ WORD 8 ] */
595 tree clauses;
597 /* [ WORD 9 ]
598 Critical section name. */
599 tree name;
603 struct GTY(()) gimple_omp_for_iter {
604 /* Condition code. */
605 enum tree_code cond;
607 /* Index variable. */
608 tree index;
610 /* Initial value. */
611 tree initial;
613 /* Final value. */
614 tree final;
616 /* Increment. */
617 tree incr;
620 /* GIMPLE_OMP_FOR */
622 struct GTY((tag("GSS_OMP_FOR")))
623 gomp_for : public gimple_statement_omp
625 /* [ WORD 1-7 ] : base class */
627 /* [ WORD 8 ] */
628 tree clauses;
630 /* [ WORD 9 ]
631 Number of elements in iter array. */
632 size_t collapse;
634 /* [ WORD 10 ] */
635 struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
637 /* [ WORD 11 ]
638 Pre-body evaluated before the loop body begins. */
639 gimple_seq pre_body;
643 /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
645 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
646 gimple_statement_omp_parallel_layout : public gimple_statement_omp
648 /* [ WORD 1-7 ] : base class */
650 /* [ WORD 8 ]
651 Clauses. */
652 tree clauses;
654 /* [ WORD 9 ]
655 Child function holding the body of the parallel region. */
656 tree child_fn;
658 /* [ WORD 10 ]
659 Shared data argument. */
660 tree data_arg;
663 /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
664 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
665 gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
667 /* No extra fields; adds invariant:
668 stmt->code == GIMPLE_OMP_PARALLEL
669 || stmt->code == GIMPLE_OMP_TASK
670 || stmt->code == GIMPLE_OMP_TEAMS. */
673 /* GIMPLE_OMP_PARALLEL */
674 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
675 gomp_parallel : public gimple_statement_omp_taskreg
677 /* No extra fields; adds invariant:
678 stmt->code == GIMPLE_OMP_PARALLEL. */
681 /* GIMPLE_OMP_TARGET */
682 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
683 gomp_target : public gimple_statement_omp_parallel_layout
685 /* No extra fields; adds invariant:
686 stmt->code == GIMPLE_OMP_TARGET. */
689 /* GIMPLE_OMP_TASK */
691 struct GTY((tag("GSS_OMP_TASK")))
692 gomp_task : public gimple_statement_omp_taskreg
694 /* [ WORD 1-10 ] : base class */
696 /* [ WORD 11 ]
697 Child function holding firstprivate initialization if needed. */
698 tree copy_fn;
700 /* [ WORD 12-13 ]
701 Size and alignment in bytes of the argument data block. */
702 tree arg_size;
703 tree arg_align;
707 /* GIMPLE_OMP_SECTION */
708 /* Uses struct gimple_statement_omp. */
711 /* GIMPLE_OMP_SECTIONS */
713 struct GTY((tag("GSS_OMP_SECTIONS")))
714 gomp_sections : public gimple_statement_omp
716 /* [ WORD 1-7 ] : base class */
718 /* [ WORD 8 ] */
719 tree clauses;
721 /* [ WORD 9 ]
722 The control variable used for deciding which of the sections to
723 execute. */
724 tree control;
727 /* GIMPLE_OMP_CONTINUE.
729 Note: This does not inherit from gimple_statement_omp, because we
730 do not need the body field. */
732 struct GTY((tag("GSS_OMP_CONTINUE")))
733 gomp_continue : public gimple
735 /* [ WORD 1-6 ] : base class */
737 /* [ WORD 7 ] */
738 tree control_def;
740 /* [ WORD 8 ] */
741 tree control_use;
744 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
745 GIMPLE_OMP_SCAN, GIMPLE_OMP_MASKED, GIMPLE_OMP_SCOPE. */
747 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
748 gimple_statement_omp_single_layout : public gimple_statement_omp
750 /* [ WORD 1-7 ] : base class */
752 /* [ WORD 8 ] */
753 tree clauses;
756 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
757 gomp_single : public gimple_statement_omp_single_layout
759 /* No extra fields; adds invariant:
760 stmt->code == GIMPLE_OMP_SINGLE. */
763 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
764 gomp_teams : public gimple_statement_omp_taskreg
766 /* No extra fields; adds invariant:
767 stmt->code == GIMPLE_OMP_TEAMS. */
770 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
771 gomp_ordered : public gimple_statement_omp_single_layout
773 /* No extra fields; adds invariant:
774 stmt->code == GIMPLE_OMP_ORDERED. */
777 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
778 gomp_scan : public gimple_statement_omp_single_layout
780 /* No extra fields; adds invariant:
781 stmt->code == GIMPLE_OMP_SCAN. */
785 /* GIMPLE_OMP_ATOMIC_LOAD.
786 Note: This is based on gimple, not g_s_omp, because g_s_omp
787 contains a sequence, which we don't need here. */
789 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
790 gomp_atomic_load : public gimple
792 /* [ WORD 1-6 ] : base class */
794 /* [ WORD 7-8 ] */
795 tree rhs, lhs;
798 /* GIMPLE_OMP_ATOMIC_STORE.
799 See note on GIMPLE_OMP_ATOMIC_LOAD. */
801 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
802 gimple_statement_omp_atomic_store_layout : public gimple
804 /* [ WORD 1-6 ] : base class */
806 /* [ WORD 7 ] */
807 tree val;
810 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
811 gomp_atomic_store :
812 public gimple_statement_omp_atomic_store_layout
814 /* No extra fields; adds invariant:
815 stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
818 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
819 gimple_statement_omp_return :
820 public gimple_statement_omp_atomic_store_layout
822 /* No extra fields; adds invariant:
823 stmt->code == GIMPLE_OMP_RETURN. */
826 /* GIMPLE_TRANSACTION. */
828 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
830 /* The __transaction_atomic was declared [[outer]] or it is
831 __transaction_relaxed. */
832 #define GTMA_IS_OUTER (1u << 0)
833 #define GTMA_IS_RELAXED (1u << 1)
834 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
836 /* The transaction is seen to not have an abort. */
837 #define GTMA_HAVE_ABORT (1u << 2)
838 /* The transaction is seen to have loads or stores. */
839 #define GTMA_HAVE_LOAD (1u << 3)
840 #define GTMA_HAVE_STORE (1u << 4)
841 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
842 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
843 /* The transaction WILL enter serial irrevocable mode.
844 An irrevocable block post-dominates the entire transaction, such
845 that all invocations of the transaction will go serial-irrevocable.
846 In such case, we don't bother instrumenting the transaction, and
847 tell the runtime that it should begin the transaction in
848 serial-irrevocable mode. */
849 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
850 /* The transaction contains no instrumentation code whatsover, most
851 likely because it is guaranteed to go irrevocable upon entry. */
852 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
854 struct GTY((tag("GSS_TRANSACTION")))
855 gtransaction : public gimple_statement_with_memory_ops_base
857 /* [ WORD 1-9 ] : base class */
859 /* [ WORD 10 ] */
860 gimple_seq body;
862 /* [ WORD 11-13 ] */
863 tree label_norm;
864 tree label_uninst;
865 tree label_over;
868 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
869 enum gimple_statement_structure_enum {
870 #include "gsstruct.def"
871 LAST_GSS_ENUM
873 #undef DEFGSSTRUCT
875 /* A statement with the invariant that
876 stmt->code == GIMPLE_COND
877 i.e. a conditional jump statement. */
879 struct GTY((tag("GSS_WITH_OPS")))
880 gcond : public gimple_statement_with_ops
882 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
883 static const enum gimple_code code_ = GIMPLE_COND;
886 /* A statement with the invariant that
887 stmt->code == GIMPLE_DEBUG
888 i.e. a debug statement. */
890 struct GTY((tag("GSS_WITH_OPS")))
891 gdebug : public gimple_statement_with_ops
893 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
896 /* A statement with the invariant that
897 stmt->code == GIMPLE_GOTO
898 i.e. a goto statement. */
900 struct GTY((tag("GSS_WITH_OPS")))
901 ggoto : public gimple_statement_with_ops
903 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
906 /* A statement with the invariant that
907 stmt->code == GIMPLE_LABEL
908 i.e. a label statement. */
910 struct GTY((tag("GSS_WITH_OPS")))
911 glabel : public gimple_statement_with_ops
913 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
916 /* A statement with the invariant that
917 stmt->code == GIMPLE_SWITCH
918 i.e. a switch statement. */
920 struct GTY((tag("GSS_WITH_OPS")))
921 gswitch : public gimple_statement_with_ops
923 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
926 /* A statement with the invariant that
927 stmt->code == GIMPLE_ASSIGN
928 i.e. an assignment statement. */
930 struct GTY((tag("GSS_WITH_MEM_OPS")))
931 gassign : public gimple_statement_with_memory_ops
933 static const enum gimple_code code_ = GIMPLE_ASSIGN;
934 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
937 /* A statement with the invariant that
938 stmt->code == GIMPLE_RETURN
939 i.e. a return statement. */
941 struct GTY((tag("GSS_WITH_MEM_OPS")))
942 greturn : public gimple_statement_with_memory_ops
944 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
947 template <>
948 template <>
949 inline bool
950 is_a_helper <gasm *>::test (gimple *gs)
952 return gs->code == GIMPLE_ASM;
955 template <>
956 template <>
957 inline bool
958 is_a_helper <gassign *>::test (gimple *gs)
960 return gs->code == GIMPLE_ASSIGN;
963 template <>
964 template <>
965 inline bool
966 is_a_helper <const gassign *>::test (const gimple *gs)
968 return gs->code == GIMPLE_ASSIGN;
971 template <>
972 template <>
973 inline bool
974 is_a_helper <gbind *>::test (gimple *gs)
976 return gs->code == GIMPLE_BIND;
979 template <>
980 template <>
981 inline bool
982 is_a_helper <gcall *>::test (gimple *gs)
984 return gs->code == GIMPLE_CALL;
987 template <>
988 template <>
989 inline bool
990 is_a_helper <gcatch *>::test (gimple *gs)
992 return gs->code == GIMPLE_CATCH;
995 template <>
996 template <>
997 inline bool
998 is_a_helper <gcond *>::test (gimple *gs)
1000 return gs->code == GIMPLE_COND;
1003 template <>
1004 template <>
1005 inline bool
1006 is_a_helper <const gcond *>::test (const gimple *gs)
1008 return gs->code == GIMPLE_COND;
1011 template <>
1012 template <>
1013 inline bool
1014 is_a_helper <gdebug *>::test (gimple *gs)
1016 return gs->code == GIMPLE_DEBUG;
1019 template <>
1020 template <>
1021 inline bool
1022 is_a_helper <const gdebug *>::test (const gimple *gs)
1024 return gs->code == GIMPLE_DEBUG;
1027 template <>
1028 template <>
1029 inline bool
1030 is_a_helper <ggoto *>::test (gimple *gs)
1032 return gs->code == GIMPLE_GOTO;
1035 template <>
1036 template <>
1037 inline bool
1038 is_a_helper <const ggoto *>::test (const gimple *gs)
1040 return gs->code == GIMPLE_GOTO;
1043 template <>
1044 template <>
1045 inline bool
1046 is_a_helper <glabel *>::test (gimple *gs)
1048 return gs->code == GIMPLE_LABEL;
1051 template <>
1052 template <>
1053 inline bool
1054 is_a_helper <const glabel *>::test (const gimple *gs)
1056 return gs->code == GIMPLE_LABEL;
1059 template <>
1060 template <>
1061 inline bool
1062 is_a_helper <gresx *>::test (gimple *gs)
1064 return gs->code == GIMPLE_RESX;
1067 template <>
1068 template <>
1069 inline bool
1070 is_a_helper <geh_dispatch *>::test (gimple *gs)
1072 return gs->code == GIMPLE_EH_DISPATCH;
1075 template <>
1076 template <>
1077 inline bool
1078 is_a_helper <geh_else *>::test (gimple *gs)
1080 return gs->code == GIMPLE_EH_ELSE;
1083 template <>
1084 template <>
1085 inline bool
1086 is_a_helper <const geh_else *>::test (const gimple *gs)
1088 return gs->code == GIMPLE_EH_ELSE;
1091 template <>
1092 template <>
1093 inline bool
1094 is_a_helper <geh_filter *>::test (gimple *gs)
1096 return gs->code == GIMPLE_EH_FILTER;
1099 template <>
1100 template <>
1101 inline bool
1102 is_a_helper <geh_mnt *>::test (gimple *gs)
1104 return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1107 template <>
1108 template <>
1109 inline bool
1110 is_a_helper <const geh_mnt *>::test (const gimple *gs)
1112 return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1115 template <>
1116 template <>
1117 inline bool
1118 is_a_helper <gomp_atomic_load *>::test (gimple *gs)
1120 return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1123 template <>
1124 template <>
1125 inline bool
1126 is_a_helper <gomp_atomic_store *>::test (gimple *gs)
1128 return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1131 template <>
1132 template <>
1133 inline bool
1134 is_a_helper <gimple_statement_omp_return *>::test (gimple *gs)
1136 return gs->code == GIMPLE_OMP_RETURN;
1139 template <>
1140 template <>
1141 inline bool
1142 is_a_helper <gomp_continue *>::test (gimple *gs)
1144 return gs->code == GIMPLE_OMP_CONTINUE;
1147 template <>
1148 template <>
1149 inline bool
1150 is_a_helper <gomp_critical *>::test (gimple *gs)
1152 return gs->code == GIMPLE_OMP_CRITICAL;
1155 template <>
1156 template <>
1157 inline bool
1158 is_a_helper <gomp_ordered *>::test (gimple *gs)
1160 return gs->code == GIMPLE_OMP_ORDERED;
1163 template <>
1164 template <>
1165 inline bool
1166 is_a_helper <gomp_scan *>::test (gimple *gs)
1168 return gs->code == GIMPLE_OMP_SCAN;
1171 template <>
1172 template <>
1173 inline bool
1174 is_a_helper <gomp_for *>::test (gimple *gs)
1176 return gs->code == GIMPLE_OMP_FOR;
1179 template <>
1180 template <>
1181 inline bool
1182 is_a_helper <gimple_statement_omp_taskreg *>::test (gimple *gs)
1184 return (gs->code == GIMPLE_OMP_PARALLEL
1185 || gs->code == GIMPLE_OMP_TASK
1186 || gs->code == GIMPLE_OMP_TEAMS);
1189 template <>
1190 template <>
1191 inline bool
1192 is_a_helper <gomp_parallel *>::test (gimple *gs)
1194 return gs->code == GIMPLE_OMP_PARALLEL;
1197 template <>
1198 template <>
1199 inline bool
1200 is_a_helper <gomp_target *>::test (gimple *gs)
1202 return gs->code == GIMPLE_OMP_TARGET;
1205 template <>
1206 template <>
1207 inline bool
1208 is_a_helper <gomp_sections *>::test (gimple *gs)
1210 return gs->code == GIMPLE_OMP_SECTIONS;
1213 template <>
1214 template <>
1215 inline bool
1216 is_a_helper <gomp_single *>::test (gimple *gs)
1218 return gs->code == GIMPLE_OMP_SINGLE;
1221 template <>
1222 template <>
1223 inline bool
1224 is_a_helper <gomp_teams *>::test (gimple *gs)
1226 return gs->code == GIMPLE_OMP_TEAMS;
1229 template <>
1230 template <>
1231 inline bool
1232 is_a_helper <gomp_task *>::test (gimple *gs)
1234 return gs->code == GIMPLE_OMP_TASK;
1237 template <>
1238 template <>
1239 inline bool
1240 is_a_helper <gphi *>::test (gimple *gs)
1242 return gs->code == GIMPLE_PHI;
1245 template <>
1246 template <>
1247 inline bool
1248 is_a_helper <greturn *>::test (gimple *gs)
1250 return gs->code == GIMPLE_RETURN;
1253 template <>
1254 template <>
1255 inline bool
1256 is_a_helper <gswitch *>::test (gimple *gs)
1258 return gs->code == GIMPLE_SWITCH;
1261 template <>
1262 template <>
1263 inline bool
1264 is_a_helper <const gswitch *>::test (const gimple *gs)
1266 return gs->code == GIMPLE_SWITCH;
1269 template <>
1270 template <>
1271 inline bool
1272 is_a_helper <gtransaction *>::test (gimple *gs)
1274 return gs->code == GIMPLE_TRANSACTION;
1277 template <>
1278 template <>
1279 inline bool
1280 is_a_helper <gtry *>::test (gimple *gs)
1282 return gs->code == GIMPLE_TRY;
1285 template <>
1286 template <>
1287 inline bool
1288 is_a_helper <const gtry *>::test (const gimple *gs)
1290 return gs->code == GIMPLE_TRY;
1293 template <>
1294 template <>
1295 inline bool
1296 is_a_helper <gimple_statement_wce *>::test (gimple *gs)
1298 return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
1301 template <>
1302 template <>
1303 inline bool
1304 is_a_helper <const gasm *>::test (const gimple *gs)
1306 return gs->code == GIMPLE_ASM;
1309 template <>
1310 template <>
1311 inline bool
1312 is_a_helper <const gbind *>::test (const gimple *gs)
1314 return gs->code == GIMPLE_BIND;
1317 template <>
1318 template <>
1319 inline bool
1320 is_a_helper <const gcall *>::test (const gimple *gs)
1322 return gs->code == GIMPLE_CALL;
1325 template <>
1326 template <>
1327 inline bool
1328 is_a_helper <const gcatch *>::test (const gimple *gs)
1330 return gs->code == GIMPLE_CATCH;
1333 template <>
1334 template <>
1335 inline bool
1336 is_a_helper <const gresx *>::test (const gimple *gs)
1338 return gs->code == GIMPLE_RESX;
1341 template <>
1342 template <>
1343 inline bool
1344 is_a_helper <const geh_dispatch *>::test (const gimple *gs)
1346 return gs->code == GIMPLE_EH_DISPATCH;
1349 template <>
1350 template <>
1351 inline bool
1352 is_a_helper <const geh_filter *>::test (const gimple *gs)
1354 return gs->code == GIMPLE_EH_FILTER;
1357 template <>
1358 template <>
1359 inline bool
1360 is_a_helper <const gomp_atomic_load *>::test (const gimple *gs)
1362 return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1365 template <>
1366 template <>
1367 inline bool
1368 is_a_helper <const gomp_atomic_store *>::test (const gimple *gs)
1370 return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1373 template <>
1374 template <>
1375 inline bool
1376 is_a_helper <const gimple_statement_omp_return *>::test (const gimple *gs)
1378 return gs->code == GIMPLE_OMP_RETURN;
1381 template <>
1382 template <>
1383 inline bool
1384 is_a_helper <const gomp_continue *>::test (const gimple *gs)
1386 return gs->code == GIMPLE_OMP_CONTINUE;
1389 template <>
1390 template <>
1391 inline bool
1392 is_a_helper <const gomp_critical *>::test (const gimple *gs)
1394 return gs->code == GIMPLE_OMP_CRITICAL;
1397 template <>
1398 template <>
1399 inline bool
1400 is_a_helper <const gomp_ordered *>::test (const gimple *gs)
1402 return gs->code == GIMPLE_OMP_ORDERED;
1405 template <>
1406 template <>
1407 inline bool
1408 is_a_helper <const gomp_scan *>::test (const gimple *gs)
1410 return gs->code == GIMPLE_OMP_SCAN;
1413 template <>
1414 template <>
1415 inline bool
1416 is_a_helper <const gomp_for *>::test (const gimple *gs)
1418 return gs->code == GIMPLE_OMP_FOR;
1421 template <>
1422 template <>
1423 inline bool
1424 is_a_helper <const gimple_statement_omp_taskreg *>::test (const gimple *gs)
1426 return (gs->code == GIMPLE_OMP_PARALLEL
1427 || gs->code == GIMPLE_OMP_TASK
1428 || gs->code == GIMPLE_OMP_TEAMS);
1431 template <>
1432 template <>
1433 inline bool
1434 is_a_helper <const gomp_parallel *>::test (const gimple *gs)
1436 return gs->code == GIMPLE_OMP_PARALLEL;
1439 template <>
1440 template <>
1441 inline bool
1442 is_a_helper <const gomp_target *>::test (const gimple *gs)
1444 return gs->code == GIMPLE_OMP_TARGET;
1447 template <>
1448 template <>
1449 inline bool
1450 is_a_helper <const gomp_sections *>::test (const gimple *gs)
1452 return gs->code == GIMPLE_OMP_SECTIONS;
1455 template <>
1456 template <>
1457 inline bool
1458 is_a_helper <const gomp_single *>::test (const gimple *gs)
1460 return gs->code == GIMPLE_OMP_SINGLE;
1463 template <>
1464 template <>
1465 inline bool
1466 is_a_helper <const gomp_teams *>::test (const gimple *gs)
1468 return gs->code == GIMPLE_OMP_TEAMS;
1471 template <>
1472 template <>
1473 inline bool
1474 is_a_helper <const gomp_task *>::test (const gimple *gs)
1476 return gs->code == GIMPLE_OMP_TASK;
1479 template <>
1480 template <>
1481 inline bool
1482 is_a_helper <const gphi *>::test (const gimple *gs)
1484 return gs->code == GIMPLE_PHI;
1487 template <>
1488 template <>
1489 inline bool
1490 is_a_helper <const greturn *>::test (const gimple *gs)
1492 return gs->code == GIMPLE_RETURN;
1495 template <>
1496 template <>
1497 inline bool
1498 is_a_helper <const gtransaction *>::test (const gimple *gs)
1500 return gs->code == GIMPLE_TRANSACTION;
1503 /* Offset in bytes to the location of the operand vector.
1504 Zero if there is no operand vector for this tuple structure. */
1505 extern size_t const gimple_ops_offset_[];
1507 /* Map GIMPLE codes to GSS codes. */
1508 extern enum gimple_statement_structure_enum const gss_for_code_[];
1510 /* This variable holds the currently expanded gimple statement for purposes
1511 of comminucating the profile info to the builtin expanders. */
1512 extern gimple *currently_expanding_gimple_stmt;
1514 size_t gimple_size (enum gimple_code code, unsigned num_ops = 0);
1515 void gimple_init (gimple *g, enum gimple_code code, unsigned num_ops);
1516 gimple *gimple_alloc (enum gimple_code, unsigned CXX_MEM_STAT_INFO);
1517 greturn *gimple_build_return (tree);
1518 void gimple_call_reset_alias_info (gcall *);
1519 gcall *gimple_build_call_vec (tree, const vec<tree> &);
1520 gcall *gimple_build_call (tree, unsigned, ...);
1521 gcall *gimple_build_call_valist (tree, unsigned, va_list);
1522 gcall *gimple_build_call_internal (enum internal_fn, unsigned, ...);
1523 gcall *gimple_build_call_internal_vec (enum internal_fn, const vec<tree> &);
1524 gcall *gimple_build_call_from_tree (tree, tree);
1525 gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_INFO);
1526 gassign *gimple_build_assign (tree, enum tree_code,
1527 tree, tree, tree CXX_MEM_STAT_INFO);
1528 gassign *gimple_build_assign (tree, enum tree_code,
1529 tree, tree CXX_MEM_STAT_INFO);
1530 gassign *gimple_build_assign (tree, enum tree_code, tree CXX_MEM_STAT_INFO);
1531 gcond *gimple_build_cond (enum tree_code, tree, tree, tree, tree);
1532 gcond *gimple_build_cond_from_tree (tree, tree, tree);
1533 void gimple_cond_set_condition_from_tree (gcond *, tree);
1534 glabel *gimple_build_label (tree label);
1535 ggoto *gimple_build_goto (tree dest);
1536 gimple *gimple_build_nop (void);
1537 gbind *gimple_build_bind (tree, gimple_seq, tree);
1538 gasm *gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
1539 vec<tree, va_gc> *, vec<tree, va_gc> *,
1540 vec<tree, va_gc> *);
1541 gcatch *gimple_build_catch (tree, gimple_seq);
1542 geh_filter *gimple_build_eh_filter (tree, gimple_seq);
1543 geh_mnt *gimple_build_eh_must_not_throw (tree);
1544 geh_else *gimple_build_eh_else (gimple_seq, gimple_seq);
1545 gtry *gimple_build_try (gimple_seq, gimple_seq,
1546 enum gimple_try_flags);
1547 gimple *gimple_build_wce (gimple_seq);
1548 gresx *gimple_build_resx (int);
1549 gswitch *gimple_build_switch_nlabels (unsigned, tree, tree);
1550 gswitch *gimple_build_switch (tree, tree, const vec<tree> &);
1551 geh_dispatch *gimple_build_eh_dispatch (int);
1552 gdebug *gimple_build_debug_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1553 gdebug *gimple_build_debug_source_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1554 gdebug *gimple_build_debug_begin_stmt (tree, location_t CXX_MEM_STAT_INFO);
1555 gdebug *gimple_build_debug_inline_entry (tree, location_t CXX_MEM_STAT_INFO);
1556 gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
1557 gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
1558 gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
1559 gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
1560 tree, tree);
1561 gimple *gimple_build_omp_section (gimple_seq);
1562 gimple *gimple_build_omp_scope (gimple_seq, tree);
1563 gimple *gimple_build_omp_master (gimple_seq);
1564 gimple *gimple_build_omp_masked (gimple_seq, tree);
1565 gimple *gimple_build_omp_taskgroup (gimple_seq, tree);
1566 gomp_continue *gimple_build_omp_continue (tree, tree);
1567 gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
1568 gimple *gimple_build_omp_return (bool);
1569 gomp_scan *gimple_build_omp_scan (gimple_seq, tree);
1570 gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
1571 gimple *gimple_build_omp_sections_switch (void);
1572 gomp_single *gimple_build_omp_single (gimple_seq, tree);
1573 gomp_target *gimple_build_omp_target (gimple_seq, int, tree);
1574 gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
1575 gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree,
1576 enum omp_memory_order);
1577 gomp_atomic_store *gimple_build_omp_atomic_store (tree, enum omp_memory_order);
1578 gtransaction *gimple_build_transaction (gimple_seq);
1579 extern void gimple_seq_add_stmt (gimple_seq *, gimple *);
1580 extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple *);
1581 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
1582 void gimple_seq_add_seq_without_update (gimple_seq *, gimple_seq);
1583 extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
1584 location_t);
1585 extern void annotate_all_with_location (gimple_seq, location_t);
1586 bool empty_body_p (gimple_seq);
1587 gimple_seq gimple_seq_copy (gimple_seq);
1588 bool gimple_call_same_target_p (const gimple *, const gimple *);
1589 int gimple_call_flags (const gimple *);
1590 int gimple_call_arg_flags (const gcall *, unsigned);
1591 int gimple_call_return_flags (const gcall *);
1592 bool gimple_call_nonnull_result_p (gcall *);
1593 tree gimple_call_nonnull_arg (gcall *);
1594 bool gimple_assign_copy_p (gimple *);
1595 bool gimple_assign_ssa_name_copy_p (gimple *);
1596 bool gimple_assign_unary_nop_p (gimple *);
1597 void gimple_set_bb (gimple *, basic_block);
1598 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
1599 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
1600 tree, tree, tree);
1601 tree gimple_get_lhs (const gimple *);
1602 void gimple_set_lhs (gimple *, tree);
1603 gimple *gimple_copy (gimple *);
1604 void gimple_move_vops (gimple *, gimple *);
1605 bool gimple_has_side_effects (const gimple *);
1606 bool gimple_could_trap_p_1 (const gimple *, bool, bool);
1607 bool gimple_could_trap_p (const gimple *);
1608 bool gimple_assign_rhs_could_trap_p (gimple *);
1609 extern void dump_gimple_statistics (void);
1610 unsigned get_gimple_rhs_num_ops (enum tree_code);
1611 extern tree canonicalize_cond_expr_cond (tree);
1612 gcall *gimple_call_copy_skip_args (gcall *, bitmap);
1613 extern bool gimple_compare_field_offset (tree, tree);
1614 extern tree gimple_unsigned_type (tree);
1615 extern tree gimple_signed_type (tree);
1616 extern alias_set_type gimple_get_alias_set (tree);
1617 extern bool gimple_ior_addresses_taken (bitmap, gimple *);
1618 extern bool gimple_builtin_call_types_compatible_p (const gimple *, tree);
1619 extern combined_fn gimple_call_combined_fn (const gimple *);
1620 extern bool gimple_call_operator_delete_p (const gcall *);
1621 extern bool gimple_call_builtin_p (const gimple *);
1622 extern bool gimple_call_builtin_p (const gimple *, enum built_in_class);
1623 extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
1624 extern bool gimple_asm_clobbers_memory_p (const gasm *);
1625 extern void dump_decl_set (FILE *, bitmap);
1626 extern bool nonfreeing_call_p (gimple *);
1627 extern bool nonbarrier_call_p (gimple *);
1628 extern bool infer_nonnull_range (gimple *, tree);
1629 extern bool infer_nonnull_range_by_dereference (gimple *, tree);
1630 extern bool infer_nonnull_range_by_attribute (gimple *, tree);
1631 extern void sort_case_labels (vec<tree> &);
1632 extern void preprocess_case_label_vec_for_gimple (vec<tree> &, tree, tree *);
1633 extern void gimple_seq_set_location (gimple_seq, location_t);
1634 extern void gimple_seq_discard (gimple_seq);
1635 extern void maybe_remove_unused_call_args (struct function *, gimple *);
1636 extern bool gimple_inexpensive_call_p (gcall *);
1637 extern bool stmt_can_terminate_bb_p (gimple *);
1638 extern location_t gimple_or_expr_nonartificial_location (gimple *, tree);
1640 /* Return the disposition for a warning (or all warnings by default)
1641 for a statement. */
1642 extern bool warning_suppressed_p (const gimple *, opt_code = all_warnings)
1643 ATTRIBUTE_NONNULL (1);
1644 /* Set the disposition for a warning (or all warnings by default)
1645 at a location to enabled by default. */
1646 extern void suppress_warning (gimple *, opt_code = all_warnings,
1647 bool = true) ATTRIBUTE_NONNULL (1);
1649 /* Copy the warning disposition mapping from one statement to another. */
1650 extern void copy_warning (gimple *, const gimple *)
1651 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1652 /* Copy the warning disposition mapping from an expression to a statement. */
1653 extern void copy_warning (gimple *, const_tree)
1654 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1655 /* Copy the warning disposition mapping from a statement to an expression. */
1656 extern void copy_warning (tree, const gimple *)
1657 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1659 /* Formal (expression) temporary table handling: multiple occurrences of
1660 the same scalar expression are evaluated into the same temporary. */
1662 typedef struct gimple_temp_hash_elt
1664 tree val; /* Key */
1665 tree temp; /* Value */
1666 } elt_t;
1668 /* Get the number of the next statement uid to be allocated. */
1669 static inline unsigned int
1670 gimple_stmt_max_uid (struct function *fn)
1672 return fn->last_stmt_uid;
1675 /* Set the number of the next statement uid to be allocated. */
1676 static inline void
1677 set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
1679 fn->last_stmt_uid = maxid;
1682 /* Set the number of the next statement uid to be allocated. */
1683 static inline unsigned int
1684 inc_gimple_stmt_max_uid (struct function *fn)
1686 return fn->last_stmt_uid++;
1689 /* Return the first node in GIMPLE sequence S. */
1691 static inline gimple_seq_node
1692 gimple_seq_first (gimple_seq s)
1694 return s;
1698 /* Return the first statement in GIMPLE sequence S. */
1700 static inline gimple *
1701 gimple_seq_first_stmt (gimple_seq s)
1703 gimple_seq_node n = gimple_seq_first (s);
1704 return n;
1707 /* Return the first statement in GIMPLE sequence S as a gbind *,
1708 verifying that it has code GIMPLE_BIND in a checked build. */
1710 static inline gbind *
1711 gimple_seq_first_stmt_as_a_bind (gimple_seq s)
1713 gimple_seq_node n = gimple_seq_first (s);
1714 return as_a <gbind *> (n);
1718 /* Return the last node in GIMPLE sequence S. */
1720 static inline gimple_seq_node
1721 gimple_seq_last (gimple_seq s)
1723 return s ? s->prev : NULL;
1727 /* Return the last statement in GIMPLE sequence S. */
1729 static inline gimple *
1730 gimple_seq_last_stmt (gimple_seq s)
1732 gimple_seq_node n = gimple_seq_last (s);
1733 return n;
1737 /* Set the last node in GIMPLE sequence *PS to LAST. */
1739 static inline void
1740 gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1742 (*ps)->prev = last;
1746 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1748 static inline void
1749 gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1751 *ps = first;
1755 /* Return true if GIMPLE sequence S is empty. */
1757 static inline bool
1758 gimple_seq_empty_p (gimple_seq s)
1760 return s == NULL;
1763 /* Allocate a new sequence and initialize its first element with STMT. */
1765 static inline gimple_seq
1766 gimple_seq_alloc_with_stmt (gimple *stmt)
1768 gimple_seq seq = NULL;
1769 gimple_seq_add_stmt (&seq, stmt);
1770 return seq;
1774 /* Returns the sequence of statements in BB. */
1776 static inline gimple_seq
1777 bb_seq (const_basic_block bb)
1779 return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1782 static inline gimple_seq *
1783 bb_seq_addr (basic_block bb)
1785 return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1788 /* Sets the sequence of statements in BB to SEQ. */
1790 static inline void
1791 set_bb_seq (basic_block bb, gimple_seq seq)
1793 gcc_checking_assert (!(bb->flags & BB_RTL));
1794 bb->il.gimple.seq = seq;
1798 /* Return the code for GIMPLE statement G. */
1800 static inline enum gimple_code
1801 gimple_code (const gimple *g)
1803 return g->code;
1807 /* Return the GSS code used by a GIMPLE code. */
1809 static inline enum gimple_statement_structure_enum
1810 gss_for_code (enum gimple_code code)
1812 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1813 return gss_for_code_[code];
1817 /* Return which GSS code is used by GS. */
1819 static inline enum gimple_statement_structure_enum
1820 gimple_statement_structure (gimple *gs)
1822 return gss_for_code (gimple_code (gs));
1826 /* Return true if statement G has sub-statements. This is only true for
1827 High GIMPLE statements. */
1829 static inline bool
1830 gimple_has_substatements (gimple *g)
1832 switch (gimple_code (g))
1834 case GIMPLE_BIND:
1835 case GIMPLE_CATCH:
1836 case GIMPLE_EH_FILTER:
1837 case GIMPLE_EH_ELSE:
1838 case GIMPLE_TRY:
1839 case GIMPLE_OMP_FOR:
1840 case GIMPLE_OMP_MASTER:
1841 case GIMPLE_OMP_MASKED:
1842 case GIMPLE_OMP_TASKGROUP:
1843 case GIMPLE_OMP_ORDERED:
1844 case GIMPLE_OMP_SECTION:
1845 case GIMPLE_OMP_PARALLEL:
1846 case GIMPLE_OMP_TASK:
1847 case GIMPLE_OMP_SCOPE:
1848 case GIMPLE_OMP_SECTIONS:
1849 case GIMPLE_OMP_SINGLE:
1850 case GIMPLE_OMP_TARGET:
1851 case GIMPLE_OMP_TEAMS:
1852 case GIMPLE_OMP_CRITICAL:
1853 case GIMPLE_WITH_CLEANUP_EXPR:
1854 case GIMPLE_TRANSACTION:
1855 return true;
1857 default:
1858 return false;
1863 /* Return the basic block holding statement G. */
1865 static inline basic_block
1866 gimple_bb (const gimple *g)
1868 return g->bb;
1872 /* Return the lexical scope block holding statement G. */
1874 static inline tree
1875 gimple_block (const gimple *g)
1877 return LOCATION_BLOCK (g->location);
1880 /* Forward declare. */
1881 static inline void gimple_set_location (gimple *, location_t);
1883 /* Set BLOCK to be the lexical scope block holding statement G. */
1885 static inline void
1886 gimple_set_block (gimple *g, tree block)
1888 gimple_set_location (g, set_block (g->location, block));
1891 /* Return location information for statement G. */
1893 static inline location_t
1894 gimple_location (const gimple *g)
1896 return g->location;
1899 /* Return location information for statement G if g is not NULL.
1900 Otherwise, UNKNOWN_LOCATION is returned. */
1902 static inline location_t
1903 gimple_location_safe (const gimple *g)
1905 return g ? gimple_location (g) : UNKNOWN_LOCATION;
1908 /* Set location information for statement G. */
1910 static inline void
1911 gimple_set_location (gimple *g, location_t location)
1913 /* Copy the no-warning data to the statement location. */
1914 copy_warning (location, g->location);
1915 g->location = location;
1918 /* Return address of the location information for statement G. */
1920 static inline location_t *
1921 gimple_location_ptr (gimple *g)
1923 return &g->location;
1927 /* Return true if G contains location information. */
1929 static inline bool
1930 gimple_has_location (const gimple *g)
1932 return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1936 /* Return non-artificial location information for statement G. */
1938 static inline location_t
1939 gimple_nonartificial_location (const gimple *g)
1941 location_t *ploc = NULL;
1943 if (tree block = gimple_block (g))
1944 ploc = block_nonartificial_location (block);
1946 return ploc ? *ploc : gimple_location (g);
1950 /* Return the file name of the location of STMT. */
1952 static inline const char *
1953 gimple_filename (const gimple *stmt)
1955 return LOCATION_FILE (gimple_location (stmt));
1959 /* Return the line number of the location of STMT. */
1961 static inline int
1962 gimple_lineno (const gimple *stmt)
1964 return LOCATION_LINE (gimple_location (stmt));
1968 /* Determine whether SEQ is a singleton. */
1970 static inline bool
1971 gimple_seq_singleton_p (gimple_seq seq)
1973 return ((gimple_seq_first (seq) != NULL)
1974 && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1977 /* Return true if no warnings should be emitted for statement STMT. */
1979 static inline bool
1980 gimple_no_warning_p (const gimple *stmt)
1982 return stmt->no_warning;
1985 /* Set the no_warning flag of STMT to NO_WARNING. */
1987 static inline void
1988 gimple_set_no_warning (gimple *stmt, bool no_warning)
1990 stmt->no_warning = (unsigned) no_warning;
1993 /* Set the visited status on statement STMT to VISITED_P.
1995 Please note that this 'visited' property of the gimple statement is
1996 supposed to be undefined at pass boundaries. This means that a
1997 given pass should not assume it contains any useful value when the
1998 pass starts and thus can set it to any value it sees fit.
2000 You can learn more about the visited property of the gimple
2001 statement by reading the comments of the 'visited' data member of
2002 struct gimple.
2005 static inline void
2006 gimple_set_visited (gimple *stmt, bool visited_p)
2008 stmt->visited = (unsigned) visited_p;
2012 /* Return the visited status for statement STMT.
2014 Please note that this 'visited' property of the gimple statement is
2015 supposed to be undefined at pass boundaries. This means that a
2016 given pass should not assume it contains any useful value when the
2017 pass starts and thus can set it to any value it sees fit.
2019 You can learn more about the visited property of the gimple
2020 statement by reading the comments of the 'visited' data member of
2021 struct gimple. */
2023 static inline bool
2024 gimple_visited_p (gimple *stmt)
2026 return stmt->visited;
2030 /* Set pass local flag PLF on statement STMT to VAL_P.
2032 Please note that this PLF property of the gimple statement is
2033 supposed to be undefined at pass boundaries. This means that a
2034 given pass should not assume it contains any useful value when the
2035 pass starts and thus can set it to any value it sees fit.
2037 You can learn more about the PLF property by reading the comment of
2038 the 'plf' data member of struct gimple_statement_structure. */
2040 static inline void
2041 gimple_set_plf (gimple *stmt, enum plf_mask plf, bool val_p)
2043 if (val_p)
2044 stmt->plf |= (unsigned int) plf;
2045 else
2046 stmt->plf &= ~((unsigned int) plf);
2050 /* Return the value of pass local flag PLF on statement STMT.
2052 Please note that this 'plf' property of the gimple statement is
2053 supposed to be undefined at pass boundaries. This means that a
2054 given pass should not assume it contains any useful value when the
2055 pass starts and thus can set it to any value it sees fit.
2057 You can learn more about the plf property by reading the comment of
2058 the 'plf' data member of struct gimple_statement_structure. */
2060 static inline unsigned int
2061 gimple_plf (gimple *stmt, enum plf_mask plf)
2063 return stmt->plf & ((unsigned int) plf);
2067 /* Set the UID of statement.
2069 Please note that this UID property is supposed to be undefined at
2070 pass boundaries. This means that a given pass should not assume it
2071 contains any useful value when the pass starts and thus can set it
2072 to any value it sees fit. */
2074 static inline void
2075 gimple_set_uid (gimple *g, unsigned uid)
2077 g->uid = uid;
2081 /* Return the UID of statement.
2083 Please note that this UID property is supposed to be undefined at
2084 pass boundaries. This means that a given pass should not assume it
2085 contains any useful value when the pass starts and thus can set it
2086 to any value it sees fit. */
2088 static inline unsigned
2089 gimple_uid (const gimple *g)
2091 return g->uid;
2095 /* Make statement G a singleton sequence. */
2097 static inline void
2098 gimple_init_singleton (gimple *g)
2100 g->next = NULL;
2101 g->prev = g;
2105 /* Return true if GIMPLE statement G has register or memory operands. */
2107 static inline bool
2108 gimple_has_ops (const gimple *g)
2110 return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
2113 template <>
2114 template <>
2115 inline bool
2116 is_a_helper <const gimple_statement_with_ops *>::test (const gimple *gs)
2118 return gimple_has_ops (gs);
2121 template <>
2122 template <>
2123 inline bool
2124 is_a_helper <gimple_statement_with_ops *>::test (gimple *gs)
2126 return gimple_has_ops (gs);
2129 /* Return true if GIMPLE statement G has memory operands. */
2131 static inline bool
2132 gimple_has_mem_ops (const gimple *g)
2134 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
2137 template <>
2138 template <>
2139 inline bool
2140 is_a_helper <const gimple_statement_with_memory_ops *>::test (const gimple *gs)
2142 return gimple_has_mem_ops (gs);
2145 template <>
2146 template <>
2147 inline bool
2148 is_a_helper <gimple_statement_with_memory_ops *>::test (gimple *gs)
2150 return gimple_has_mem_ops (gs);
2153 /* Return the set of USE operands for statement G. */
2155 static inline struct use_optype_d *
2156 gimple_use_ops (const gimple *g)
2158 const gimple_statement_with_ops *ops_stmt =
2159 dyn_cast <const gimple_statement_with_ops *> (g);
2160 if (!ops_stmt)
2161 return NULL;
2162 return ops_stmt->use_ops;
2166 /* Set USE to be the set of USE operands for statement G. */
2168 static inline void
2169 gimple_set_use_ops (gimple *g, struct use_optype_d *use)
2171 gimple_statement_with_ops *ops_stmt =
2172 as_a <gimple_statement_with_ops *> (g);
2173 ops_stmt->use_ops = use;
2177 /* Return the single VUSE operand of the statement G. */
2179 static inline tree
2180 gimple_vuse (const gimple *g)
2182 const gimple_statement_with_memory_ops *mem_ops_stmt =
2183 dyn_cast <const gimple_statement_with_memory_ops *> (g);
2184 if (!mem_ops_stmt)
2185 return NULL_TREE;
2186 return mem_ops_stmt->vuse;
2189 /* Return the single VDEF operand of the statement G. */
2191 static inline tree
2192 gimple_vdef (const gimple *g)
2194 const gimple_statement_with_memory_ops *mem_ops_stmt =
2195 dyn_cast <const gimple_statement_with_memory_ops *> (g);
2196 if (!mem_ops_stmt)
2197 return NULL_TREE;
2198 return mem_ops_stmt->vdef;
2201 /* Return the single VUSE operand of the statement G. */
2203 static inline tree *
2204 gimple_vuse_ptr (gimple *g)
2206 gimple_statement_with_memory_ops *mem_ops_stmt =
2207 dyn_cast <gimple_statement_with_memory_ops *> (g);
2208 if (!mem_ops_stmt)
2209 return NULL;
2210 return &mem_ops_stmt->vuse;
2213 /* Return the single VDEF operand of the statement G. */
2215 static inline tree *
2216 gimple_vdef_ptr (gimple *g)
2218 gimple_statement_with_memory_ops *mem_ops_stmt =
2219 dyn_cast <gimple_statement_with_memory_ops *> (g);
2220 if (!mem_ops_stmt)
2221 return NULL;
2222 return &mem_ops_stmt->vdef;
2225 /* Set the single VUSE operand of the statement G. */
2227 static inline void
2228 gimple_set_vuse (gimple *g, tree vuse)
2230 gimple_statement_with_memory_ops *mem_ops_stmt =
2231 as_a <gimple_statement_with_memory_ops *> (g);
2232 mem_ops_stmt->vuse = vuse;
2235 /* Set the single VDEF operand of the statement G. */
2237 static inline void
2238 gimple_set_vdef (gimple *g, tree vdef)
2240 gimple_statement_with_memory_ops *mem_ops_stmt =
2241 as_a <gimple_statement_with_memory_ops *> (g);
2242 mem_ops_stmt->vdef = vdef;
2246 /* Return true if statement G has operands and the modified field has
2247 been set. */
2249 static inline bool
2250 gimple_modified_p (const gimple *g)
2252 return (gimple_has_ops (g)) ? (bool) g->modified : false;
2256 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
2257 a MODIFIED field. */
2259 static inline void
2260 gimple_set_modified (gimple *s, bool modifiedp)
2262 if (gimple_has_ops (s))
2263 s->modified = (unsigned) modifiedp;
2267 /* Return true if statement STMT contains volatile operands. */
2269 static inline bool
2270 gimple_has_volatile_ops (const gimple *stmt)
2272 if (gimple_has_mem_ops (stmt))
2273 return stmt->has_volatile_ops;
2274 else
2275 return false;
2279 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
2281 static inline void
2282 gimple_set_has_volatile_ops (gimple *stmt, bool volatilep)
2284 if (gimple_has_mem_ops (stmt))
2285 stmt->has_volatile_ops = (unsigned) volatilep;
2288 /* Return true if STMT is in a transaction. */
2290 static inline bool
2291 gimple_in_transaction (const gimple *stmt)
2293 return bb_in_transaction (gimple_bb (stmt));
2296 /* Return true if statement STMT may access memory. */
2298 static inline bool
2299 gimple_references_memory_p (gimple *stmt)
2301 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
2305 /* Return the subcode for OMP statement S. */
2307 static inline unsigned
2308 gimple_omp_subcode (const gimple *s)
2310 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
2311 && gimple_code (s) <= GIMPLE_OMP_TEAMS);
2312 return s->subcode;
2315 /* Set the subcode for OMP statement S to SUBCODE. */
2317 static inline void
2318 gimple_omp_set_subcode (gimple *s, unsigned int subcode)
2320 /* We only have 16 bits for the subcode. Assert that we are not
2321 overflowing it. */
2322 gcc_gimple_checking_assert (subcode < (1 << 16));
2323 s->subcode = subcode;
2326 /* Set the nowait flag on OMP_RETURN statement S. */
2328 static inline void
2329 gimple_omp_return_set_nowait (gimple *s)
2331 GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
2332 s->subcode |= GF_OMP_RETURN_NOWAIT;
2336 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
2337 flag set. */
2339 static inline bool
2340 gimple_omp_return_nowait_p (const gimple *g)
2342 GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
2343 return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
2347 /* Set the LHS of OMP return. */
2349 static inline void
2350 gimple_omp_return_set_lhs (gimple *g, tree lhs)
2352 gimple_statement_omp_return *omp_return_stmt =
2353 as_a <gimple_statement_omp_return *> (g);
2354 omp_return_stmt->val = lhs;
2358 /* Get the LHS of OMP return. */
2360 static inline tree
2361 gimple_omp_return_lhs (const gimple *g)
2363 const gimple_statement_omp_return *omp_return_stmt =
2364 as_a <const gimple_statement_omp_return *> (g);
2365 return omp_return_stmt->val;
2369 /* Return a pointer to the LHS of OMP return. */
2371 static inline tree *
2372 gimple_omp_return_lhs_ptr (gimple *g)
2374 gimple_statement_omp_return *omp_return_stmt =
2375 as_a <gimple_statement_omp_return *> (g);
2376 return &omp_return_stmt->val;
2380 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
2381 flag set. */
2383 static inline bool
2384 gimple_omp_section_last_p (const gimple *g)
2386 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2387 return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
2391 /* Set the GF_OMP_SECTION_LAST flag on G. */
2393 static inline void
2394 gimple_omp_section_set_last (gimple *g)
2396 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2397 g->subcode |= GF_OMP_SECTION_LAST;
2401 /* Return true if OMP parallel statement G has the
2402 GF_OMP_PARALLEL_COMBINED flag set. */
2404 static inline bool
2405 gimple_omp_parallel_combined_p (const gimple *g)
2407 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2408 return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
2412 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2413 value of COMBINED_P. */
2415 static inline void
2416 gimple_omp_parallel_set_combined_p (gimple *g, bool combined_p)
2418 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2419 if (combined_p)
2420 g->subcode |= GF_OMP_PARALLEL_COMBINED;
2421 else
2422 g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
2426 /* Return true if OMP atomic load/store statement G has the
2427 GF_OMP_ATOMIC_NEED_VALUE flag set. */
2429 static inline bool
2430 gimple_omp_atomic_need_value_p (const gimple *g)
2432 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2433 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2434 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
2438 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2440 static inline void
2441 gimple_omp_atomic_set_need_value (gimple *g)
2443 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2444 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2445 g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
2449 /* Return the memory order of the OMP atomic load/store statement G. */
2451 static inline enum omp_memory_order
2452 gimple_omp_atomic_memory_order (const gimple *g)
2454 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2455 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2456 return (enum omp_memory_order)
2457 (gimple_omp_subcode (g) & GF_OMP_ATOMIC_MEMORY_ORDER);
2461 /* Set the memory order on G. */
2463 static inline void
2464 gimple_omp_atomic_set_memory_order (gimple *g, enum omp_memory_order mo)
2466 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2467 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2468 g->subcode = ((g->subcode & ~GF_OMP_ATOMIC_MEMORY_ORDER)
2469 | (mo & GF_OMP_ATOMIC_MEMORY_ORDER));
2473 /* Return the number of operands for statement GS. */
2475 static inline unsigned
2476 gimple_num_ops (const gimple *gs)
2478 return gs->num_ops;
2482 /* Set the number of operands for statement GS. */
2484 static inline void
2485 gimple_set_num_ops (gimple *gs, unsigned num_ops)
2487 gs->num_ops = num_ops;
2491 /* Return the array of operands for statement GS. */
2493 static inline tree *
2494 gimple_ops (gimple *gs)
2496 size_t off;
2498 /* All the tuples have their operand vector at the very bottom
2499 of the structure. Note that those structures that do not
2500 have an operand vector have a zero offset. */
2501 off = gimple_ops_offset_[gimple_statement_structure (gs)];
2502 gcc_gimple_checking_assert (off != 0);
2504 return (tree *) ((char *) gs + off);
2508 /* Return operand I for statement GS. */
2510 static inline tree
2511 gimple_op (const gimple *gs, unsigned i)
2513 if (gimple_has_ops (gs))
2515 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2516 return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
2518 else
2519 return NULL_TREE;
2522 /* Return a pointer to operand I for statement GS. */
2524 static inline tree *
2525 gimple_op_ptr (gimple *gs, unsigned i)
2527 if (gimple_has_ops (gs))
2529 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2530 return gimple_ops (gs) + i;
2532 else
2533 return NULL;
2536 /* Set operand I of statement GS to OP. */
2538 static inline void
2539 gimple_set_op (gimple *gs, unsigned i, tree op)
2541 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
2543 /* Note. It may be tempting to assert that OP matches
2544 is_gimple_operand, but that would be wrong. Different tuples
2545 accept slightly different sets of tree operands. Each caller
2546 should perform its own validation. */
2547 gimple_ops (gs)[i] = op;
2550 /* Return true if GS is a GIMPLE_ASSIGN. */
2552 static inline bool
2553 is_gimple_assign (const gimple *gs)
2555 return gimple_code (gs) == GIMPLE_ASSIGN;
2558 /* Determine if expression CODE is one of the valid expressions that can
2559 be used on the RHS of GIMPLE assignments. */
2561 static inline enum gimple_rhs_class
2562 get_gimple_rhs_class (enum tree_code code)
2564 return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
2567 /* Return the LHS of assignment statement GS. */
2569 static inline tree
2570 gimple_assign_lhs (const gassign *gs)
2572 return gs->op[0];
2575 static inline tree
2576 gimple_assign_lhs (const gimple *gs)
2578 const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2579 return gimple_assign_lhs (ass);
2583 /* Return a pointer to the LHS of assignment statement GS. */
2585 static inline tree *
2586 gimple_assign_lhs_ptr (gassign *gs)
2588 return &gs->op[0];
2591 static inline tree *
2592 gimple_assign_lhs_ptr (gimple *gs)
2594 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2595 return gimple_assign_lhs_ptr (ass);
2599 /* Set LHS to be the LHS operand of assignment statement GS. */
2601 static inline void
2602 gimple_assign_set_lhs (gassign *gs, tree lhs)
2604 gs->op[0] = lhs;
2606 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2607 SSA_NAME_DEF_STMT (lhs) = gs;
2610 static inline void
2611 gimple_assign_set_lhs (gimple *gs, tree lhs)
2613 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2614 gimple_assign_set_lhs (ass, lhs);
2618 /* Return the first operand on the RHS of assignment statement GS. */
2620 static inline tree
2621 gimple_assign_rhs1 (const gassign *gs)
2623 return gs->op[1];
2626 static inline tree
2627 gimple_assign_rhs1 (const gimple *gs)
2629 const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2630 return gimple_assign_rhs1 (ass);
2634 /* Return a pointer to the first operand on the RHS of assignment
2635 statement GS. */
2637 static inline tree *
2638 gimple_assign_rhs1_ptr (gassign *gs)
2640 return &gs->op[1];
2643 static inline tree *
2644 gimple_assign_rhs1_ptr (gimple *gs)
2646 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2647 return gimple_assign_rhs1_ptr (ass);
2650 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2652 static inline void
2653 gimple_assign_set_rhs1 (gassign *gs, tree rhs)
2655 gs->op[1] = rhs;
2658 static inline void
2659 gimple_assign_set_rhs1 (gimple *gs, tree rhs)
2661 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2662 gimple_assign_set_rhs1 (ass, rhs);
2666 /* Return the second operand on the RHS of assignment statement GS.
2667 If GS does not have two operands, NULL is returned instead. */
2669 static inline tree
2670 gimple_assign_rhs2 (const gassign *gs)
2672 if (gimple_num_ops (gs) >= 3)
2673 return gs->op[2];
2674 else
2675 return NULL_TREE;
2678 static inline tree
2679 gimple_assign_rhs2 (const gimple *gs)
2681 const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2682 return gimple_assign_rhs2 (ass);
2686 /* Return a pointer to the second operand on the RHS of assignment
2687 statement GS. */
2689 static inline tree *
2690 gimple_assign_rhs2_ptr (gassign *gs)
2692 gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2693 return &gs->op[2];
2696 static inline tree *
2697 gimple_assign_rhs2_ptr (gimple *gs)
2699 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2700 return gimple_assign_rhs2_ptr (ass);
2704 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2706 static inline void
2707 gimple_assign_set_rhs2 (gassign *gs, tree rhs)
2709 gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2710 gs->op[2] = rhs;
2713 static inline void
2714 gimple_assign_set_rhs2 (gimple *gs, tree rhs)
2716 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2717 return gimple_assign_set_rhs2 (ass, rhs);
2720 /* Return the third operand on the RHS of assignment statement GS.
2721 If GS does not have two operands, NULL is returned instead. */
2723 static inline tree
2724 gimple_assign_rhs3 (const gassign *gs)
2726 if (gimple_num_ops (gs) >= 4)
2727 return gs->op[3];
2728 else
2729 return NULL_TREE;
2732 static inline tree
2733 gimple_assign_rhs3 (const gimple *gs)
2735 const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2736 return gimple_assign_rhs3 (ass);
2739 /* Return a pointer to the third operand on the RHS of assignment
2740 statement GS. */
2742 static inline tree *
2743 gimple_assign_rhs3_ptr (gimple *gs)
2745 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2746 gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2747 return &ass->op[3];
2751 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2753 static inline void
2754 gimple_assign_set_rhs3 (gassign *gs, tree rhs)
2756 gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2757 gs->op[3] = rhs;
2760 static inline void
2761 gimple_assign_set_rhs3 (gimple *gs, tree rhs)
2763 gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2764 gimple_assign_set_rhs3 (ass, rhs);
2768 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2769 which expect to see only two operands. */
2771 static inline void
2772 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2773 tree op1, tree op2)
2775 gimple_assign_set_rhs_with_ops (gsi, code, op1, op2, NULL);
2778 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2779 which expect to see only one operands. */
2781 static inline void
2782 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2783 tree op1)
2785 gimple_assign_set_rhs_with_ops (gsi, code, op1, NULL, NULL);
2788 /* Returns true if GS is a nontemporal move. */
2790 static inline bool
2791 gimple_assign_nontemporal_move_p (const gassign *gs)
2793 return gs->nontemporal_move;
2796 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2798 static inline void
2799 gimple_assign_set_nontemporal_move (gimple *gs, bool nontemporal)
2801 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2802 gs->nontemporal_move = nontemporal;
2806 /* Return the code of the expression computed on the rhs of assignment
2807 statement GS. In case that the RHS is a single object, returns the
2808 tree code of the object. */
2810 static inline enum tree_code
2811 gimple_assign_rhs_code (const gassign *gs)
2813 enum tree_code code = (enum tree_code) gs->subcode;
2814 /* While we initially set subcode to the TREE_CODE of the rhs for
2815 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2816 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2817 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2818 code = TREE_CODE (gs->op[1]);
2820 return code;
2823 static inline enum tree_code
2824 gimple_assign_rhs_code (const gimple *gs)
2826 const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2827 return gimple_assign_rhs_code (ass);
2831 /* Set CODE to be the code for the expression computed on the RHS of
2832 assignment S. */
2834 static inline void
2835 gimple_assign_set_rhs_code (gimple *s, enum tree_code code)
2837 GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2838 s->subcode = code;
2842 /* Return the gimple rhs class of the code of the expression computed on
2843 the rhs of assignment statement GS.
2844 This will never return GIMPLE_INVALID_RHS. */
2846 static inline enum gimple_rhs_class
2847 gimple_assign_rhs_class (const gimple *gs)
2849 return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2852 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2853 there is no operator associated with the assignment itself.
2854 Unlike gimple_assign_copy_p, this predicate returns true for
2855 any RHS operand, including those that perform an operation
2856 and do not have the semantics of a copy, such as COND_EXPR. */
2858 static inline bool
2859 gimple_assign_single_p (const gimple *gs)
2861 return (is_gimple_assign (gs)
2862 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2865 /* Return true if GS performs a store to its lhs. */
2867 static inline bool
2868 gimple_store_p (const gimple *gs)
2870 tree lhs = gimple_get_lhs (gs);
2871 return lhs && !is_gimple_reg (lhs);
2874 /* Return true if GS is an assignment that loads from its rhs1. */
2876 static inline bool
2877 gimple_assign_load_p (const gimple *gs)
2879 tree rhs;
2880 if (!gimple_assign_single_p (gs))
2881 return false;
2882 rhs = gimple_assign_rhs1 (gs);
2883 if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
2884 return true;
2885 rhs = get_base_address (rhs);
2886 return (DECL_P (rhs)
2887 || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
2891 /* Return true if S is a type-cast assignment. */
2893 static inline bool
2894 gimple_assign_cast_p (const gimple *s)
2896 if (is_gimple_assign (s))
2898 enum tree_code sc = gimple_assign_rhs_code (s);
2899 return CONVERT_EXPR_CODE_P (sc)
2900 || sc == VIEW_CONVERT_EXPR
2901 || sc == FIX_TRUNC_EXPR;
2904 return false;
2907 /* Return true if S is a clobber statement. */
2909 static inline bool
2910 gimple_clobber_p (const gimple *s)
2912 return gimple_assign_single_p (s)
2913 && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2916 /* Return true if GS is a GIMPLE_CALL. */
2918 static inline bool
2919 is_gimple_call (const gimple *gs)
2921 return gimple_code (gs) == GIMPLE_CALL;
2924 /* Return the LHS of call statement GS. */
2926 static inline tree
2927 gimple_call_lhs (const gcall *gs)
2929 return gs->op[0];
2932 static inline tree
2933 gimple_call_lhs (const gimple *gs)
2935 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
2936 return gimple_call_lhs (gc);
2940 /* Return a pointer to the LHS of call statement GS. */
2942 static inline tree *
2943 gimple_call_lhs_ptr (gcall *gs)
2945 return &gs->op[0];
2948 static inline tree *
2949 gimple_call_lhs_ptr (gimple *gs)
2951 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
2952 return gimple_call_lhs_ptr (gc);
2956 /* Set LHS to be the LHS operand of call statement GS. */
2958 static inline void
2959 gimple_call_set_lhs (gcall *gs, tree lhs)
2961 gs->op[0] = lhs;
2962 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2963 SSA_NAME_DEF_STMT (lhs) = gs;
2966 static inline void
2967 gimple_call_set_lhs (gimple *gs, tree lhs)
2969 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
2970 gimple_call_set_lhs (gc, lhs);
2974 /* Return true if call GS calls an internal-only function, as enumerated
2975 by internal_fn. */
2977 static inline bool
2978 gimple_call_internal_p (const gcall *gs)
2980 return (gs->subcode & GF_CALL_INTERNAL) != 0;
2983 static inline bool
2984 gimple_call_internal_p (const gimple *gs)
2986 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
2987 return gimple_call_internal_p (gc);
2990 /* Return true if call GS is marked as nocf_check. */
2992 static inline bool
2993 gimple_call_nocf_check_p (const gcall *gs)
2995 return (gs->subcode & GF_CALL_NOCF_CHECK) != 0;
2998 /* Mark statement GS as nocf_check call. */
3000 static inline void
3001 gimple_call_set_nocf_check (gcall *gs, bool nocf_check)
3003 if (nocf_check)
3004 gs->subcode |= GF_CALL_NOCF_CHECK;
3005 else
3006 gs->subcode &= ~GF_CALL_NOCF_CHECK;
3009 /* Return the target of internal call GS. */
3011 static inline enum internal_fn
3012 gimple_call_internal_fn (const gcall *gs)
3014 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
3015 return gs->u.internal_fn;
3018 static inline enum internal_fn
3019 gimple_call_internal_fn (const gimple *gs)
3021 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3022 return gimple_call_internal_fn (gc);
3025 /* Return true, if this internal gimple call is unique. */
3027 static inline bool
3028 gimple_call_internal_unique_p (const gcall *gs)
3030 return gimple_call_internal_fn (gs) == IFN_UNIQUE;
3033 static inline bool
3034 gimple_call_internal_unique_p (const gimple *gs)
3036 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3037 return gimple_call_internal_unique_p (gc);
3040 /* Return true if GS is an internal function FN. */
3042 static inline bool
3043 gimple_call_internal_p (const gimple *gs, internal_fn fn)
3045 return (is_gimple_call (gs)
3046 && gimple_call_internal_p (gs)
3047 && gimple_call_internal_fn (gs) == fn);
3050 /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
3051 that could alter control flow. */
3053 static inline void
3054 gimple_call_set_ctrl_altering (gcall *s, bool ctrl_altering_p)
3056 if (ctrl_altering_p)
3057 s->subcode |= GF_CALL_CTRL_ALTERING;
3058 else
3059 s->subcode &= ~GF_CALL_CTRL_ALTERING;
3062 static inline void
3063 gimple_call_set_ctrl_altering (gimple *s, bool ctrl_altering_p)
3065 gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3066 gimple_call_set_ctrl_altering (gc, ctrl_altering_p);
3069 /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
3070 flag is set. Such call could not be a stmt in the middle of a bb. */
3072 static inline bool
3073 gimple_call_ctrl_altering_p (const gcall *gs)
3075 return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
3078 static inline bool
3079 gimple_call_ctrl_altering_p (const gimple *gs)
3081 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3082 return gimple_call_ctrl_altering_p (gc);
3086 /* Return the function type of the function called by GS. */
3088 static inline tree
3089 gimple_call_fntype (const gcall *gs)
3091 if (gimple_call_internal_p (gs))
3092 return NULL_TREE;
3093 return gs->u.fntype;
3096 static inline tree
3097 gimple_call_fntype (const gimple *gs)
3099 const gcall *call_stmt = GIMPLE_CHECK2<const gcall *> (gs);
3100 return gimple_call_fntype (call_stmt);
3103 /* Set the type of the function called by CALL_STMT to FNTYPE. */
3105 static inline void
3106 gimple_call_set_fntype (gcall *call_stmt, tree fntype)
3108 gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt));
3109 call_stmt->u.fntype = fntype;
3113 /* Return the tree node representing the function called by call
3114 statement GS. */
3116 static inline tree
3117 gimple_call_fn (const gcall *gs)
3119 return gs->op[1];
3122 static inline tree
3123 gimple_call_fn (const gimple *gs)
3125 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3126 return gimple_call_fn (gc);
3129 /* Return a pointer to the tree node representing the function called by call
3130 statement GS. */
3132 static inline tree *
3133 gimple_call_fn_ptr (gcall *gs)
3135 return &gs->op[1];
3138 static inline tree *
3139 gimple_call_fn_ptr (gimple *gs)
3141 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3142 return gimple_call_fn_ptr (gc);
3146 /* Set FN to be the function called by call statement GS. */
3148 static inline void
3149 gimple_call_set_fn (gcall *gs, tree fn)
3151 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3152 gs->op[1] = fn;
3156 /* Set FNDECL to be the function called by call statement GS. */
3158 static inline void
3159 gimple_call_set_fndecl (gcall *gs, tree decl)
3161 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3162 gs->op[1] = build1_loc (gimple_location (gs), ADDR_EXPR,
3163 build_pointer_type (TREE_TYPE (decl)), decl);
3166 static inline void
3167 gimple_call_set_fndecl (gimple *gs, tree decl)
3169 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3170 gimple_call_set_fndecl (gc, decl);
3174 /* Set internal function FN to be the function called by call statement CALL_STMT. */
3176 static inline void
3177 gimple_call_set_internal_fn (gcall *call_stmt, enum internal_fn fn)
3179 gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt));
3180 call_stmt->u.internal_fn = fn;
3184 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
3185 Otherwise return NULL. This function is analogous to
3186 get_callee_fndecl in tree land. */
3188 static inline tree
3189 gimple_call_fndecl (const gcall *gs)
3191 return gimple_call_addr_fndecl (gimple_call_fn (gs));
3194 static inline tree
3195 gimple_call_fndecl (const gimple *gs)
3197 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3198 return gimple_call_fndecl (gc);
3202 /* Return the type returned by call statement GS. */
3204 static inline tree
3205 gimple_call_return_type (const gcall *gs)
3207 tree type = gimple_call_fntype (gs);
3209 if (type == NULL_TREE)
3210 return TREE_TYPE (gimple_call_lhs (gs));
3212 /* The type returned by a function is the type of its
3213 function type. */
3214 return TREE_TYPE (type);
3218 /* Return the static chain for call statement GS. */
3220 static inline tree
3221 gimple_call_chain (const gcall *gs)
3223 return gs->op[2];
3226 static inline tree
3227 gimple_call_chain (const gimple *gs)
3229 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3230 return gimple_call_chain (gc);
3234 /* Return a pointer to the static chain for call statement CALL_STMT. */
3236 static inline tree *
3237 gimple_call_chain_ptr (gcall *call_stmt)
3239 return &call_stmt->op[2];
3242 /* Set CHAIN to be the static chain for call statement CALL_STMT. */
3244 static inline void
3245 gimple_call_set_chain (gcall *call_stmt, tree chain)
3247 call_stmt->op[2] = chain;
3251 /* Return the number of arguments used by call statement GS. */
3253 static inline unsigned
3254 gimple_call_num_args (const gcall *gs)
3256 return gimple_num_ops (gs) - 3;
3259 static inline unsigned
3260 gimple_call_num_args (const gimple *gs)
3262 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3263 return gimple_call_num_args (gc);
3267 /* Return the argument at position INDEX for call statement GS. */
3269 static inline tree
3270 gimple_call_arg (const gcall *gs, unsigned index)
3272 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3273 return gs->op[index + 3];
3276 static inline tree
3277 gimple_call_arg (const gimple *gs, unsigned index)
3279 const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3280 return gimple_call_arg (gc, index);
3284 /* Return a pointer to the argument at position INDEX for call
3285 statement GS. */
3287 static inline tree *
3288 gimple_call_arg_ptr (gcall *gs, unsigned index)
3290 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3291 return &gs->op[index + 3];
3294 static inline tree *
3295 gimple_call_arg_ptr (gimple *gs, unsigned index)
3297 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3298 return gimple_call_arg_ptr (gc, index);
3302 /* Set ARG to be the argument at position INDEX for call statement GS. */
3304 static inline void
3305 gimple_call_set_arg (gcall *gs, unsigned index, tree arg)
3307 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3308 gs->op[index + 3] = arg;
3311 static inline void
3312 gimple_call_set_arg (gimple *gs, unsigned index, tree arg)
3314 gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3315 gimple_call_set_arg (gc, index, arg);
3319 /* If TAIL_P is true, mark call statement S as being a tail call
3320 (i.e., a call just before the exit of a function). These calls are
3321 candidate for tail call optimization. */
3323 static inline void
3324 gimple_call_set_tail (gcall *s, bool tail_p)
3326 if (tail_p)
3327 s->subcode |= GF_CALL_TAILCALL;
3328 else
3329 s->subcode &= ~GF_CALL_TAILCALL;
3333 /* Return true if GIMPLE_CALL S is marked as a tail call. */
3335 static inline bool
3336 gimple_call_tail_p (const gcall *s)
3338 return (s->subcode & GF_CALL_TAILCALL) != 0;
3341 /* Mark (or clear) call statement S as requiring tail call optimization. */
3343 static inline void
3344 gimple_call_set_must_tail (gcall *s, bool must_tail_p)
3346 if (must_tail_p)
3347 s->subcode |= GF_CALL_MUST_TAIL_CALL;
3348 else
3349 s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
3352 /* Return true if call statement has been marked as requiring
3353 tail call optimization. */
3355 static inline bool
3356 gimple_call_must_tail_p (const gcall *s)
3358 return (s->subcode & GF_CALL_MUST_TAIL_CALL) != 0;
3361 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
3362 slot optimization. This transformation uses the target of the call
3363 expansion as the return slot for calls that return in memory. */
3365 static inline void
3366 gimple_call_set_return_slot_opt (gcall *s, bool return_slot_opt_p)
3368 if (return_slot_opt_p)
3369 s->subcode |= GF_CALL_RETURN_SLOT_OPT;
3370 else
3371 s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
3375 /* Return true if S is marked for return slot optimization. */
3377 static inline bool
3378 gimple_call_return_slot_opt_p (const gcall *s)
3380 return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
3384 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
3385 thunk to the thunked-to function. */
3387 static inline void
3388 gimple_call_set_from_thunk (gcall *s, bool from_thunk_p)
3390 if (from_thunk_p)
3391 s->subcode |= GF_CALL_FROM_THUNK;
3392 else
3393 s->subcode &= ~GF_CALL_FROM_THUNK;
3397 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
3399 static inline bool
3400 gimple_call_from_thunk_p (gcall *s)
3402 return (s->subcode & GF_CALL_FROM_THUNK) != 0;
3406 /* If FROM_NEW_OR_DELETE_P is true, mark GIMPLE_CALL S as being a call
3407 to operator new or delete created from a new or delete expression. */
3409 static inline void
3410 gimple_call_set_from_new_or_delete (gcall *s, bool from_new_or_delete_p)
3412 if (from_new_or_delete_p)
3413 s->subcode |= GF_CALL_FROM_NEW_OR_DELETE;
3414 else
3415 s->subcode &= ~GF_CALL_FROM_NEW_OR_DELETE;
3419 /* Return true if GIMPLE_CALL S is a call to operator new or delete from
3420 from a new or delete expression. */
3422 static inline bool
3423 gimple_call_from_new_or_delete (const gcall *s)
3425 return (s->subcode & GF_CALL_FROM_NEW_OR_DELETE) != 0;
3429 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
3430 argument pack in its argument list. */
3432 static inline void
3433 gimple_call_set_va_arg_pack (gcall *s, bool pass_arg_pack_p)
3435 if (pass_arg_pack_p)
3436 s->subcode |= GF_CALL_VA_ARG_PACK;
3437 else
3438 s->subcode &= ~GF_CALL_VA_ARG_PACK;
3442 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
3443 argument pack in its argument list. */
3445 static inline bool
3446 gimple_call_va_arg_pack_p (const gcall *s)
3448 return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
3452 /* Return true if S is a noreturn call. */
3454 static inline bool
3455 gimple_call_noreturn_p (const gcall *s)
3457 return (gimple_call_flags (s) & ECF_NORETURN) != 0;
3460 static inline bool
3461 gimple_call_noreturn_p (const gimple *s)
3463 const gcall *gc = GIMPLE_CHECK2<const gcall *> (s);
3464 return gimple_call_noreturn_p (gc);
3468 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
3469 even if the called function can throw in other cases. */
3471 static inline void
3472 gimple_call_set_nothrow (gcall *s, bool nothrow_p)
3474 if (nothrow_p)
3475 s->subcode |= GF_CALL_NOTHROW;
3476 else
3477 s->subcode &= ~GF_CALL_NOTHROW;
3480 /* Return true if S is a nothrow call. */
3482 static inline bool
3483 gimple_call_nothrow_p (gcall *s)
3485 return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
3488 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
3489 is known to be emitted for VLA objects. Those are wrapped by
3490 stack_save/stack_restore calls and hence can't lead to unbounded
3491 stack growth even when they occur in loops. */
3493 static inline void
3494 gimple_call_set_alloca_for_var (gcall *s, bool for_var)
3496 if (for_var)
3497 s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
3498 else
3499 s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
3502 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
3504 static inline bool
3505 gimple_call_alloca_for_var_p (gcall *s)
3507 return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3510 static inline bool
3511 gimple_call_alloca_for_var_p (gimple *s)
3513 const gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3514 return (gc->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3517 /* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
3518 pointers to nested function are descriptors instead of trampolines. */
3520 static inline void
3521 gimple_call_set_by_descriptor (gcall *s, bool by_descriptor_p)
3523 if (by_descriptor_p)
3524 s->subcode |= GF_CALL_BY_DESCRIPTOR;
3525 else
3526 s->subcode &= ~GF_CALL_BY_DESCRIPTOR;
3529 /* Return true if S is a by-descriptor call. */
3531 static inline bool
3532 gimple_call_by_descriptor_p (gcall *s)
3534 return (s->subcode & GF_CALL_BY_DESCRIPTOR) != 0;
3537 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
3539 static inline void
3540 gimple_call_copy_flags (gcall *dest_call, gcall *orig_call)
3542 dest_call->subcode = orig_call->subcode;
3546 /* Return a pointer to the points-to solution for the set of call-used
3547 variables of the call CALL_STMT. */
3549 static inline struct pt_solution *
3550 gimple_call_use_set (gcall *call_stmt)
3552 return &call_stmt->call_used;
3555 /* As above, but const. */
3557 static inline const pt_solution *
3558 gimple_call_use_set (const gcall *call_stmt)
3560 return &call_stmt->call_used;
3563 /* Return a pointer to the points-to solution for the set of call-used
3564 variables of the call CALL_STMT. */
3566 static inline struct pt_solution *
3567 gimple_call_clobber_set (gcall *call_stmt)
3569 return &call_stmt->call_clobbered;
3572 /* As above, but const. */
3574 static inline const pt_solution *
3575 gimple_call_clobber_set (const gcall *call_stmt)
3577 return &call_stmt->call_clobbered;
3581 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
3582 non-NULL lhs. */
3584 static inline bool
3585 gimple_has_lhs (const gimple *stmt)
3587 if (is_gimple_assign (stmt))
3588 return true;
3589 if (const gcall *call = dyn_cast <const gcall *> (stmt))
3590 return gimple_call_lhs (call) != NULL_TREE;
3591 return false;
3595 /* Return the code of the predicate computed by conditional statement GS. */
3597 static inline enum tree_code
3598 gimple_cond_code (const gcond *gs)
3600 return (enum tree_code) gs->subcode;
3603 static inline enum tree_code
3604 gimple_cond_code (const gimple *gs)
3606 const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3607 return gimple_cond_code (gc);
3611 /* Set CODE to be the predicate code for the conditional statement GS. */
3613 static inline void
3614 gimple_cond_set_code (gcond *gs, enum tree_code code)
3616 gs->subcode = code;
3620 /* Return the LHS of the predicate computed by conditional statement GS. */
3622 static inline tree
3623 gimple_cond_lhs (const gcond *gs)
3625 return gs->op[0];
3628 static inline tree
3629 gimple_cond_lhs (const gimple *gs)
3631 const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3632 return gimple_cond_lhs (gc);
3635 /* Return the pointer to the LHS of the predicate computed by conditional
3636 statement GS. */
3638 static inline tree *
3639 gimple_cond_lhs_ptr (gcond *gs)
3641 return &gs->op[0];
3644 /* Set LHS to be the LHS operand of the predicate computed by
3645 conditional statement GS. */
3647 static inline void
3648 gimple_cond_set_lhs (gcond *gs, tree lhs)
3650 gs->op[0] = lhs;
3654 /* Return the RHS operand of the predicate computed by conditional GS. */
3656 static inline tree
3657 gimple_cond_rhs (const gcond *gs)
3659 return gs->op[1];
3662 static inline tree
3663 gimple_cond_rhs (const gimple *gs)
3665 const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3666 return gimple_cond_rhs (gc);
3669 /* Return the pointer to the RHS operand of the predicate computed by
3670 conditional GS. */
3672 static inline tree *
3673 gimple_cond_rhs_ptr (gcond *gs)
3675 return &gs->op[1];
3679 /* Set RHS to be the RHS operand of the predicate computed by
3680 conditional statement GS. */
3682 static inline void
3683 gimple_cond_set_rhs (gcond *gs, tree rhs)
3685 gs->op[1] = rhs;
3689 /* Return the label used by conditional statement GS when its
3690 predicate evaluates to true. */
3692 static inline tree
3693 gimple_cond_true_label (const gcond *gs)
3695 return gs->op[2];
3699 /* Set LABEL to be the label used by conditional statement GS when its
3700 predicate evaluates to true. */
3702 static inline void
3703 gimple_cond_set_true_label (gcond *gs, tree label)
3705 gs->op[2] = label;
3709 /* Set LABEL to be the label used by conditional statement GS when its
3710 predicate evaluates to false. */
3712 static inline void
3713 gimple_cond_set_false_label (gcond *gs, tree label)
3715 gs->op[3] = label;
3719 /* Return the label used by conditional statement GS when its
3720 predicate evaluates to false. */
3722 static inline tree
3723 gimple_cond_false_label (const gcond *gs)
3725 return gs->op[3];
3729 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
3731 static inline void
3732 gimple_cond_make_false (gcond *gs)
3734 gimple_cond_set_lhs (gs, boolean_false_node);
3735 gimple_cond_set_rhs (gs, boolean_false_node);
3736 gs->subcode = NE_EXPR;
3740 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
3742 static inline void
3743 gimple_cond_make_true (gcond *gs)
3745 gimple_cond_set_lhs (gs, boolean_true_node);
3746 gimple_cond_set_rhs (gs, boolean_false_node);
3747 gs->subcode = NE_EXPR;
3750 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
3751 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3753 static inline bool
3754 gimple_cond_true_p (const gcond *gs)
3756 tree lhs = gimple_cond_lhs (gs);
3757 tree rhs = gimple_cond_rhs (gs);
3758 enum tree_code code = gimple_cond_code (gs);
3760 if (lhs != boolean_true_node && lhs != boolean_false_node)
3761 return false;
3763 if (rhs != boolean_true_node && rhs != boolean_false_node)
3764 return false;
3766 if (code == NE_EXPR && lhs != rhs)
3767 return true;
3769 if (code == EQ_EXPR && lhs == rhs)
3770 return true;
3772 return false;
3775 /* Check if conditional statement GS is of the form 'if (1 != 1)',
3776 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3778 static inline bool
3779 gimple_cond_false_p (const gcond *gs)
3781 tree lhs = gimple_cond_lhs (gs);
3782 tree rhs = gimple_cond_rhs (gs);
3783 enum tree_code code = gimple_cond_code (gs);
3785 if (lhs != boolean_true_node && lhs != boolean_false_node)
3786 return false;
3788 if (rhs != boolean_true_node && rhs != boolean_false_node)
3789 return false;
3791 if (code == NE_EXPR && lhs == rhs)
3792 return true;
3794 if (code == EQ_EXPR && lhs != rhs)
3795 return true;
3797 return false;
3800 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3802 static inline void
3803 gimple_cond_set_condition (gcond *stmt, enum tree_code code, tree lhs,
3804 tree rhs)
3806 gimple_cond_set_code (stmt, code);
3807 gimple_cond_set_lhs (stmt, lhs);
3808 gimple_cond_set_rhs (stmt, rhs);
3812 /* Return the tree code for the expression computed by STMT. This is
3813 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
3814 GIMPLE_CALL, return CALL_EXPR as the expression code for
3815 consistency. This is useful when the caller needs to deal with the
3816 three kinds of computation that GIMPLE supports. */
3818 static inline enum tree_code
3819 gimple_expr_code (const gimple *stmt)
3821 if (const gassign *ass = dyn_cast<const gassign *> (stmt))
3822 return gimple_assign_rhs_code (ass);
3823 if (const gcond *cond = dyn_cast<const gcond *> (stmt))
3824 return gimple_cond_code (cond);
3825 else
3827 gcc_gimple_checking_assert (gimple_code (stmt) == GIMPLE_CALL);
3828 return CALL_EXPR;
3833 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3835 static inline tree
3836 gimple_label_label (const glabel *gs)
3838 return gs->op[0];
3842 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3843 GS. */
3845 static inline void
3846 gimple_label_set_label (glabel *gs, tree label)
3848 gs->op[0] = label;
3852 /* Return the destination of the unconditional jump GS. */
3854 static inline tree
3855 gimple_goto_dest (const gimple *gs)
3857 GIMPLE_CHECK (gs, GIMPLE_GOTO);
3858 return gimple_op (gs, 0);
3862 /* Set DEST to be the destination of the unconditonal jump GS. */
3864 static inline void
3865 gimple_goto_set_dest (ggoto *gs, tree dest)
3867 gs->op[0] = dest;
3871 /* Return the variables declared in the GIMPLE_BIND statement GS. */
3873 static inline tree
3874 gimple_bind_vars (const gbind *bind_stmt)
3876 return bind_stmt->vars;
3880 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
3881 statement GS. */
3883 static inline void
3884 gimple_bind_set_vars (gbind *bind_stmt, tree vars)
3886 bind_stmt->vars = vars;
3890 /* Append VARS to the set of variables declared in the GIMPLE_BIND
3891 statement GS. */
3893 static inline void
3894 gimple_bind_append_vars (gbind *bind_stmt, tree vars)
3896 bind_stmt->vars = chainon (bind_stmt->vars, vars);
3900 static inline gimple_seq *
3901 gimple_bind_body_ptr (gbind *bind_stmt)
3903 return &bind_stmt->body;
3906 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
3908 static inline gimple_seq
3909 gimple_bind_body (const gbind *gs)
3911 return *gimple_bind_body_ptr (const_cast <gbind *> (gs));
3915 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
3916 statement GS. */
3918 static inline void
3919 gimple_bind_set_body (gbind *bind_stmt, gimple_seq seq)
3921 bind_stmt->body = seq;
3925 /* Append a statement to the end of a GIMPLE_BIND's body. */
3927 static inline void
3928 gimple_bind_add_stmt (gbind *bind_stmt, gimple *stmt)
3930 gimple_seq_add_stmt (&bind_stmt->body, stmt);
3934 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
3936 static inline void
3937 gimple_bind_add_seq (gbind *bind_stmt, gimple_seq seq)
3939 gimple_seq_add_seq (&bind_stmt->body, seq);
3943 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
3944 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
3946 static inline tree
3947 gimple_bind_block (const gbind *bind_stmt)
3949 return bind_stmt->block;
3953 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
3954 statement GS. */
3956 static inline void
3957 gimple_bind_set_block (gbind *bind_stmt, tree block)
3959 gcc_gimple_checking_assert (block == NULL_TREE
3960 || TREE_CODE (block) == BLOCK);
3961 bind_stmt->block = block;
3965 /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
3967 static inline unsigned
3968 gimple_asm_ninputs (const gasm *asm_stmt)
3970 return asm_stmt->ni;
3974 /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
3976 static inline unsigned
3977 gimple_asm_noutputs (const gasm *asm_stmt)
3979 return asm_stmt->no;
3983 /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
3985 static inline unsigned
3986 gimple_asm_nclobbers (const gasm *asm_stmt)
3988 return asm_stmt->nc;
3991 /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
3993 static inline unsigned
3994 gimple_asm_nlabels (const gasm *asm_stmt)
3996 return asm_stmt->nl;
3999 /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
4001 static inline tree
4002 gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
4004 gcc_gimple_checking_assert (index < asm_stmt->ni);
4005 return asm_stmt->op[index + asm_stmt->no];
4008 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
4010 static inline void
4011 gimple_asm_set_input_op (gasm *asm_stmt, unsigned index, tree in_op)
4013 gcc_gimple_checking_assert (index < asm_stmt->ni
4014 && TREE_CODE (in_op) == TREE_LIST);
4015 asm_stmt->op[index + asm_stmt->no] = in_op;
4019 /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
4021 static inline tree
4022 gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
4024 gcc_gimple_checking_assert (index < asm_stmt->no);
4025 return asm_stmt->op[index];
4028 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
4030 static inline void
4031 gimple_asm_set_output_op (gasm *asm_stmt, unsigned index, tree out_op)
4033 gcc_gimple_checking_assert (index < asm_stmt->no
4034 && TREE_CODE (out_op) == TREE_LIST);
4035 asm_stmt->op[index] = out_op;
4039 /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
4041 static inline tree
4042 gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
4044 gcc_gimple_checking_assert (index < asm_stmt->nc);
4045 return asm_stmt->op[index + asm_stmt->ni + asm_stmt->no];
4049 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
4051 static inline void
4052 gimple_asm_set_clobber_op (gasm *asm_stmt, unsigned index, tree clobber_op)
4054 gcc_gimple_checking_assert (index < asm_stmt->nc
4055 && TREE_CODE (clobber_op) == TREE_LIST);
4056 asm_stmt->op[index + asm_stmt->ni + asm_stmt->no] = clobber_op;
4059 /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
4061 static inline tree
4062 gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
4064 gcc_gimple_checking_assert (index < asm_stmt->nl);
4065 return asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc];
4068 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
4070 static inline void
4071 gimple_asm_set_label_op (gasm *asm_stmt, unsigned index, tree label_op)
4073 gcc_gimple_checking_assert (index < asm_stmt->nl
4074 && TREE_CODE (label_op) == TREE_LIST);
4075 asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc] = label_op;
4078 /* Return the string representing the assembly instruction in
4079 GIMPLE_ASM ASM_STMT. */
4081 static inline const char *
4082 gimple_asm_string (const gasm *asm_stmt)
4084 return asm_stmt->string;
4088 /* Return true if ASM_STMT is marked volatile. */
4090 static inline bool
4091 gimple_asm_volatile_p (const gasm *asm_stmt)
4093 return (asm_stmt->subcode & GF_ASM_VOLATILE) != 0;
4097 /* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile. */
4099 static inline void
4100 gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
4102 if (volatile_p)
4103 asm_stmt->subcode |= GF_ASM_VOLATILE;
4104 else
4105 asm_stmt->subcode &= ~GF_ASM_VOLATILE;
4109 /* Return true if ASM_STMT is marked inline. */
4111 static inline bool
4112 gimple_asm_inline_p (const gasm *asm_stmt)
4114 return (asm_stmt->subcode & GF_ASM_INLINE) != 0;
4118 /* If INLINE_P is true, mark asm statement ASM_STMT as inline. */
4120 static inline void
4121 gimple_asm_set_inline (gasm *asm_stmt, bool inline_p)
4123 if (inline_p)
4124 asm_stmt->subcode |= GF_ASM_INLINE;
4125 else
4126 asm_stmt->subcode &= ~GF_ASM_INLINE;
4130 /* If INPUT_P is true, mark asm ASM_STMT as an ASM_INPUT. */
4132 static inline void
4133 gimple_asm_set_input (gasm *asm_stmt, bool input_p)
4135 if (input_p)
4136 asm_stmt->subcode |= GF_ASM_INPUT;
4137 else
4138 asm_stmt->subcode &= ~GF_ASM_INPUT;
4142 /* Return true if asm ASM_STMT is an ASM_INPUT. */
4144 static inline bool
4145 gimple_asm_input_p (const gasm *asm_stmt)
4147 return (asm_stmt->subcode & GF_ASM_INPUT) != 0;
4151 /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4153 static inline tree
4154 gimple_catch_types (const gcatch *catch_stmt)
4156 return catch_stmt->types;
4160 /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4162 static inline tree *
4163 gimple_catch_types_ptr (gcatch *catch_stmt)
4165 return &catch_stmt->types;
4169 /* Return a pointer to the GIMPLE sequence representing the body of
4170 the handler of GIMPLE_CATCH statement CATCH_STMT. */
4172 static inline gimple_seq *
4173 gimple_catch_handler_ptr (gcatch *catch_stmt)
4175 return &catch_stmt->handler;
4179 /* Return the GIMPLE sequence representing the body of the handler of
4180 GIMPLE_CATCH statement CATCH_STMT. */
4182 static inline gimple_seq
4183 gimple_catch_handler (const gcatch *catch_stmt)
4185 return *gimple_catch_handler_ptr (const_cast <gcatch *> (catch_stmt));
4189 /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
4191 static inline void
4192 gimple_catch_set_types (gcatch *catch_stmt, tree t)
4194 catch_stmt->types = t;
4198 /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
4200 static inline void
4201 gimple_catch_set_handler (gcatch *catch_stmt, gimple_seq handler)
4203 catch_stmt->handler = handler;
4207 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
4209 static inline tree
4210 gimple_eh_filter_types (const gimple *gs)
4212 const geh_filter *eh_filter_stmt = as_a <const geh_filter *> (gs);
4213 return eh_filter_stmt->types;
4217 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
4218 GS. */
4220 static inline tree *
4221 gimple_eh_filter_types_ptr (gimple *gs)
4223 geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4224 return &eh_filter_stmt->types;
4228 /* Return a pointer to the sequence of statement to execute when
4229 GIMPLE_EH_FILTER statement fails. */
4231 static inline gimple_seq *
4232 gimple_eh_filter_failure_ptr (gimple *gs)
4234 geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4235 return &eh_filter_stmt->failure;
4239 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
4240 statement fails. */
4242 static inline gimple_seq
4243 gimple_eh_filter_failure (const gimple *gs)
4245 return *gimple_eh_filter_failure_ptr (const_cast <gimple *> (gs));
4249 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
4250 EH_FILTER_STMT. */
4252 static inline void
4253 gimple_eh_filter_set_types (geh_filter *eh_filter_stmt, tree types)
4255 eh_filter_stmt->types = types;
4259 /* Set FAILURE to be the sequence of statements to execute on failure
4260 for GIMPLE_EH_FILTER EH_FILTER_STMT. */
4262 static inline void
4263 gimple_eh_filter_set_failure (geh_filter *eh_filter_stmt,
4264 gimple_seq failure)
4266 eh_filter_stmt->failure = failure;
4269 /* Get the function decl to be called by the MUST_NOT_THROW region. */
4271 static inline tree
4272 gimple_eh_must_not_throw_fndecl (const geh_mnt *eh_mnt_stmt)
4274 return eh_mnt_stmt->fndecl;
4277 /* Set the function decl to be called by GS to DECL. */
4279 static inline void
4280 gimple_eh_must_not_throw_set_fndecl (geh_mnt *eh_mnt_stmt,
4281 tree decl)
4283 eh_mnt_stmt->fndecl = decl;
4286 /* GIMPLE_EH_ELSE accessors. */
4288 static inline gimple_seq *
4289 gimple_eh_else_n_body_ptr (geh_else *eh_else_stmt)
4291 return &eh_else_stmt->n_body;
4294 static inline gimple_seq
4295 gimple_eh_else_n_body (const geh_else *eh_else_stmt)
4297 return *gimple_eh_else_n_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4300 static inline gimple_seq *
4301 gimple_eh_else_e_body_ptr (geh_else *eh_else_stmt)
4303 return &eh_else_stmt->e_body;
4306 static inline gimple_seq
4307 gimple_eh_else_e_body (const geh_else *eh_else_stmt)
4309 return *gimple_eh_else_e_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4312 static inline void
4313 gimple_eh_else_set_n_body (geh_else *eh_else_stmt, gimple_seq seq)
4315 eh_else_stmt->n_body = seq;
4318 static inline void
4319 gimple_eh_else_set_e_body (geh_else *eh_else_stmt, gimple_seq seq)
4321 eh_else_stmt->e_body = seq;
4324 /* GIMPLE_TRY accessors. */
4326 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
4327 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
4329 static inline enum gimple_try_flags
4330 gimple_try_kind (const gimple *gs)
4332 GIMPLE_CHECK (gs, GIMPLE_TRY);
4333 return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
4337 /* Set the kind of try block represented by GIMPLE_TRY GS. */
4339 static inline void
4340 gimple_try_set_kind (gtry *gs, enum gimple_try_flags kind)
4342 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
4343 || kind == GIMPLE_TRY_FINALLY);
4344 if (gimple_try_kind (gs) != kind)
4345 gs->subcode = (unsigned int) kind;
4349 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4351 static inline bool
4352 gimple_try_catch_is_cleanup (const gimple *gs)
4354 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
4355 return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
4359 /* Return a pointer to the sequence of statements used as the
4360 body for GIMPLE_TRY GS. */
4362 static inline gimple_seq *
4363 gimple_try_eval_ptr (gimple *gs)
4365 gtry *try_stmt = as_a <gtry *> (gs);
4366 return &try_stmt->eval;
4370 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
4372 static inline gimple_seq
4373 gimple_try_eval (const gimple *gs)
4375 return *gimple_try_eval_ptr (const_cast <gimple *> (gs));
4379 /* Return a pointer to the sequence of statements used as the cleanup body for
4380 GIMPLE_TRY GS. */
4382 static inline gimple_seq *
4383 gimple_try_cleanup_ptr (gimple *gs)
4385 gtry *try_stmt = as_a <gtry *> (gs);
4386 return &try_stmt->cleanup;
4390 /* Return the sequence of statements used as the cleanup body for
4391 GIMPLE_TRY GS. */
4393 static inline gimple_seq
4394 gimple_try_cleanup (const gimple *gs)
4396 return *gimple_try_cleanup_ptr (const_cast <gimple *> (gs));
4400 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4402 static inline void
4403 gimple_try_set_catch_is_cleanup (gtry *g, bool catch_is_cleanup)
4405 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
4406 if (catch_is_cleanup)
4407 g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
4408 else
4409 g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
4413 /* Set EVAL to be the sequence of statements to use as the body for
4414 GIMPLE_TRY TRY_STMT. */
4416 static inline void
4417 gimple_try_set_eval (gtry *try_stmt, gimple_seq eval)
4419 try_stmt->eval = eval;
4423 /* Set CLEANUP to be the sequence of statements to use as the cleanup
4424 body for GIMPLE_TRY TRY_STMT. */
4426 static inline void
4427 gimple_try_set_cleanup (gtry *try_stmt, gimple_seq cleanup)
4429 try_stmt->cleanup = cleanup;
4433 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
4435 static inline gimple_seq *
4436 gimple_wce_cleanup_ptr (gimple *gs)
4438 gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4439 return &wce_stmt->cleanup;
4443 /* Return the cleanup sequence for cleanup statement GS. */
4445 static inline gimple_seq
4446 gimple_wce_cleanup (gimple *gs)
4448 return *gimple_wce_cleanup_ptr (gs);
4452 /* Set CLEANUP to be the cleanup sequence for GS. */
4454 static inline void
4455 gimple_wce_set_cleanup (gimple *gs, gimple_seq cleanup)
4457 gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4458 wce_stmt->cleanup = cleanup;
4462 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
4464 static inline bool
4465 gimple_wce_cleanup_eh_only (const gimple *gs)
4467 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4468 return gs->subcode != 0;
4472 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
4474 static inline void
4475 gimple_wce_set_cleanup_eh_only (gimple *gs, bool eh_only_p)
4477 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4478 gs->subcode = (unsigned int) eh_only_p;
4482 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
4484 static inline unsigned
4485 gimple_phi_capacity (const gimple *gs)
4487 const gphi *phi_stmt = as_a <const gphi *> (gs);
4488 return phi_stmt->capacity;
4492 /* Return the number of arguments in GIMPLE_PHI GS. This must always
4493 be exactly the number of incoming edges for the basic block holding
4494 GS. */
4496 static inline unsigned
4497 gimple_phi_num_args (const gimple *gs)
4499 const gphi *phi_stmt = as_a <const gphi *> (gs);
4500 return phi_stmt->nargs;
4504 /* Return the SSA name created by GIMPLE_PHI GS. */
4506 static inline tree
4507 gimple_phi_result (const gphi *gs)
4509 return gs->result;
4512 static inline tree
4513 gimple_phi_result (const gimple *gs)
4515 const gphi *phi_stmt = as_a <const gphi *> (gs);
4516 return gimple_phi_result (phi_stmt);
4519 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
4521 static inline tree *
4522 gimple_phi_result_ptr (gphi *gs)
4524 return &gs->result;
4527 static inline tree *
4528 gimple_phi_result_ptr (gimple *gs)
4530 gphi *phi_stmt = as_a <gphi *> (gs);
4531 return gimple_phi_result_ptr (phi_stmt);
4534 /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
4536 static inline void
4537 gimple_phi_set_result (gphi *phi, tree result)
4539 phi->result = result;
4540 if (result && TREE_CODE (result) == SSA_NAME)
4541 SSA_NAME_DEF_STMT (result) = phi;
4545 /* Return the PHI argument corresponding to incoming edge INDEX for
4546 GIMPLE_PHI GS. */
4548 static inline struct phi_arg_d *
4549 gimple_phi_arg (gphi *gs, unsigned index)
4551 gcc_gimple_checking_assert (index < gs->nargs);
4552 return &(gs->args[index]);
4555 static inline const phi_arg_d *
4556 gimple_phi_arg (const gphi *gs, unsigned index)
4558 gcc_gimple_checking_assert (index < gs->nargs);
4559 return &(gs->args[index]);
4562 static inline struct phi_arg_d *
4563 gimple_phi_arg (gimple *gs, unsigned index)
4565 gphi *phi_stmt = as_a <gphi *> (gs);
4566 return gimple_phi_arg (phi_stmt, index);
4569 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
4570 for GIMPLE_PHI PHI. */
4572 static inline void
4573 gimple_phi_set_arg (gphi *phi, unsigned index, struct phi_arg_d * phiarg)
4575 gcc_gimple_checking_assert (index < phi->nargs);
4576 phi->args[index] = *phiarg;
4579 /* Return the PHI nodes for basic block BB, or NULL if there are no
4580 PHI nodes. */
4582 static inline gimple_seq
4583 phi_nodes (const_basic_block bb)
4585 gcc_checking_assert (!(bb->flags & BB_RTL));
4586 return bb->il.gimple.phi_nodes;
4589 /* Return a pointer to the PHI nodes for basic block BB. */
4591 static inline gimple_seq *
4592 phi_nodes_ptr (basic_block bb)
4594 gcc_checking_assert (!(bb->flags & BB_RTL));
4595 return &bb->il.gimple.phi_nodes;
4598 /* Return the tree operand for argument I of PHI node GS. */
4600 static inline tree
4601 gimple_phi_arg_def (const gphi *gs, size_t index)
4603 return gimple_phi_arg (gs, index)->def;
4606 static inline tree
4607 gimple_phi_arg_def (gimple *gs, size_t index)
4609 return gimple_phi_arg (gs, index)->def;
4613 /* Return a pointer to the tree operand for argument I of phi node PHI. */
4615 static inline tree *
4616 gimple_phi_arg_def_ptr (gphi *phi, size_t index)
4618 return &gimple_phi_arg (phi, index)->def;
4621 /* Return the edge associated with argument I of phi node PHI. */
4623 static inline edge
4624 gimple_phi_arg_edge (const gphi *phi, size_t i)
4626 return EDGE_PRED (gimple_bb (phi), i);
4629 /* Return the source location of gimple argument I of phi node PHI. */
4631 static inline location_t
4632 gimple_phi_arg_location (const gphi *phi, size_t i)
4634 return gimple_phi_arg (phi, i)->locus;
4637 /* Return the source location of the argument on edge E of phi node PHI. */
4639 static inline location_t
4640 gimple_phi_arg_location_from_edge (gphi *phi, edge e)
4642 return gimple_phi_arg (phi, e->dest_idx)->locus;
4645 /* Set the source location of gimple argument I of phi node PHI to LOC. */
4647 static inline void
4648 gimple_phi_arg_set_location (gphi *phi, size_t i, location_t loc)
4650 gimple_phi_arg (phi, i)->locus = loc;
4653 /* Return address of source location of gimple argument I of phi node PHI. */
4655 static inline location_t *
4656 gimple_phi_arg_location_ptr (gphi *phi, size_t i)
4658 return &gimple_phi_arg (phi, i)->locus;
4661 /* Return TRUE if argument I of phi node PHI has a location record. */
4663 static inline bool
4664 gimple_phi_arg_has_location (const gphi *phi, size_t i)
4666 return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
4670 /* Return the region number for GIMPLE_RESX RESX_STMT. */
4672 static inline int
4673 gimple_resx_region (const gresx *resx_stmt)
4675 return resx_stmt->region;
4678 /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
4680 static inline void
4681 gimple_resx_set_region (gresx *resx_stmt, int region)
4683 resx_stmt->region = region;
4686 /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
4688 static inline int
4689 gimple_eh_dispatch_region (const geh_dispatch *eh_dispatch_stmt)
4691 return eh_dispatch_stmt->region;
4694 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
4695 EH_DISPATCH_STMT. */
4697 static inline void
4698 gimple_eh_dispatch_set_region (geh_dispatch *eh_dispatch_stmt, int region)
4700 eh_dispatch_stmt->region = region;
4703 /* Return the number of labels associated with the switch statement GS. */
4705 static inline unsigned
4706 gimple_switch_num_labels (const gswitch *gs)
4708 unsigned num_ops;
4709 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
4710 num_ops = gimple_num_ops (gs);
4711 gcc_gimple_checking_assert (num_ops > 1);
4712 return num_ops - 1;
4716 /* Set NLABELS to be the number of labels for the switch statement GS. */
4718 static inline void
4719 gimple_switch_set_num_labels (gswitch *g, unsigned nlabels)
4721 GIMPLE_CHECK (g, GIMPLE_SWITCH);
4722 gimple_set_num_ops (g, nlabels + 1);
4726 /* Return the index variable used by the switch statement GS. */
4728 static inline tree
4729 gimple_switch_index (const gswitch *gs)
4731 return gs->op[0];
4735 /* Return a pointer to the index variable for the switch statement GS. */
4737 static inline tree *
4738 gimple_switch_index_ptr (gswitch *gs)
4740 return &gs->op[0];
4744 /* Set INDEX to be the index variable for switch statement GS. */
4746 static inline void
4747 gimple_switch_set_index (gswitch *gs, tree index)
4749 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
4750 gs->op[0] = index;
4754 /* Return the label numbered INDEX. The default label is 0, followed by any
4755 labels in a switch statement. */
4757 static inline tree
4758 gimple_switch_label (const gswitch *gs, unsigned index)
4760 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
4761 return gs->op[index + 1];
4764 /* Set the label number INDEX to LABEL. 0 is always the default label. */
4766 static inline void
4767 gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
4769 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
4770 && (label == NULL_TREE
4771 || TREE_CODE (label) == CASE_LABEL_EXPR));
4772 gs->op[index + 1] = label;
4775 /* Return the default label for a switch statement. */
4777 static inline tree
4778 gimple_switch_default_label (const gswitch *gs)
4780 tree label = gimple_switch_label (gs, 0);
4781 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
4782 return label;
4785 /* Set the default label for a switch statement. */
4787 static inline void
4788 gimple_switch_set_default_label (gswitch *gs, tree label)
4790 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
4791 gimple_switch_set_label (gs, 0, label);
4794 /* Return true if GS is a GIMPLE_DEBUG statement. */
4796 static inline bool
4797 is_gimple_debug (const gimple *gs)
4799 return gimple_code (gs) == GIMPLE_DEBUG;
4803 /* Return the first nondebug statement in GIMPLE sequence S. */
4805 static inline gimple *
4806 gimple_seq_first_nondebug_stmt (gimple_seq s)
4808 gimple_seq_node n = gimple_seq_first (s);
4809 while (n && is_gimple_debug (n))
4810 n = n->next;
4811 return n;
4815 /* Return the last nondebug statement in GIMPLE sequence S. */
4817 static inline gimple *
4818 gimple_seq_last_nondebug_stmt (gimple_seq s)
4820 gimple_seq_node n;
4821 for (n = gimple_seq_last (s);
4822 n && is_gimple_debug (n);
4823 n = n->prev)
4824 if (n == s)
4825 return NULL;
4826 return n;
4830 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
4832 static inline bool
4833 gimple_debug_bind_p (const gimple *s)
4835 if (is_gimple_debug (s))
4836 return s->subcode == GIMPLE_DEBUG_BIND;
4838 return false;
4841 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
4843 static inline tree
4844 gimple_debug_bind_get_var (const gimple *dbg)
4846 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4847 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4848 return gimple_op (dbg, 0);
4851 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
4852 statement. */
4854 static inline tree
4855 gimple_debug_bind_get_value (const gimple *dbg)
4857 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4858 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4859 return gimple_op (dbg, 1);
4862 /* Return a pointer to the value bound to the variable in a
4863 GIMPLE_DEBUG bind statement. */
4865 static inline tree *
4866 gimple_debug_bind_get_value_ptr (gimple *dbg)
4868 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4869 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4870 return gimple_op_ptr (dbg, 1);
4873 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
4875 static inline void
4876 gimple_debug_bind_set_var (gimple *dbg, tree var)
4878 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4879 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4880 gimple_set_op (dbg, 0, var);
4883 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
4884 statement. */
4886 static inline void
4887 gimple_debug_bind_set_value (gimple *dbg, tree value)
4889 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4890 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4891 gimple_set_op (dbg, 1, value);
4894 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
4895 optimized away. */
4896 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
4898 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
4899 statement. */
4901 static inline void
4902 gimple_debug_bind_reset_value (gimple *dbg)
4904 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4905 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4906 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
4909 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
4910 value. */
4912 static inline bool
4913 gimple_debug_bind_has_value_p (gimple *dbg)
4915 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4916 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4917 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
4920 #undef GIMPLE_DEBUG_BIND_NOVALUE
4922 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
4924 static inline bool
4925 gimple_debug_source_bind_p (const gimple *s)
4927 if (is_gimple_debug (s))
4928 return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
4930 return false;
4933 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
4935 static inline tree
4936 gimple_debug_source_bind_get_var (const gimple *dbg)
4938 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4939 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4940 return gimple_op (dbg, 0);
4943 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
4944 statement. */
4946 static inline tree
4947 gimple_debug_source_bind_get_value (const gimple *dbg)
4949 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4950 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4951 return gimple_op (dbg, 1);
4954 /* Return a pointer to the value bound to the variable in a
4955 GIMPLE_DEBUG source bind statement. */
4957 static inline tree *
4958 gimple_debug_source_bind_get_value_ptr (gimple *dbg)
4960 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4961 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4962 return gimple_op_ptr (dbg, 1);
4965 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
4967 static inline void
4968 gimple_debug_source_bind_set_var (gimple *dbg, tree var)
4970 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4971 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4972 gimple_set_op (dbg, 0, var);
4975 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
4976 statement. */
4978 static inline void
4979 gimple_debug_source_bind_set_value (gimple *dbg, tree value)
4981 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4982 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4983 gimple_set_op (dbg, 1, value);
4986 /* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement. */
4988 static inline bool
4989 gimple_debug_begin_stmt_p (const gimple *s)
4991 if (is_gimple_debug (s))
4992 return s->subcode == GIMPLE_DEBUG_BEGIN_STMT;
4994 return false;
4997 /* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement. */
4999 static inline bool
5000 gimple_debug_inline_entry_p (const gimple *s)
5002 if (is_gimple_debug (s))
5003 return s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5005 return false;
5008 /* Return true if S is a GIMPLE_DEBUG non-binding marker statement. */
5010 static inline bool
5011 gimple_debug_nonbind_marker_p (const gimple *s)
5013 if (is_gimple_debug (s))
5014 return s->subcode == GIMPLE_DEBUG_BEGIN_STMT
5015 || s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5017 return false;
5020 /* Return the line number for EXPR, or return -1 if we have no line
5021 number information for it. */
5022 static inline int
5023 get_lineno (const gimple *stmt)
5025 location_t loc;
5027 if (!stmt)
5028 return -1;
5030 loc = gimple_location (stmt);
5031 if (loc == UNKNOWN_LOCATION)
5032 return -1;
5034 return LOCATION_LINE (loc);
5037 /* Return a pointer to the body for the OMP statement GS. */
5039 static inline gimple_seq *
5040 gimple_omp_body_ptr (gimple *gs)
5042 return &static_cast <gimple_statement_omp *> (gs)->body;
5045 /* Return the body for the OMP statement GS. */
5047 static inline gimple_seq
5048 gimple_omp_body (const gimple *gs)
5050 return *gimple_omp_body_ptr (const_cast <gimple *> (gs));
5053 /* Set BODY to be the body for the OMP statement GS. */
5055 static inline void
5056 gimple_omp_set_body (gimple *gs, gimple_seq body)
5058 static_cast <gimple_statement_omp *> (gs)->body = body;
5062 /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
5064 static inline tree
5065 gimple_omp_critical_name (const gomp_critical *crit_stmt)
5067 return crit_stmt->name;
5071 /* Return a pointer to the name associated with OMP critical statement
5072 CRIT_STMT. */
5074 static inline tree *
5075 gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
5077 return &crit_stmt->name;
5081 /* Set NAME to be the name associated with OMP critical statement
5082 CRIT_STMT. */
5084 static inline void
5085 gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
5087 crit_stmt->name = name;
5091 /* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
5093 static inline tree
5094 gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
5096 return crit_stmt->clauses;
5100 /* Return a pointer to the clauses associated with OMP critical statement
5101 CRIT_STMT. */
5103 static inline tree *
5104 gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
5106 return &crit_stmt->clauses;
5110 /* Set CLAUSES to be the clauses associated with OMP critical statement
5111 CRIT_STMT. */
5113 static inline void
5114 gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
5116 crit_stmt->clauses = clauses;
5120 /* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
5122 static inline tree
5123 gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
5125 return ord_stmt->clauses;
5129 /* Return a pointer to the clauses associated with OMP ordered statement
5130 ORD_STMT. */
5132 static inline tree *
5133 gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
5135 return &ord_stmt->clauses;
5139 /* Set CLAUSES to be the clauses associated with OMP ordered statement
5140 ORD_STMT. */
5142 static inline void
5143 gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
5145 ord_stmt->clauses = clauses;
5149 /* Return the clauses associated with OMP_SCAN statement SCAN_STMT. */
5151 static inline tree
5152 gimple_omp_scan_clauses (const gomp_scan *scan_stmt)
5154 return scan_stmt->clauses;
5158 /* Return a pointer to the clauses associated with OMP scan statement
5159 ORD_STMT. */
5161 static inline tree *
5162 gimple_omp_scan_clauses_ptr (gomp_scan *scan_stmt)
5164 return &scan_stmt->clauses;
5168 /* Set CLAUSES to be the clauses associated with OMP scan statement
5169 ORD_STMT. */
5171 static inline void
5172 gimple_omp_scan_set_clauses (gomp_scan *scan_stmt, tree clauses)
5174 scan_stmt->clauses = clauses;
5178 /* Return the clauses associated with OMP_TASKGROUP statement GS. */
5180 static inline tree
5181 gimple_omp_taskgroup_clauses (const gimple *gs)
5183 GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5184 return
5185 static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5189 /* Return a pointer to the clauses associated with OMP taskgroup statement
5190 GS. */
5192 static inline tree *
5193 gimple_omp_taskgroup_clauses_ptr (gimple *gs)
5195 GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5196 return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5200 /* Set CLAUSES to be the clauses associated with OMP taskgroup statement
5201 GS. */
5203 static inline void
5204 gimple_omp_taskgroup_set_clauses (gimple *gs, tree clauses)
5206 GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5207 static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5208 = clauses;
5212 /* Return the clauses associated with OMP_MASKED statement GS. */
5214 static inline tree
5215 gimple_omp_masked_clauses (const gimple *gs)
5217 GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5218 return
5219 static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5223 /* Return a pointer to the clauses associated with OMP masked statement
5224 GS. */
5226 static inline tree *
5227 gimple_omp_masked_clauses_ptr (gimple *gs)
5229 GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5230 return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5234 /* Set CLAUSES to be the clauses associated with OMP masked statement
5235 GS. */
5237 static inline void
5238 gimple_omp_masked_set_clauses (gimple *gs, tree clauses)
5240 GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5241 static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5242 = clauses;
5246 /* Return the clauses associated with OMP_SCOPE statement GS. */
5248 static inline tree
5249 gimple_omp_scope_clauses (const gimple *gs)
5251 GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5252 return
5253 static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5257 /* Return a pointer to the clauses associated with OMP scope statement
5258 GS. */
5260 static inline tree *
5261 gimple_omp_scope_clauses_ptr (gimple *gs)
5263 GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5264 return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5268 /* Set CLAUSES to be the clauses associated with OMP scope statement
5269 GS. */
5271 static inline void
5272 gimple_omp_scope_set_clauses (gimple *gs, tree clauses)
5274 GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5275 static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5276 = clauses;
5280 /* Return the kind of the OMP_FOR statemement G. */
5282 static inline int
5283 gimple_omp_for_kind (const gimple *g)
5285 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5286 return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
5290 /* Set the kind of the OMP_FOR statement G. */
5292 static inline void
5293 gimple_omp_for_set_kind (gomp_for *g, int kind)
5295 g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
5296 | (kind & GF_OMP_FOR_KIND_MASK);
5300 /* Return true if OMP_FOR statement G has the
5301 GF_OMP_FOR_COMBINED flag set. */
5303 static inline bool
5304 gimple_omp_for_combined_p (const gimple *g)
5306 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5307 return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
5311 /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
5312 the boolean value of COMBINED_P. */
5314 static inline void
5315 gimple_omp_for_set_combined_p (gomp_for *g, bool combined_p)
5317 if (combined_p)
5318 g->subcode |= GF_OMP_FOR_COMBINED;
5319 else
5320 g->subcode &= ~GF_OMP_FOR_COMBINED;
5324 /* Return true if the OMP_FOR statement G has the
5325 GF_OMP_FOR_COMBINED_INTO flag set. */
5327 static inline bool
5328 gimple_omp_for_combined_into_p (const gimple *g)
5330 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5331 return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
5335 /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
5336 on the boolean value of COMBINED_P. */
5338 static inline void
5339 gimple_omp_for_set_combined_into_p (gomp_for *g, bool combined_p)
5341 if (combined_p)
5342 g->subcode |= GF_OMP_FOR_COMBINED_INTO;
5343 else
5344 g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
5348 /* Return the clauses associated with the OMP_FOR statement GS. */
5350 static inline tree
5351 gimple_omp_for_clauses (const gimple *gs)
5353 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5354 return omp_for_stmt->clauses;
5358 /* Return a pointer to the clauses associated with the OMP_FOR statement
5359 GS. */
5361 static inline tree *
5362 gimple_omp_for_clauses_ptr (gimple *gs)
5364 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5365 return &omp_for_stmt->clauses;
5369 /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
5370 GS. */
5372 static inline void
5373 gimple_omp_for_set_clauses (gimple *gs, tree clauses)
5375 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5376 omp_for_stmt->clauses = clauses;
5380 /* Get the collapse count of the OMP_FOR statement GS. */
5382 static inline size_t
5383 gimple_omp_for_collapse (const gimple *gs)
5385 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5386 return omp_for_stmt->collapse;
5390 /* Return the condition code associated with the OMP_FOR statement GS. */
5392 static inline enum tree_code
5393 gimple_omp_for_cond (const gimple *gs, size_t i)
5395 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5396 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5397 return omp_for_stmt->iter[i].cond;
5401 /* Set COND to be the condition code for the OMP_FOR statement GS. */
5403 static inline void
5404 gimple_omp_for_set_cond (gimple *gs, size_t i, enum tree_code cond)
5406 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5407 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
5408 && i < omp_for_stmt->collapse);
5409 omp_for_stmt->iter[i].cond = cond;
5413 /* Return the index variable for the OMP_FOR statement GS. */
5415 static inline tree
5416 gimple_omp_for_index (const gimple *gs, size_t i)
5418 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5419 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5420 return omp_for_stmt->iter[i].index;
5424 /* Return a pointer to the index variable for the OMP_FOR statement GS. */
5426 static inline tree *
5427 gimple_omp_for_index_ptr (gimple *gs, size_t i)
5429 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5430 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5431 return &omp_for_stmt->iter[i].index;
5435 /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
5437 static inline void
5438 gimple_omp_for_set_index (gimple *gs, size_t i, tree index)
5440 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5441 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5442 omp_for_stmt->iter[i].index = index;
5446 /* Return the initial value for the OMP_FOR statement GS. */
5448 static inline tree
5449 gimple_omp_for_initial (const gimple *gs, size_t i)
5451 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5452 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5453 return omp_for_stmt->iter[i].initial;
5457 /* Return a pointer to the initial value for the OMP_FOR statement GS. */
5459 static inline tree *
5460 gimple_omp_for_initial_ptr (gimple *gs, size_t i)
5462 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5463 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5464 return &omp_for_stmt->iter[i].initial;
5468 /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
5470 static inline void
5471 gimple_omp_for_set_initial (gimple *gs, size_t i, tree initial)
5473 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5474 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5475 omp_for_stmt->iter[i].initial = initial;
5479 /* Return the final value for the OMP_FOR statement GS. */
5481 static inline tree
5482 gimple_omp_for_final (const gimple *gs, size_t i)
5484 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5485 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5486 return omp_for_stmt->iter[i].final;
5490 /* Return a pointer to the final value for the OMP_FOR statement GS. */
5492 static inline tree *
5493 gimple_omp_for_final_ptr (gimple *gs, size_t i)
5495 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5496 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5497 return &omp_for_stmt->iter[i].final;
5501 /* Set FINAL to be the final value for the OMP_FOR statement GS. */
5503 static inline void
5504 gimple_omp_for_set_final (gimple *gs, size_t i, tree final)
5506 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5507 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5508 omp_for_stmt->iter[i].final = final;
5512 /* Return the increment value for the OMP_FOR statement GS. */
5514 static inline tree
5515 gimple_omp_for_incr (const gimple *gs, size_t i)
5517 const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5518 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5519 return omp_for_stmt->iter[i].incr;
5523 /* Return a pointer to the increment value for the OMP_FOR statement GS. */
5525 static inline tree *
5526 gimple_omp_for_incr_ptr (gimple *gs, size_t i)
5528 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5529 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5530 return &omp_for_stmt->iter[i].incr;
5534 /* Set INCR to be the increment value for the OMP_FOR statement GS. */
5536 static inline void
5537 gimple_omp_for_set_incr (gimple *gs, size_t i, tree incr)
5539 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5540 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5541 omp_for_stmt->iter[i].incr = incr;
5545 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
5546 statement GS starts. */
5548 static inline gimple_seq *
5549 gimple_omp_for_pre_body_ptr (gimple *gs)
5551 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5552 return &omp_for_stmt->pre_body;
5556 /* Return the sequence of statements to execute before the OMP_FOR
5557 statement GS starts. */
5559 static inline gimple_seq
5560 gimple_omp_for_pre_body (const gimple *gs)
5562 return *gimple_omp_for_pre_body_ptr (const_cast <gimple *> (gs));
5566 /* Set PRE_BODY to be the sequence of statements to execute before the
5567 OMP_FOR statement GS starts. */
5569 static inline void
5570 gimple_omp_for_set_pre_body (gimple *gs, gimple_seq pre_body)
5572 gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5573 omp_for_stmt->pre_body = pre_body;
5576 /* Return the clauses associated with OMP_PARALLEL GS. */
5578 static inline tree
5579 gimple_omp_parallel_clauses (const gimple *gs)
5581 const gomp_parallel *omp_parallel_stmt = as_a <const gomp_parallel *> (gs);
5582 return omp_parallel_stmt->clauses;
5586 /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
5588 static inline tree *
5589 gimple_omp_parallel_clauses_ptr (gomp_parallel *omp_parallel_stmt)
5591 return &omp_parallel_stmt->clauses;
5595 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
5597 static inline void
5598 gimple_omp_parallel_set_clauses (gomp_parallel *omp_parallel_stmt,
5599 tree clauses)
5601 omp_parallel_stmt->clauses = clauses;
5605 /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
5607 static inline tree
5608 gimple_omp_parallel_child_fn (const gomp_parallel *omp_parallel_stmt)
5610 return omp_parallel_stmt->child_fn;
5613 /* Return a pointer to the child function used to hold the body of
5614 OMP_PARALLEL_STMT. */
5616 static inline tree *
5617 gimple_omp_parallel_child_fn_ptr (gomp_parallel *omp_parallel_stmt)
5619 return &omp_parallel_stmt->child_fn;
5623 /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
5625 static inline void
5626 gimple_omp_parallel_set_child_fn (gomp_parallel *omp_parallel_stmt,
5627 tree child_fn)
5629 omp_parallel_stmt->child_fn = child_fn;
5633 /* Return the artificial argument used to send variables and values
5634 from the parent to the children threads in OMP_PARALLEL_STMT. */
5636 static inline tree
5637 gimple_omp_parallel_data_arg (const gomp_parallel *omp_parallel_stmt)
5639 return omp_parallel_stmt->data_arg;
5643 /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
5645 static inline tree *
5646 gimple_omp_parallel_data_arg_ptr (gomp_parallel *omp_parallel_stmt)
5648 return &omp_parallel_stmt->data_arg;
5652 /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
5654 static inline void
5655 gimple_omp_parallel_set_data_arg (gomp_parallel *omp_parallel_stmt,
5656 tree data_arg)
5658 omp_parallel_stmt->data_arg = data_arg;
5661 /* Return the clauses associated with OMP_TASK GS. */
5663 static inline tree
5664 gimple_omp_task_clauses (const gimple *gs)
5666 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5667 return omp_task_stmt->clauses;
5671 /* Return a pointer to the clauses associated with OMP_TASK GS. */
5673 static inline tree *
5674 gimple_omp_task_clauses_ptr (gimple *gs)
5676 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5677 return &omp_task_stmt->clauses;
5681 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5682 GS. */
5684 static inline void
5685 gimple_omp_task_set_clauses (gimple *gs, tree clauses)
5687 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5688 omp_task_stmt->clauses = clauses;
5692 /* Return true if OMP task statement G has the
5693 GF_OMP_TASK_TASKLOOP flag set. */
5695 static inline bool
5696 gimple_omp_task_taskloop_p (const gimple *g)
5698 GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5699 return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
5703 /* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
5704 value of TASKLOOP_P. */
5706 static inline void
5707 gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
5709 GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5710 if (taskloop_p)
5711 g->subcode |= GF_OMP_TASK_TASKLOOP;
5712 else
5713 g->subcode &= ~GF_OMP_TASK_TASKLOOP;
5717 /* Return true if OMP task statement G has the
5718 GF_OMP_TASK_TASKWAIT flag set. */
5720 static inline bool
5721 gimple_omp_task_taskwait_p (const gimple *g)
5723 GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5724 return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKWAIT) != 0;
5728 /* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
5729 value of TASKWAIT_P. */
5731 static inline void
5732 gimple_omp_task_set_taskwait_p (gimple *g, bool taskwait_p)
5734 GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5735 if (taskwait_p)
5736 g->subcode |= GF_OMP_TASK_TASKWAIT;
5737 else
5738 g->subcode &= ~GF_OMP_TASK_TASKWAIT;
5742 /* Return the child function used to hold the body of OMP_TASK GS. */
5744 static inline tree
5745 gimple_omp_task_child_fn (const gimple *gs)
5747 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5748 return omp_task_stmt->child_fn;
5751 /* Return a pointer to the child function used to hold the body of
5752 OMP_TASK GS. */
5754 static inline tree *
5755 gimple_omp_task_child_fn_ptr (gimple *gs)
5757 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5758 return &omp_task_stmt->child_fn;
5762 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
5764 static inline void
5765 gimple_omp_task_set_child_fn (gimple *gs, tree child_fn)
5767 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5768 omp_task_stmt->child_fn = child_fn;
5772 /* Return the artificial argument used to send variables and values
5773 from the parent to the children threads in OMP_TASK GS. */
5775 static inline tree
5776 gimple_omp_task_data_arg (const gimple *gs)
5778 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5779 return omp_task_stmt->data_arg;
5783 /* Return a pointer to the data argument for OMP_TASK GS. */
5785 static inline tree *
5786 gimple_omp_task_data_arg_ptr (gimple *gs)
5788 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5789 return &omp_task_stmt->data_arg;
5793 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
5795 static inline void
5796 gimple_omp_task_set_data_arg (gimple *gs, tree data_arg)
5798 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5799 omp_task_stmt->data_arg = data_arg;
5803 /* Return the clauses associated with OMP_TASK GS. */
5805 static inline tree
5806 gimple_omp_taskreg_clauses (const gimple *gs)
5808 const gimple_statement_omp_taskreg *omp_taskreg_stmt
5809 = as_a <const gimple_statement_omp_taskreg *> (gs);
5810 return omp_taskreg_stmt->clauses;
5814 /* Return a pointer to the clauses associated with OMP_TASK GS. */
5816 static inline tree *
5817 gimple_omp_taskreg_clauses_ptr (gimple *gs)
5819 gimple_statement_omp_taskreg *omp_taskreg_stmt
5820 = as_a <gimple_statement_omp_taskreg *> (gs);
5821 return &omp_taskreg_stmt->clauses;
5825 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5826 GS. */
5828 static inline void
5829 gimple_omp_taskreg_set_clauses (gimple *gs, tree clauses)
5831 gimple_statement_omp_taskreg *omp_taskreg_stmt
5832 = as_a <gimple_statement_omp_taskreg *> (gs);
5833 omp_taskreg_stmt->clauses = clauses;
5837 /* Return the child function used to hold the body of OMP_TASK GS. */
5839 static inline tree
5840 gimple_omp_taskreg_child_fn (const gimple *gs)
5842 const gimple_statement_omp_taskreg *omp_taskreg_stmt
5843 = as_a <const gimple_statement_omp_taskreg *> (gs);
5844 return omp_taskreg_stmt->child_fn;
5847 /* Return a pointer to the child function used to hold the body of
5848 OMP_TASK GS. */
5850 static inline tree *
5851 gimple_omp_taskreg_child_fn_ptr (gimple *gs)
5853 gimple_statement_omp_taskreg *omp_taskreg_stmt
5854 = as_a <gimple_statement_omp_taskreg *> (gs);
5855 return &omp_taskreg_stmt->child_fn;
5859 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
5861 static inline void
5862 gimple_omp_taskreg_set_child_fn (gimple *gs, tree child_fn)
5864 gimple_statement_omp_taskreg *omp_taskreg_stmt
5865 = as_a <gimple_statement_omp_taskreg *> (gs);
5866 omp_taskreg_stmt->child_fn = child_fn;
5870 /* Return the artificial argument used to send variables and values
5871 from the parent to the children threads in OMP_TASK GS. */
5873 static inline tree
5874 gimple_omp_taskreg_data_arg (const gimple *gs)
5876 const gimple_statement_omp_taskreg *omp_taskreg_stmt
5877 = as_a <const gimple_statement_omp_taskreg *> (gs);
5878 return omp_taskreg_stmt->data_arg;
5882 /* Return a pointer to the data argument for OMP_TASK GS. */
5884 static inline tree *
5885 gimple_omp_taskreg_data_arg_ptr (gimple *gs)
5887 gimple_statement_omp_taskreg *omp_taskreg_stmt
5888 = as_a <gimple_statement_omp_taskreg *> (gs);
5889 return &omp_taskreg_stmt->data_arg;
5893 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
5895 static inline void
5896 gimple_omp_taskreg_set_data_arg (gimple *gs, tree data_arg)
5898 gimple_statement_omp_taskreg *omp_taskreg_stmt
5899 = as_a <gimple_statement_omp_taskreg *> (gs);
5900 omp_taskreg_stmt->data_arg = data_arg;
5904 /* Return the copy function used to hold the body of OMP_TASK GS. */
5906 static inline tree
5907 gimple_omp_task_copy_fn (const gimple *gs)
5909 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5910 return omp_task_stmt->copy_fn;
5913 /* Return a pointer to the copy function used to hold the body of
5914 OMP_TASK GS. */
5916 static inline tree *
5917 gimple_omp_task_copy_fn_ptr (gimple *gs)
5919 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5920 return &omp_task_stmt->copy_fn;
5924 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
5926 static inline void
5927 gimple_omp_task_set_copy_fn (gimple *gs, tree copy_fn)
5929 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5930 omp_task_stmt->copy_fn = copy_fn;
5934 /* Return size of the data block in bytes in OMP_TASK GS. */
5936 static inline tree
5937 gimple_omp_task_arg_size (const gimple *gs)
5939 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5940 return omp_task_stmt->arg_size;
5944 /* Return a pointer to the data block size for OMP_TASK GS. */
5946 static inline tree *
5947 gimple_omp_task_arg_size_ptr (gimple *gs)
5949 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5950 return &omp_task_stmt->arg_size;
5954 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
5956 static inline void
5957 gimple_omp_task_set_arg_size (gimple *gs, tree arg_size)
5959 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5960 omp_task_stmt->arg_size = arg_size;
5964 /* Return align of the data block in bytes in OMP_TASK GS. */
5966 static inline tree
5967 gimple_omp_task_arg_align (const gimple *gs)
5969 const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5970 return omp_task_stmt->arg_align;
5974 /* Return a pointer to the data block align for OMP_TASK GS. */
5976 static inline tree *
5977 gimple_omp_task_arg_align_ptr (gimple *gs)
5979 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5980 return &omp_task_stmt->arg_align;
5984 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
5986 static inline void
5987 gimple_omp_task_set_arg_align (gimple *gs, tree arg_align)
5989 gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5990 omp_task_stmt->arg_align = arg_align;
5994 /* Return the clauses associated with OMP_SINGLE GS. */
5996 static inline tree
5997 gimple_omp_single_clauses (const gimple *gs)
5999 const gomp_single *omp_single_stmt = as_a <const gomp_single *> (gs);
6000 return omp_single_stmt->clauses;
6004 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
6006 static inline tree *
6007 gimple_omp_single_clauses_ptr (gimple *gs)
6009 gomp_single *omp_single_stmt = as_a <gomp_single *> (gs);
6010 return &omp_single_stmt->clauses;
6014 /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
6016 static inline void
6017 gimple_omp_single_set_clauses (gomp_single *omp_single_stmt, tree clauses)
6019 omp_single_stmt->clauses = clauses;
6023 /* Return the clauses associated with OMP_TARGET GS. */
6025 static inline tree
6026 gimple_omp_target_clauses (const gimple *gs)
6028 const gomp_target *omp_target_stmt = as_a <const gomp_target *> (gs);
6029 return omp_target_stmt->clauses;
6033 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
6035 static inline tree *
6036 gimple_omp_target_clauses_ptr (gimple *gs)
6038 gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
6039 return &omp_target_stmt->clauses;
6043 /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
6045 static inline void
6046 gimple_omp_target_set_clauses (gomp_target *omp_target_stmt,
6047 tree clauses)
6049 omp_target_stmt->clauses = clauses;
6053 /* Return the kind of the OMP_TARGET G. */
6055 static inline int
6056 gimple_omp_target_kind (const gimple *g)
6058 GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
6059 return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
6063 /* Set the kind of the OMP_TARGET G. */
6065 static inline void
6066 gimple_omp_target_set_kind (gomp_target *g, int kind)
6068 g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
6069 | (kind & GF_OMP_TARGET_KIND_MASK);
6073 /* Return the child function used to hold the body of OMP_TARGET_STMT. */
6075 static inline tree
6076 gimple_omp_target_child_fn (const gomp_target *omp_target_stmt)
6078 return omp_target_stmt->child_fn;
6081 /* Return a pointer to the child function used to hold the body of
6082 OMP_TARGET_STMT. */
6084 static inline tree *
6085 gimple_omp_target_child_fn_ptr (gomp_target *omp_target_stmt)
6087 return &omp_target_stmt->child_fn;
6091 /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
6093 static inline void
6094 gimple_omp_target_set_child_fn (gomp_target *omp_target_stmt,
6095 tree child_fn)
6097 omp_target_stmt->child_fn = child_fn;
6101 /* Return the artificial argument used to send variables and values
6102 from the parent to the children threads in OMP_TARGET_STMT. */
6104 static inline tree
6105 gimple_omp_target_data_arg (const gomp_target *omp_target_stmt)
6107 return omp_target_stmt->data_arg;
6111 /* Return a pointer to the data argument for OMP_TARGET GS. */
6113 static inline tree *
6114 gimple_omp_target_data_arg_ptr (gomp_target *omp_target_stmt)
6116 return &omp_target_stmt->data_arg;
6120 /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
6122 static inline void
6123 gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
6124 tree data_arg)
6126 omp_target_stmt->data_arg = data_arg;
6130 /* Return the clauses associated with OMP_TEAMS GS. */
6132 static inline tree
6133 gimple_omp_teams_clauses (const gimple *gs)
6135 const gomp_teams *omp_teams_stmt = as_a <const gomp_teams *> (gs);
6136 return omp_teams_stmt->clauses;
6140 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
6142 static inline tree *
6143 gimple_omp_teams_clauses_ptr (gimple *gs)
6145 gomp_teams *omp_teams_stmt = as_a <gomp_teams *> (gs);
6146 return &omp_teams_stmt->clauses;
6150 /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
6152 static inline void
6153 gimple_omp_teams_set_clauses (gomp_teams *omp_teams_stmt, tree clauses)
6155 omp_teams_stmt->clauses = clauses;
6158 /* Return the child function used to hold the body of OMP_TEAMS_STMT. */
6160 static inline tree
6161 gimple_omp_teams_child_fn (const gomp_teams *omp_teams_stmt)
6163 return omp_teams_stmt->child_fn;
6166 /* Return a pointer to the child function used to hold the body of
6167 OMP_TEAMS_STMT. */
6169 static inline tree *
6170 gimple_omp_teams_child_fn_ptr (gomp_teams *omp_teams_stmt)
6172 return &omp_teams_stmt->child_fn;
6176 /* Set CHILD_FN to be the child function for OMP_TEAMS_STMT. */
6178 static inline void
6179 gimple_omp_teams_set_child_fn (gomp_teams *omp_teams_stmt, tree child_fn)
6181 omp_teams_stmt->child_fn = child_fn;
6185 /* Return the artificial argument used to send variables and values
6186 from the parent to the children threads in OMP_TEAMS_STMT. */
6188 static inline tree
6189 gimple_omp_teams_data_arg (const gomp_teams *omp_teams_stmt)
6191 return omp_teams_stmt->data_arg;
6195 /* Return a pointer to the data argument for OMP_TEAMS_STMT. */
6197 static inline tree *
6198 gimple_omp_teams_data_arg_ptr (gomp_teams *omp_teams_stmt)
6200 return &omp_teams_stmt->data_arg;
6204 /* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT. */
6206 static inline void
6207 gimple_omp_teams_set_data_arg (gomp_teams *omp_teams_stmt, tree data_arg)
6209 omp_teams_stmt->data_arg = data_arg;
6212 /* Return the host flag of an OMP_TEAMS_STMT. */
6214 static inline bool
6215 gimple_omp_teams_host (const gomp_teams *omp_teams_stmt)
6217 return (gimple_omp_subcode (omp_teams_stmt) & GF_OMP_TEAMS_HOST) != 0;
6220 /* Set host flag of an OMP_TEAMS_STMT to VALUE. */
6222 static inline void
6223 gimple_omp_teams_set_host (gomp_teams *omp_teams_stmt, bool value)
6225 if (value)
6226 omp_teams_stmt->subcode |= GF_OMP_TEAMS_HOST;
6227 else
6228 omp_teams_stmt->subcode &= ~GF_OMP_TEAMS_HOST;
6231 /* Return the clauses associated with OMP_SECTIONS GS. */
6233 static inline tree
6234 gimple_omp_sections_clauses (const gimple *gs)
6236 const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6237 return omp_sections_stmt->clauses;
6241 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
6243 static inline tree *
6244 gimple_omp_sections_clauses_ptr (gimple *gs)
6246 gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6247 return &omp_sections_stmt->clauses;
6251 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
6252 GS. */
6254 static inline void
6255 gimple_omp_sections_set_clauses (gimple *gs, tree clauses)
6257 gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6258 omp_sections_stmt->clauses = clauses;
6262 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
6263 in GS. */
6265 static inline tree
6266 gimple_omp_sections_control (const gimple *gs)
6268 const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6269 return omp_sections_stmt->control;
6273 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
6274 GS. */
6276 static inline tree *
6277 gimple_omp_sections_control_ptr (gimple *gs)
6279 gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6280 return &omp_sections_stmt->control;
6284 /* Set CONTROL to be the set of clauses associated with the
6285 GIMPLE_OMP_SECTIONS in GS. */
6287 static inline void
6288 gimple_omp_sections_set_control (gimple *gs, tree control)
6290 gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6291 omp_sections_stmt->control = control;
6295 /* Set the value being stored in an atomic store. */
6297 static inline void
6298 gimple_omp_atomic_store_set_val (gomp_atomic_store *store_stmt, tree val)
6300 store_stmt->val = val;
6304 /* Return the value being stored in an atomic store. */
6306 static inline tree
6307 gimple_omp_atomic_store_val (const gomp_atomic_store *store_stmt)
6309 return store_stmt->val;
6313 /* Return a pointer to the value being stored in an atomic store. */
6315 static inline tree *
6316 gimple_omp_atomic_store_val_ptr (gomp_atomic_store *store_stmt)
6318 return &store_stmt->val;
6322 /* Set the LHS of an atomic load. */
6324 static inline void
6325 gimple_omp_atomic_load_set_lhs (gomp_atomic_load *load_stmt, tree lhs)
6327 load_stmt->lhs = lhs;
6331 /* Get the LHS of an atomic load. */
6333 static inline tree
6334 gimple_omp_atomic_load_lhs (const gomp_atomic_load *load_stmt)
6336 return load_stmt->lhs;
6340 /* Return a pointer to the LHS of an atomic load. */
6342 static inline tree *
6343 gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load *load_stmt)
6345 return &load_stmt->lhs;
6349 /* Set the RHS of an atomic load. */
6351 static inline void
6352 gimple_omp_atomic_load_set_rhs (gomp_atomic_load *load_stmt, tree rhs)
6354 load_stmt->rhs = rhs;
6358 /* Get the RHS of an atomic load. */
6360 static inline tree
6361 gimple_omp_atomic_load_rhs (const gomp_atomic_load *load_stmt)
6363 return load_stmt->rhs;
6367 /* Return a pointer to the RHS of an atomic load. */
6369 static inline tree *
6370 gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load *load_stmt)
6372 return &load_stmt->rhs;
6376 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6378 static inline tree
6379 gimple_omp_continue_control_def (const gomp_continue *cont_stmt)
6381 return cont_stmt->control_def;
6384 /* The same as above, but return the address. */
6386 static inline tree *
6387 gimple_omp_continue_control_def_ptr (gomp_continue *cont_stmt)
6389 return &cont_stmt->control_def;
6392 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6394 static inline void
6395 gimple_omp_continue_set_control_def (gomp_continue *cont_stmt, tree def)
6397 cont_stmt->control_def = def;
6401 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6403 static inline tree
6404 gimple_omp_continue_control_use (const gomp_continue *cont_stmt)
6406 return cont_stmt->control_use;
6410 /* The same as above, but return the address. */
6412 static inline tree *
6413 gimple_omp_continue_control_use_ptr (gomp_continue *cont_stmt)
6415 return &cont_stmt->control_use;
6419 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6421 static inline void
6422 gimple_omp_continue_set_control_use (gomp_continue *cont_stmt, tree use)
6424 cont_stmt->control_use = use;
6427 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
6428 TRANSACTION_STMT. */
6430 static inline gimple_seq *
6431 gimple_transaction_body_ptr (gtransaction *transaction_stmt)
6433 return &transaction_stmt->body;
6436 /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
6438 static inline gimple_seq
6439 gimple_transaction_body (const gtransaction *transaction_stmt)
6441 return transaction_stmt->body;
6444 /* Return the label associated with a GIMPLE_TRANSACTION. */
6446 static inline tree
6447 gimple_transaction_label_norm (const gtransaction *transaction_stmt)
6449 return transaction_stmt->label_norm;
6452 static inline tree *
6453 gimple_transaction_label_norm_ptr (gtransaction *transaction_stmt)
6455 return &transaction_stmt->label_norm;
6458 static inline tree
6459 gimple_transaction_label_uninst (const gtransaction *transaction_stmt)
6461 return transaction_stmt->label_uninst;
6464 static inline tree *
6465 gimple_transaction_label_uninst_ptr (gtransaction *transaction_stmt)
6467 return &transaction_stmt->label_uninst;
6470 static inline tree
6471 gimple_transaction_label_over (const gtransaction *transaction_stmt)
6473 return transaction_stmt->label_over;
6476 static inline tree *
6477 gimple_transaction_label_over_ptr (gtransaction *transaction_stmt)
6479 return &transaction_stmt->label_over;
6482 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
6484 static inline unsigned int
6485 gimple_transaction_subcode (const gtransaction *transaction_stmt)
6487 return transaction_stmt->subcode;
6490 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
6491 TRANSACTION_STMT. */
6493 static inline void
6494 gimple_transaction_set_body (gtransaction *transaction_stmt,
6495 gimple_seq body)
6497 transaction_stmt->body = body;
6500 /* Set the label associated with a GIMPLE_TRANSACTION. */
6502 static inline void
6503 gimple_transaction_set_label_norm (gtransaction *transaction_stmt, tree label)
6505 transaction_stmt->label_norm = label;
6508 static inline void
6509 gimple_transaction_set_label_uninst (gtransaction *transaction_stmt, tree label)
6511 transaction_stmt->label_uninst = label;
6514 static inline void
6515 gimple_transaction_set_label_over (gtransaction *transaction_stmt, tree label)
6517 transaction_stmt->label_over = label;
6520 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
6522 static inline void
6523 gimple_transaction_set_subcode (gtransaction *transaction_stmt,
6524 unsigned int subcode)
6526 transaction_stmt->subcode = subcode;
6529 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
6531 static inline tree *
6532 gimple_return_retval_ptr (greturn *gs)
6534 return &gs->op[0];
6537 /* Return the return value for GIMPLE_RETURN GS. */
6539 static inline tree
6540 gimple_return_retval (const greturn *gs)
6542 return gs->op[0];
6546 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
6548 static inline void
6549 gimple_return_set_retval (greturn *gs, tree retval)
6551 gs->op[0] = retval;
6555 /* Returns true when the gimple statement STMT is any of the OMP types. */
6557 #define CASE_GIMPLE_OMP \
6558 case GIMPLE_OMP_PARALLEL: \
6559 case GIMPLE_OMP_TASK: \
6560 case GIMPLE_OMP_FOR: \
6561 case GIMPLE_OMP_SECTIONS: \
6562 case GIMPLE_OMP_SECTIONS_SWITCH: \
6563 case GIMPLE_OMP_SINGLE: \
6564 case GIMPLE_OMP_TARGET: \
6565 case GIMPLE_OMP_TEAMS: \
6566 case GIMPLE_OMP_SCOPE: \
6567 case GIMPLE_OMP_SECTION: \
6568 case GIMPLE_OMP_MASTER: \
6569 case GIMPLE_OMP_MASKED: \
6570 case GIMPLE_OMP_TASKGROUP: \
6571 case GIMPLE_OMP_ORDERED: \
6572 case GIMPLE_OMP_CRITICAL: \
6573 case GIMPLE_OMP_SCAN: \
6574 case GIMPLE_OMP_RETURN: \
6575 case GIMPLE_OMP_ATOMIC_LOAD: \
6576 case GIMPLE_OMP_ATOMIC_STORE: \
6577 case GIMPLE_OMP_CONTINUE
6579 static inline bool
6580 is_gimple_omp (const gimple *stmt)
6582 switch (gimple_code (stmt))
6584 CASE_GIMPLE_OMP:
6585 return true;
6586 default:
6587 return false;
6591 /* Return true if the OMP gimple statement STMT is any of the OpenACC types
6592 specifically. */
6594 static inline bool
6595 is_gimple_omp_oacc (const gimple *stmt)
6597 gcc_assert (is_gimple_omp (stmt));
6598 switch (gimple_code (stmt))
6600 case GIMPLE_OMP_ATOMIC_LOAD:
6601 case GIMPLE_OMP_ATOMIC_STORE:
6602 case GIMPLE_OMP_CONTINUE:
6603 case GIMPLE_OMP_RETURN:
6604 /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
6605 the two. */
6606 gcc_unreachable ();
6608 case GIMPLE_OMP_FOR:
6609 switch (gimple_omp_for_kind (stmt))
6611 case GF_OMP_FOR_KIND_OACC_LOOP:
6612 return true;
6613 default:
6614 return false;
6616 case GIMPLE_OMP_TARGET:
6617 switch (gimple_omp_target_kind (stmt))
6619 case GF_OMP_TARGET_KIND_OACC_PARALLEL:
6620 case GF_OMP_TARGET_KIND_OACC_KERNELS:
6621 case GF_OMP_TARGET_KIND_OACC_SERIAL:
6622 case GF_OMP_TARGET_KIND_OACC_DATA:
6623 case GF_OMP_TARGET_KIND_OACC_UPDATE:
6624 case GF_OMP_TARGET_KIND_OACC_ENTER_DATA:
6625 case GF_OMP_TARGET_KIND_OACC_EXIT_DATA:
6626 case GF_OMP_TARGET_KIND_OACC_DECLARE:
6627 case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
6628 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
6629 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
6630 case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS:
6631 return true;
6632 default:
6633 return false;
6635 default:
6636 return false;
6641 /* Return true if the OMP gimple statement STMT is offloaded. */
6643 static inline bool
6644 is_gimple_omp_offloaded (const gimple *stmt)
6646 gcc_assert (is_gimple_omp (stmt));
6647 switch (gimple_code (stmt))
6649 case GIMPLE_OMP_TARGET:
6650 switch (gimple_omp_target_kind (stmt))
6652 case GF_OMP_TARGET_KIND_REGION:
6653 case GF_OMP_TARGET_KIND_OACC_PARALLEL:
6654 case GF_OMP_TARGET_KIND_OACC_KERNELS:
6655 case GF_OMP_TARGET_KIND_OACC_SERIAL:
6656 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
6657 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
6658 return true;
6659 default:
6660 return false;
6662 default:
6663 return false;
6668 /* Returns TRUE if statement G is a GIMPLE_NOP. */
6670 static inline bool
6671 gimple_nop_p (const gimple *g)
6673 return gimple_code (g) == GIMPLE_NOP;
6677 /* Return true if GS is a GIMPLE_RESX. */
6679 static inline bool
6680 is_gimple_resx (const gimple *gs)
6682 return gimple_code (gs) == GIMPLE_RESX;
6686 /* Enum and arrays used for allocation stats. Keep in sync with
6687 gimple.c:gimple_alloc_kind_names. */
6688 enum gimple_alloc_kind
6690 gimple_alloc_kind_assign, /* Assignments. */
6691 gimple_alloc_kind_phi, /* PHI nodes. */
6692 gimple_alloc_kind_cond, /* Conditionals. */
6693 gimple_alloc_kind_rest, /* Everything else. */
6694 gimple_alloc_kind_all
6697 extern uint64_t gimple_alloc_counts[];
6698 extern uint64_t gimple_alloc_sizes[];
6700 /* Return the allocation kind for a given stmt CODE. */
6701 static inline enum gimple_alloc_kind
6702 gimple_alloc_kind (enum gimple_code code)
6704 switch (code)
6706 case GIMPLE_ASSIGN:
6707 return gimple_alloc_kind_assign;
6708 case GIMPLE_PHI:
6709 return gimple_alloc_kind_phi;
6710 case GIMPLE_COND:
6711 return gimple_alloc_kind_cond;
6712 default:
6713 return gimple_alloc_kind_rest;
6717 /* Return true if a location should not be emitted for this statement
6718 by annotate_all_with_location. */
6720 static inline bool
6721 gimple_do_not_emit_location_p (gimple *g)
6723 return gimple_plf (g, GF_PLF_1);
6726 /* Mark statement G so a location will not be emitted by
6727 annotate_one_with_location. */
6729 static inline void
6730 gimple_set_do_not_emit_location (gimple *g)
6732 /* The PLF flags are initialized to 0 when a new tuple is created,
6733 so no need to initialize it anywhere. */
6734 gimple_set_plf (g, GF_PLF_1, true);
6737 #endif /* GCC_GIMPLE_H */