1 /* Gimple IR definitions.
3 Copyright (C) 2007-2022 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
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
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/>. */
25 #include "tree-ssa-alias.h"
26 #include "gimple-expr.h"
28 typedef gimple
*gimple_seq_node
;
31 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
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 \
52 #define GIMPLE_CHECK(GS, CODE) \
54 const gimple *__gs = (GS); \
55 if (gimple_code (__gs) != (CODE)) \
56 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
57 (CODE), ERROR_MARK); \
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 ())
67 const char *file
= __FILE__
,
69 const char *fun
= NULL
)
72 T ret
= dyn_cast
<T
> (gs
);
74 gimple_check_failed (gs
, file
, line
, fun
,
75 remove_pointer
<T
>::type::code_
, ERROR_MARK
);
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 ())
86 const char *file
= __FILE__
,
88 const char *fun
= NULL
)
91 T ret
= dyn_cast
<T
> (gs
);
93 gimple_check_failed (gs
, file
, line
, fun
,
94 remove_pointer
<T
>::type::code_
, ERROR_MARK
);
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
>
102 GIMPLE_CHECK2(gimple
*gs
)
104 return as_a
<T
> (gs
);
106 template <typename T
>
108 GIMPLE_CHECK2(const gimple
*gs
)
110 return as_a
<T
> (gs
);
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. */
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_ORDERED_STANDALONE
= 1 << 0,
198 GF_OMP_ATOMIC_MEMORY_ORDER
= (1 << 6) - 1,
199 GF_OMP_ATOMIC_NEED_VALUE
= 1 << 6,
200 GF_OMP_ATOMIC_WEAK
= 1 << 7,
201 GF_PREDICT_TAKEN
= 1 << 15
204 /* This subcode tells apart different kinds of stmts that are not used
205 for codegen, but rather to retain debug information. */
206 enum gimple_debug_subcode
{
207 GIMPLE_DEBUG_BIND
= 0,
208 GIMPLE_DEBUG_SOURCE_BIND
= 1,
209 GIMPLE_DEBUG_BEGIN_STMT
= 2,
210 GIMPLE_DEBUG_INLINE_ENTRY
= 3
213 /* Masks for selecting a pass local flag (PLF) to work on. These
214 masks are used by gimple_set_plf and gimple_plf. */
220 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
221 are for 64 bit hosts. */
223 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
224 chain_next ("%h.next"), variable_size
))
228 Main identifying code for a tuple. */
229 ENUM_BITFIELD(gimple_code
) code
: 8;
231 /* Nonzero if a warning should not be emitted on this tuple. */
232 unsigned int no_warning
: 1;
234 /* Nonzero if this tuple has been visited. Passes are responsible
235 for clearing this bit before using it. */
236 unsigned int visited
: 1;
238 /* Nonzero if this tuple represents a non-temporal move. */
239 unsigned int nontemporal_move
: 1;
241 /* Pass local flags. These flags are free for any pass to use as
242 they see fit. Passes should not assume that these flags contain
243 any useful value when the pass starts. Any initial state that
244 the pass requires should be set on entry to the pass. See
245 gimple_set_plf and gimple_plf for usage. */
246 unsigned int plf
: 2;
248 /* Nonzero if this statement has been modified and needs to have its
249 operands rescanned. */
250 unsigned modified
: 1;
252 /* Nonzero if this statement contains volatile operands. */
253 unsigned has_volatile_ops
: 1;
255 /* Padding to get subcode to 16 bit alignment. */
258 /* The SUBCODE field can be used for tuple-specific flags for tuples
259 that do not require subcodes. Note that SUBCODE should be at
260 least as wide as tree codes, as several tuples store tree codes
262 unsigned int subcode
: 16;
264 /* UID of this statement. This is used by passes that want to
265 assign IDs to statements. It must be assigned and used by each
266 pass. By default it should be assumed to contain garbage. */
270 Locus information for debug info. */
273 /* Number of operands in this tuple. */
277 Basic block holding this statement. */
281 Linked lists of gimple statements. The next pointers form
282 a NULL terminated list, the prev pointers are a cyclic list.
283 A gimple statement is hence also a double-ended list of
284 statements, with the pointer itself being the first element,
285 and the prev pointer being the last. */
287 gimple
*GTY((skip
)) prev
;
291 /* Base structure for tuples with operands. */
293 /* This gimple subclass has no tag value. */
295 gimple_statement_with_ops_base
: public gimple
297 /* [ WORD 1-6 ] : base class */
300 SSA operand vectors. NOTE: It should be possible to
301 amalgamate these vectors with the operand vector OP. However,
302 the SSA operand vectors are organized differently and contain
303 more information (like immediate use chaining). */
304 struct use_optype_d
GTY((skip (""))) *use_ops
;
308 /* Statements that take register operands. */
310 struct GTY((tag("GSS_WITH_OPS")))
311 gimple_statement_with_ops
: public gimple_statement_with_ops_base
313 /* [ WORD 1-7 ] : base class */
316 Operand vector. NOTE! This must always be the last field
317 of this structure. In particular, this means that this
318 structure cannot be embedded inside another one. */
319 tree
GTY((length ("%h.num_ops"))) op
[1];
323 /* Base for statements that take both memory and register operands. */
325 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
326 gimple_statement_with_memory_ops_base
: public gimple_statement_with_ops_base
328 /* [ WORD 1-7 ] : base class */
331 Virtual operands for this statement. The GC will pick them
332 up via the ssa_names array. */
333 tree
GTY((skip (""))) vdef
;
334 tree
GTY((skip (""))) vuse
;
338 /* Statements that take both memory and register operands. */
340 struct GTY((tag("GSS_WITH_MEM_OPS")))
341 gimple_statement_with_memory_ops
:
342 public gimple_statement_with_memory_ops_base
344 /* [ WORD 1-9 ] : base class */
347 Operand vector. NOTE! This must always be the last field
348 of this structure. In particular, this means that this
349 structure cannot be embedded inside another one. */
350 tree
GTY((length ("%h.num_ops"))) op
[1];
354 /* Call statements that take both memory and register operands. */
356 struct GTY((tag("GSS_CALL")))
357 gcall
: public gimple_statement_with_memory_ops_base
359 /* [ WORD 1-9 ] : base class */
362 struct pt_solution call_used
;
363 struct pt_solution call_clobbered
;
366 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
367 tree
GTY ((tag ("0"))) fntype
;
368 enum internal_fn
GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn
;
372 Operand vector. NOTE! This must always be the last field
373 of this structure. In particular, this means that this
374 structure cannot be embedded inside another one. */
375 tree
GTY((length ("%h.num_ops"))) op
[1];
377 static const enum gimple_code code_
= GIMPLE_CALL
;
381 /* OMP statements. */
383 struct GTY((tag("GSS_OMP")))
384 gimple_statement_omp
: public gimple
386 /* [ WORD 1-6 ] : base class */
395 struct GTY((tag("GSS_BIND")))
396 gbind
: public gimple
398 /* [ WORD 1-6 ] : base class */
401 Variables declared in this scope. */
405 This is different than the BLOCK field in gimple,
406 which is analogous to TREE_BLOCK (i.e., the lexical block holding
407 this statement). This field is the equivalent of BIND_EXPR_BLOCK
408 in tree land (i.e., the lexical scope defined by this bind). See
419 struct GTY((tag("GSS_CATCH")))
420 gcatch
: public gimple
422 /* [ WORD 1-6 ] : base class */
432 /* GIMPLE_EH_FILTER */
434 struct GTY((tag("GSS_EH_FILTER")))
435 geh_filter
: public gimple
437 /* [ WORD 1-6 ] : base class */
450 struct GTY((tag("GSS_EH_ELSE")))
451 geh_else
: public gimple
453 /* [ WORD 1-6 ] : base class */
456 gimple_seq n_body
, e_body
;
459 /* GIMPLE_EH_MUST_NOT_THROW */
461 struct GTY((tag("GSS_EH_MNT")))
462 geh_mnt
: public gimple
464 /* [ WORD 1-6 ] : base class */
466 /* [ WORD 7 ] Abort function decl. */
472 struct GTY((tag("GSS_PHI")))
475 /* [ WORD 1-6 ] : base class */
485 struct phi_arg_d
GTY ((length ("%h.nargs"))) args
[1];
489 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
491 struct GTY((tag("GSS_EH_CTRL")))
492 gimple_statement_eh_ctrl
: public gimple
494 /* [ WORD 1-6 ] : base class */
497 Exception region number. */
501 struct GTY((tag("GSS_EH_CTRL")))
502 gresx
: public gimple_statement_eh_ctrl
504 /* No extra fields; adds invariant:
505 stmt->code == GIMPLE_RESX. */
508 struct GTY((tag("GSS_EH_CTRL")))
509 geh_dispatch
: public gimple_statement_eh_ctrl
511 /* No extra fields; adds invariant:
512 stmt->code == GIMPLE_EH_DISPATH. */
518 struct GTY((tag("GSS_TRY")))
521 /* [ WORD 1-6 ] : base class */
524 Expression to evaluate. */
528 Cleanup expression. */
532 /* Kind of GIMPLE_TRY statements. */
533 enum gimple_try_flags
536 GIMPLE_TRY_CATCH
= 1 << 0,
539 GIMPLE_TRY_FINALLY
= 1 << 1,
540 GIMPLE_TRY_KIND
= GIMPLE_TRY_CATCH
| GIMPLE_TRY_FINALLY
,
542 /* Analogous to TRY_CATCH_IS_CLEANUP. */
543 GIMPLE_TRY_CATCH_IS_CLEANUP
= 1 << 2
546 /* GIMPLE_WITH_CLEANUP_EXPR */
548 struct GTY((tag("GSS_WCE")))
549 gimple_statement_wce
: public gimple
551 /* [ WORD 1-6 ] : base class */
553 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
554 executed if an exception is thrown, not on normal exit of its
555 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
559 Cleanup expression. */
566 struct GTY((tag("GSS_ASM")))
567 gasm
: public gimple_statement_with_memory_ops_base
569 /* [ WORD 1-9 ] : base class */
572 __asm__ statement. */
576 Number of inputs, outputs, clobbers, labels. */
583 Operand vector. NOTE! This must always be the last field
584 of this structure. In particular, this means that this
585 structure cannot be embedded inside another one. */
586 tree
GTY((length ("%h.num_ops"))) op
[1];
589 /* GIMPLE_OMP_CRITICAL */
591 struct GTY((tag("GSS_OMP_CRITICAL")))
592 gomp_critical
: public gimple_statement_omp
594 /* [ WORD 1-7 ] : base class */
600 Critical section name. */
605 struct GTY(()) gimple_omp_for_iter
{
606 /* Condition code. */
609 /* Index variable. */
624 struct GTY((tag("GSS_OMP_FOR")))
625 gomp_for
: public gimple_statement_omp
627 /* [ WORD 1-7 ] : base class */
633 Number of elements in iter array. */
637 struct gimple_omp_for_iter
* GTY((length ("%h.collapse"))) iter
;
640 Pre-body evaluated before the loop body begins. */
645 /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
647 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
648 gimple_statement_omp_parallel_layout
: public gimple_statement_omp
650 /* [ WORD 1-7 ] : base class */
657 Child function holding the body of the parallel region. */
661 Shared data argument. */
665 /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
666 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
667 gimple_statement_omp_taskreg
: public gimple_statement_omp_parallel_layout
669 /* No extra fields; adds invariant:
670 stmt->code == GIMPLE_OMP_PARALLEL
671 || stmt->code == GIMPLE_OMP_TASK
672 || stmt->code == GIMPLE_OMP_TEAMS. */
675 /* GIMPLE_OMP_PARALLEL */
676 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
677 gomp_parallel
: public gimple_statement_omp_taskreg
679 /* No extra fields; adds invariant:
680 stmt->code == GIMPLE_OMP_PARALLEL. */
683 /* GIMPLE_OMP_TARGET */
684 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
685 gomp_target
: public gimple_statement_omp_parallel_layout
687 /* No extra fields; adds invariant:
688 stmt->code == GIMPLE_OMP_TARGET. */
691 /* GIMPLE_OMP_TASK */
693 struct GTY((tag("GSS_OMP_TASK")))
694 gomp_task
: public gimple_statement_omp_taskreg
696 /* [ WORD 1-10 ] : base class */
699 Child function holding firstprivate initialization if needed. */
703 Size and alignment in bytes of the argument data block. */
709 /* GIMPLE_OMP_SECTION */
710 /* Uses struct gimple_statement_omp. */
713 /* GIMPLE_OMP_SECTIONS */
715 struct GTY((tag("GSS_OMP_SECTIONS")))
716 gomp_sections
: public gimple_statement_omp
718 /* [ WORD 1-7 ] : base class */
724 The control variable used for deciding which of the sections to
729 /* GIMPLE_OMP_CONTINUE.
731 Note: This does not inherit from gimple_statement_omp, because we
732 do not need the body field. */
734 struct GTY((tag("GSS_OMP_CONTINUE")))
735 gomp_continue
: public gimple
737 /* [ WORD 1-6 ] : base class */
746 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
747 GIMPLE_OMP_SCAN, GIMPLE_OMP_MASKED, GIMPLE_OMP_SCOPE. */
749 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
750 gimple_statement_omp_single_layout
: public gimple_statement_omp
752 /* [ WORD 1-7 ] : base class */
758 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
759 gomp_single
: public gimple_statement_omp_single_layout
761 /* No extra fields; adds invariant:
762 stmt->code == GIMPLE_OMP_SINGLE. */
765 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
766 gomp_teams
: public gimple_statement_omp_taskreg
768 /* No extra fields; adds invariant:
769 stmt->code == GIMPLE_OMP_TEAMS. */
772 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
773 gomp_ordered
: public gimple_statement_omp_single_layout
775 /* No extra fields; adds invariant:
776 stmt->code == GIMPLE_OMP_ORDERED. */
779 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
780 gomp_scan
: public gimple_statement_omp_single_layout
782 /* No extra fields; adds invariant:
783 stmt->code == GIMPLE_OMP_SCAN. */
787 /* GIMPLE_OMP_ATOMIC_LOAD.
788 Note: This is based on gimple, not g_s_omp, because g_s_omp
789 contains a sequence, which we don't need here. */
791 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
792 gomp_atomic_load
: public gimple
794 /* [ WORD 1-6 ] : base class */
800 /* GIMPLE_OMP_ATOMIC_STORE.
801 See note on GIMPLE_OMP_ATOMIC_LOAD. */
803 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
804 gimple_statement_omp_atomic_store_layout
: public gimple
806 /* [ WORD 1-6 ] : base class */
812 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
814 public gimple_statement_omp_atomic_store_layout
816 /* No extra fields; adds invariant:
817 stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
820 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
821 gimple_statement_omp_return
:
822 public gimple_statement_omp_atomic_store_layout
824 /* No extra fields; adds invariant:
825 stmt->code == GIMPLE_OMP_RETURN. */
828 /* GIMPLE_TRANSACTION. */
830 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
832 /* The __transaction_atomic was declared [[outer]] or it is
833 __transaction_relaxed. */
834 #define GTMA_IS_OUTER (1u << 0)
835 #define GTMA_IS_RELAXED (1u << 1)
836 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
838 /* The transaction is seen to not have an abort. */
839 #define GTMA_HAVE_ABORT (1u << 2)
840 /* The transaction is seen to have loads or stores. */
841 #define GTMA_HAVE_LOAD (1u << 3)
842 #define GTMA_HAVE_STORE (1u << 4)
843 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
844 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
845 /* The transaction WILL enter serial irrevocable mode.
846 An irrevocable block post-dominates the entire transaction, such
847 that all invocations of the transaction will go serial-irrevocable.
848 In such case, we don't bother instrumenting the transaction, and
849 tell the runtime that it should begin the transaction in
850 serial-irrevocable mode. */
851 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
852 /* The transaction contains no instrumentation code whatsover, most
853 likely because it is guaranteed to go irrevocable upon entry. */
854 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
856 struct GTY((tag("GSS_TRANSACTION")))
857 gtransaction
: public gimple_statement_with_memory_ops_base
859 /* [ WORD 1-9 ] : base class */
870 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
871 enum gimple_statement_structure_enum
{
872 #include "gsstruct.def"
877 /* A statement with the invariant that
878 stmt->code == GIMPLE_COND
879 i.e. a conditional jump statement. */
881 struct GTY((tag("GSS_WITH_OPS")))
882 gcond
: public gimple_statement_with_ops
884 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
885 static const enum gimple_code code_
= GIMPLE_COND
;
888 /* A statement with the invariant that
889 stmt->code == GIMPLE_DEBUG
890 i.e. a debug statement. */
892 struct GTY((tag("GSS_WITH_OPS")))
893 gdebug
: public gimple_statement_with_ops
895 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
898 /* A statement with the invariant that
899 stmt->code == GIMPLE_GOTO
900 i.e. a goto statement. */
902 struct GTY((tag("GSS_WITH_OPS")))
903 ggoto
: public gimple_statement_with_ops
905 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
908 /* A statement with the invariant that
909 stmt->code == GIMPLE_LABEL
910 i.e. a label statement. */
912 struct GTY((tag("GSS_WITH_OPS")))
913 glabel
: public gimple_statement_with_ops
915 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
918 /* A statement with the invariant that
919 stmt->code == GIMPLE_SWITCH
920 i.e. a switch statement. */
922 struct GTY((tag("GSS_WITH_OPS")))
923 gswitch
: public gimple_statement_with_ops
925 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
928 /* A statement with the invariant that
929 stmt->code == GIMPLE_ASSIGN
930 i.e. an assignment statement. */
932 struct GTY((tag("GSS_WITH_MEM_OPS")))
933 gassign
: public gimple_statement_with_memory_ops
935 static const enum gimple_code code_
= GIMPLE_ASSIGN
;
936 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
939 /* A statement with the invariant that
940 stmt->code == GIMPLE_RETURN
941 i.e. a return statement. */
943 struct GTY((tag("GSS_WITH_MEM_OPS")))
944 greturn
: public gimple_statement_with_memory_ops
946 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
952 is_a_helper
<gasm
*>::test (gimple
*gs
)
954 return gs
->code
== GIMPLE_ASM
;
960 is_a_helper
<gassign
*>::test (gimple
*gs
)
962 return gs
->code
== GIMPLE_ASSIGN
;
968 is_a_helper
<const gassign
*>::test (const gimple
*gs
)
970 return gs
->code
== GIMPLE_ASSIGN
;
976 is_a_helper
<gbind
*>::test (gimple
*gs
)
978 return gs
->code
== GIMPLE_BIND
;
984 is_a_helper
<gcall
*>::test (gimple
*gs
)
986 return gs
->code
== GIMPLE_CALL
;
992 is_a_helper
<gcatch
*>::test (gimple
*gs
)
994 return gs
->code
== GIMPLE_CATCH
;
1000 is_a_helper
<gcond
*>::test (gimple
*gs
)
1002 return gs
->code
== GIMPLE_COND
;
1008 is_a_helper
<const gcond
*>::test (const gimple
*gs
)
1010 return gs
->code
== GIMPLE_COND
;
1016 is_a_helper
<gdebug
*>::test (gimple
*gs
)
1018 return gs
->code
== GIMPLE_DEBUG
;
1024 is_a_helper
<const gdebug
*>::test (const gimple
*gs
)
1026 return gs
->code
== GIMPLE_DEBUG
;
1032 is_a_helper
<ggoto
*>::test (gimple
*gs
)
1034 return gs
->code
== GIMPLE_GOTO
;
1040 is_a_helper
<const ggoto
*>::test (const gimple
*gs
)
1042 return gs
->code
== GIMPLE_GOTO
;
1048 is_a_helper
<glabel
*>::test (gimple
*gs
)
1050 return gs
->code
== GIMPLE_LABEL
;
1056 is_a_helper
<const glabel
*>::test (const gimple
*gs
)
1058 return gs
->code
== GIMPLE_LABEL
;
1064 is_a_helper
<gresx
*>::test (gimple
*gs
)
1066 return gs
->code
== GIMPLE_RESX
;
1072 is_a_helper
<geh_dispatch
*>::test (gimple
*gs
)
1074 return gs
->code
== GIMPLE_EH_DISPATCH
;
1080 is_a_helper
<geh_else
*>::test (gimple
*gs
)
1082 return gs
->code
== GIMPLE_EH_ELSE
;
1088 is_a_helper
<const geh_else
*>::test (const gimple
*gs
)
1090 return gs
->code
== GIMPLE_EH_ELSE
;
1096 is_a_helper
<geh_filter
*>::test (gimple
*gs
)
1098 return gs
->code
== GIMPLE_EH_FILTER
;
1104 is_a_helper
<geh_mnt
*>::test (gimple
*gs
)
1106 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
1112 is_a_helper
<const geh_mnt
*>::test (const gimple
*gs
)
1114 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
1120 is_a_helper
<gomp_atomic_load
*>::test (gimple
*gs
)
1122 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1128 is_a_helper
<gomp_atomic_store
*>::test (gimple
*gs
)
1130 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1136 is_a_helper
<gimple_statement_omp_return
*>::test (gimple
*gs
)
1138 return gs
->code
== GIMPLE_OMP_RETURN
;
1144 is_a_helper
<gomp_continue
*>::test (gimple
*gs
)
1146 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1152 is_a_helper
<gomp_critical
*>::test (gimple
*gs
)
1154 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1160 is_a_helper
<gomp_ordered
*>::test (gimple
*gs
)
1162 return gs
->code
== GIMPLE_OMP_ORDERED
;
1168 is_a_helper
<gomp_scan
*>::test (gimple
*gs
)
1170 return gs
->code
== GIMPLE_OMP_SCAN
;
1176 is_a_helper
<gomp_for
*>::test (gimple
*gs
)
1178 return gs
->code
== GIMPLE_OMP_FOR
;
1184 is_a_helper
<gimple_statement_omp_taskreg
*>::test (gimple
*gs
)
1186 return (gs
->code
== GIMPLE_OMP_PARALLEL
1187 || gs
->code
== GIMPLE_OMP_TASK
1188 || gs
->code
== GIMPLE_OMP_TEAMS
);
1194 is_a_helper
<gomp_parallel
*>::test (gimple
*gs
)
1196 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1202 is_a_helper
<gomp_target
*>::test (gimple
*gs
)
1204 return gs
->code
== GIMPLE_OMP_TARGET
;
1210 is_a_helper
<gomp_sections
*>::test (gimple
*gs
)
1212 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1218 is_a_helper
<gomp_single
*>::test (gimple
*gs
)
1220 return gs
->code
== GIMPLE_OMP_SINGLE
;
1226 is_a_helper
<gomp_teams
*>::test (gimple
*gs
)
1228 return gs
->code
== GIMPLE_OMP_TEAMS
;
1234 is_a_helper
<gomp_task
*>::test (gimple
*gs
)
1236 return gs
->code
== GIMPLE_OMP_TASK
;
1242 is_a_helper
<gphi
*>::test (gimple
*gs
)
1244 return gs
->code
== GIMPLE_PHI
;
1250 is_a_helper
<greturn
*>::test (gimple
*gs
)
1252 return gs
->code
== GIMPLE_RETURN
;
1258 is_a_helper
<gswitch
*>::test (gimple
*gs
)
1260 return gs
->code
== GIMPLE_SWITCH
;
1266 is_a_helper
<const gswitch
*>::test (const gimple
*gs
)
1268 return gs
->code
== GIMPLE_SWITCH
;
1274 is_a_helper
<gtransaction
*>::test (gimple
*gs
)
1276 return gs
->code
== GIMPLE_TRANSACTION
;
1282 is_a_helper
<gtry
*>::test (gimple
*gs
)
1284 return gs
->code
== GIMPLE_TRY
;
1290 is_a_helper
<const gtry
*>::test (const gimple
*gs
)
1292 return gs
->code
== GIMPLE_TRY
;
1298 is_a_helper
<gimple_statement_wce
*>::test (gimple
*gs
)
1300 return gs
->code
== GIMPLE_WITH_CLEANUP_EXPR
;
1306 is_a_helper
<const gasm
*>::test (const gimple
*gs
)
1308 return gs
->code
== GIMPLE_ASM
;
1314 is_a_helper
<const gbind
*>::test (const gimple
*gs
)
1316 return gs
->code
== GIMPLE_BIND
;
1322 is_a_helper
<const gcall
*>::test (const gimple
*gs
)
1324 return gs
->code
== GIMPLE_CALL
;
1330 is_a_helper
<const gcatch
*>::test (const gimple
*gs
)
1332 return gs
->code
== GIMPLE_CATCH
;
1338 is_a_helper
<const gresx
*>::test (const gimple
*gs
)
1340 return gs
->code
== GIMPLE_RESX
;
1346 is_a_helper
<const geh_dispatch
*>::test (const gimple
*gs
)
1348 return gs
->code
== GIMPLE_EH_DISPATCH
;
1354 is_a_helper
<const geh_filter
*>::test (const gimple
*gs
)
1356 return gs
->code
== GIMPLE_EH_FILTER
;
1362 is_a_helper
<const gomp_atomic_load
*>::test (const gimple
*gs
)
1364 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1370 is_a_helper
<const gomp_atomic_store
*>::test (const gimple
*gs
)
1372 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1378 is_a_helper
<const gimple_statement_omp_return
*>::test (const gimple
*gs
)
1380 return gs
->code
== GIMPLE_OMP_RETURN
;
1386 is_a_helper
<const gomp_continue
*>::test (const gimple
*gs
)
1388 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1394 is_a_helper
<const gomp_critical
*>::test (const gimple
*gs
)
1396 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1402 is_a_helper
<const gomp_ordered
*>::test (const gimple
*gs
)
1404 return gs
->code
== GIMPLE_OMP_ORDERED
;
1410 is_a_helper
<const gomp_scan
*>::test (const gimple
*gs
)
1412 return gs
->code
== GIMPLE_OMP_SCAN
;
1418 is_a_helper
<const gomp_for
*>::test (const gimple
*gs
)
1420 return gs
->code
== GIMPLE_OMP_FOR
;
1426 is_a_helper
<const gimple_statement_omp_taskreg
*>::test (const gimple
*gs
)
1428 return (gs
->code
== GIMPLE_OMP_PARALLEL
1429 || gs
->code
== GIMPLE_OMP_TASK
1430 || gs
->code
== GIMPLE_OMP_TEAMS
);
1436 is_a_helper
<const gomp_parallel
*>::test (const gimple
*gs
)
1438 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1444 is_a_helper
<const gomp_target
*>::test (const gimple
*gs
)
1446 return gs
->code
== GIMPLE_OMP_TARGET
;
1452 is_a_helper
<const gomp_sections
*>::test (const gimple
*gs
)
1454 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1460 is_a_helper
<const gomp_single
*>::test (const gimple
*gs
)
1462 return gs
->code
== GIMPLE_OMP_SINGLE
;
1468 is_a_helper
<const gomp_teams
*>::test (const gimple
*gs
)
1470 return gs
->code
== GIMPLE_OMP_TEAMS
;
1476 is_a_helper
<const gomp_task
*>::test (const gimple
*gs
)
1478 return gs
->code
== GIMPLE_OMP_TASK
;
1484 is_a_helper
<const gphi
*>::test (const gimple
*gs
)
1486 return gs
->code
== GIMPLE_PHI
;
1492 is_a_helper
<const greturn
*>::test (const gimple
*gs
)
1494 return gs
->code
== GIMPLE_RETURN
;
1500 is_a_helper
<const gtransaction
*>::test (const gimple
*gs
)
1502 return gs
->code
== GIMPLE_TRANSACTION
;
1505 /* Offset in bytes to the location of the operand vector.
1506 Zero if there is no operand vector for this tuple structure. */
1507 extern size_t const gimple_ops_offset_
[];
1509 /* Map GIMPLE codes to GSS codes. */
1510 extern enum gimple_statement_structure_enum
const gss_for_code_
[];
1512 /* This variable holds the currently expanded gimple statement for purposes
1513 of comminucating the profile info to the builtin expanders. */
1514 extern gimple
*currently_expanding_gimple_stmt
;
1516 size_t gimple_size (enum gimple_code code
, unsigned num_ops
= 0);
1517 void gimple_init (gimple
*g
, enum gimple_code code
, unsigned num_ops
);
1518 gimple
*gimple_alloc (enum gimple_code
, unsigned CXX_MEM_STAT_INFO
);
1519 greturn
*gimple_build_return (tree
);
1520 void gimple_call_reset_alias_info (gcall
*);
1521 gcall
*gimple_build_call_vec (tree
, const vec
<tree
> &);
1522 gcall
*gimple_build_call (tree
, unsigned, ...);
1523 gcall
*gimple_build_call_valist (tree
, unsigned, va_list);
1524 gcall
*gimple_build_call_internal (enum internal_fn
, unsigned, ...);
1525 gcall
*gimple_build_call_internal_vec (enum internal_fn
, const vec
<tree
> &);
1526 gcall
*gimple_build_call_from_tree (tree
, tree
);
1527 gassign
*gimple_build_assign (tree
, tree CXX_MEM_STAT_INFO
);
1528 gassign
*gimple_build_assign (tree
, enum tree_code
,
1529 tree
, tree
, tree CXX_MEM_STAT_INFO
);
1530 gassign
*gimple_build_assign (tree
, enum tree_code
,
1531 tree
, tree CXX_MEM_STAT_INFO
);
1532 gassign
*gimple_build_assign (tree
, enum tree_code
, tree CXX_MEM_STAT_INFO
);
1533 gcond
*gimple_build_cond (enum tree_code
, tree
, tree
, tree
, tree
);
1534 gcond
*gimple_build_cond_from_tree (tree
, tree
, tree
);
1535 void gimple_cond_set_condition_from_tree (gcond
*, tree
);
1536 glabel
*gimple_build_label (tree label
);
1537 ggoto
*gimple_build_goto (tree dest
);
1538 gimple
*gimple_build_nop (void);
1539 gbind
*gimple_build_bind (tree
, gimple_seq
, tree
);
1540 gasm
*gimple_build_asm_vec (const char *, vec
<tree
, va_gc
> *,
1541 vec
<tree
, va_gc
> *, vec
<tree
, va_gc
> *,
1542 vec
<tree
, va_gc
> *);
1543 gcatch
*gimple_build_catch (tree
, gimple_seq
);
1544 geh_filter
*gimple_build_eh_filter (tree
, gimple_seq
);
1545 geh_mnt
*gimple_build_eh_must_not_throw (tree
);
1546 geh_else
*gimple_build_eh_else (gimple_seq
, gimple_seq
);
1547 gtry
*gimple_build_try (gimple_seq
, gimple_seq
,
1548 enum gimple_try_flags
);
1549 gimple
*gimple_build_wce (gimple_seq
);
1550 gresx
*gimple_build_resx (int);
1551 gswitch
*gimple_build_switch_nlabels (unsigned, tree
, tree
);
1552 gswitch
*gimple_build_switch (tree
, tree
, const vec
<tree
> &);
1553 geh_dispatch
*gimple_build_eh_dispatch (int);
1554 gdebug
*gimple_build_debug_bind (tree
, tree
, gimple
* CXX_MEM_STAT_INFO
);
1555 gdebug
*gimple_build_debug_source_bind (tree
, tree
, gimple
* CXX_MEM_STAT_INFO
);
1556 gdebug
*gimple_build_debug_begin_stmt (tree
, location_t CXX_MEM_STAT_INFO
);
1557 gdebug
*gimple_build_debug_inline_entry (tree
, location_t CXX_MEM_STAT_INFO
);
1558 gomp_critical
*gimple_build_omp_critical (gimple_seq
, tree
, tree
);
1559 gomp_for
*gimple_build_omp_for (gimple_seq
, int, tree
, size_t, gimple_seq
);
1560 gomp_parallel
*gimple_build_omp_parallel (gimple_seq
, tree
, tree
, tree
);
1561 gomp_task
*gimple_build_omp_task (gimple_seq
, tree
, tree
, tree
, tree
,
1563 gimple
*gimple_build_omp_section (gimple_seq
);
1564 gimple
*gimple_build_omp_scope (gimple_seq
, tree
);
1565 gimple
*gimple_build_omp_master (gimple_seq
);
1566 gimple
*gimple_build_omp_masked (gimple_seq
, tree
);
1567 gimple
*gimple_build_omp_taskgroup (gimple_seq
, tree
);
1568 gomp_continue
*gimple_build_omp_continue (tree
, tree
);
1569 gomp_ordered
*gimple_build_omp_ordered (gimple_seq
, tree
);
1570 gimple
*gimple_build_omp_return (bool);
1571 gomp_scan
*gimple_build_omp_scan (gimple_seq
, tree
);
1572 gomp_sections
*gimple_build_omp_sections (gimple_seq
, tree
);
1573 gimple
*gimple_build_omp_sections_switch (void);
1574 gomp_single
*gimple_build_omp_single (gimple_seq
, tree
);
1575 gomp_target
*gimple_build_omp_target (gimple_seq
, int, tree
);
1576 gomp_teams
*gimple_build_omp_teams (gimple_seq
, tree
);
1577 gomp_atomic_load
*gimple_build_omp_atomic_load (tree
, tree
,
1578 enum omp_memory_order
);
1579 gomp_atomic_store
*gimple_build_omp_atomic_store (tree
, enum omp_memory_order
);
1580 gtransaction
*gimple_build_transaction (gimple_seq
);
1581 extern void gimple_seq_add_stmt (gimple_seq
*, gimple
*);
1582 extern void gimple_seq_add_stmt_without_update (gimple_seq
*, gimple
*);
1583 void gimple_seq_add_seq (gimple_seq
*, gimple_seq
);
1584 void gimple_seq_add_seq_without_update (gimple_seq
*, gimple_seq
);
1585 extern void annotate_all_with_location_after (gimple_seq
, gimple_stmt_iterator
,
1587 extern void annotate_all_with_location (gimple_seq
, location_t
);
1588 bool empty_body_p (gimple_seq
);
1589 gimple_seq
gimple_seq_copy (gimple_seq
);
1590 bool gimple_call_same_target_p (const gimple
*, const gimple
*);
1591 int gimple_call_flags (const gimple
*);
1592 int gimple_call_arg_flags (const gcall
*, unsigned);
1593 int gimple_call_retslot_flags (const gcall
*);
1594 int gimple_call_static_chain_flags (const gcall
*);
1595 int gimple_call_return_flags (const gcall
*);
1596 bool gimple_call_nonnull_result_p (gcall
*);
1597 tree
gimple_call_nonnull_arg (gcall
*);
1598 bool gimple_assign_copy_p (gimple
*);
1599 bool gimple_assign_ssa_name_copy_p (gimple
*);
1600 bool gimple_assign_unary_nop_p (gimple
*);
1601 void gimple_set_bb (gimple
*, basic_block
);
1602 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator
*, tree
);
1603 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*, enum tree_code
,
1605 tree
gimple_get_lhs (const gimple
*);
1606 void gimple_set_lhs (gimple
*, tree
);
1607 gimple
*gimple_copy (gimple
*);
1608 void gimple_move_vops (gimple
*, gimple
*);
1609 bool gimple_has_side_effects (const gimple
*);
1610 bool gimple_could_trap_p_1 (const gimple
*, bool, bool);
1611 bool gimple_could_trap_p (const gimple
*);
1612 bool gimple_assign_rhs_could_trap_p (gimple
*);
1613 extern void dump_gimple_statistics (void);
1614 unsigned get_gimple_rhs_num_ops (enum tree_code
);
1615 gcall
*gimple_call_copy_skip_args (gcall
*, bitmap
);
1616 extern bool gimple_compare_field_offset (tree
, tree
);
1617 extern tree
gimple_unsigned_type (tree
);
1618 extern tree
gimple_signed_type (tree
);
1619 extern alias_set_type
gimple_get_alias_set (tree
);
1620 extern bool gimple_ior_addresses_taken (bitmap
, gimple
*);
1621 extern bool gimple_builtin_call_types_compatible_p (const gimple
*, tree
);
1622 extern combined_fn
gimple_call_combined_fn (const gimple
*);
1623 extern bool gimple_call_operator_delete_p (const gcall
*);
1624 extern bool gimple_call_builtin_p (const gimple
*);
1625 extern bool gimple_call_builtin_p (const gimple
*, enum built_in_class
);
1626 extern bool gimple_call_builtin_p (const gimple
*, enum built_in_function
);
1627 extern bool gimple_asm_clobbers_memory_p (const gasm
*);
1628 extern void dump_decl_set (FILE *, bitmap
);
1629 extern bool nonfreeing_call_p (gimple
*);
1630 extern bool nonbarrier_call_p (gimple
*);
1631 extern bool infer_nonnull_range (gimple
*, tree
);
1632 extern bool infer_nonnull_range_by_dereference (gimple
*, tree
);
1633 extern bool infer_nonnull_range_by_attribute (gimple
*, tree
);
1634 extern void sort_case_labels (vec
<tree
> &);
1635 extern void preprocess_case_label_vec_for_gimple (vec
<tree
> &, tree
, tree
*);
1636 extern void gimple_seq_set_location (gimple_seq
, location_t
);
1637 extern void gimple_seq_discard (gimple_seq
);
1638 extern void maybe_remove_unused_call_args (struct function
*, gimple
*);
1639 extern bool gimple_inexpensive_call_p (gcall
*);
1640 extern bool stmt_can_terminate_bb_p (gimple
*);
1641 extern location_t
gimple_or_expr_nonartificial_location (gimple
*, tree
);
1642 gcall
*gimple_build_builtin_unreachable (location_t
);
1644 /* Return the disposition for a warning (or all warnings by default)
1646 extern bool warning_suppressed_p (const gimple
*, opt_code
= all_warnings
)
1647 ATTRIBUTE_NONNULL (1);
1648 /* Set the disposition for a warning (or all warnings by default)
1649 at a location to enabled by default. */
1650 extern void suppress_warning (gimple
*, opt_code
= all_warnings
,
1651 bool = true) ATTRIBUTE_NONNULL (1);
1653 /* Copy the warning disposition mapping from one statement to another. */
1654 extern void copy_warning (gimple
*, const gimple
*)
1655 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1656 /* Copy the warning disposition mapping from an expression to a statement. */
1657 extern void copy_warning (gimple
*, const_tree
)
1658 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1659 /* Copy the warning disposition mapping from a statement to an expression. */
1660 extern void copy_warning (tree
, const gimple
*)
1661 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1663 /* Formal (expression) temporary table handling: multiple occurrences of
1664 the same scalar expression are evaluated into the same temporary. */
1666 typedef struct gimple_temp_hash_elt
1669 tree temp
; /* Value */
1672 /* Get the number of the next statement uid to be allocated. */
1673 static inline unsigned int
1674 gimple_stmt_max_uid (struct function
*fn
)
1676 return fn
->last_stmt_uid
;
1679 /* Set the number of the next statement uid to be allocated. */
1681 set_gimple_stmt_max_uid (struct function
*fn
, unsigned int maxid
)
1683 fn
->last_stmt_uid
= maxid
;
1686 /* Set the number of the next statement uid to be allocated. */
1687 static inline unsigned int
1688 inc_gimple_stmt_max_uid (struct function
*fn
)
1690 return fn
->last_stmt_uid
++;
1693 /* Return the first node in GIMPLE sequence S. */
1695 static inline gimple_seq_node
1696 gimple_seq_first (gimple_seq s
)
1702 /* Return the first statement in GIMPLE sequence S. */
1704 static inline gimple
*
1705 gimple_seq_first_stmt (gimple_seq s
)
1707 gimple_seq_node n
= gimple_seq_first (s
);
1711 /* Return the first statement in GIMPLE sequence S as a gbind *,
1712 verifying that it has code GIMPLE_BIND in a checked build. */
1714 static inline gbind
*
1715 gimple_seq_first_stmt_as_a_bind (gimple_seq s
)
1717 gimple_seq_node n
= gimple_seq_first (s
);
1718 return as_a
<gbind
*> (n
);
1722 /* Return the last node in GIMPLE sequence S. */
1724 static inline gimple_seq_node
1725 gimple_seq_last (gimple_seq s
)
1727 return s
? s
->prev
: NULL
;
1731 /* Return the last statement in GIMPLE sequence S. */
1733 static inline gimple
*
1734 gimple_seq_last_stmt (gimple_seq s
)
1736 gimple_seq_node n
= gimple_seq_last (s
);
1741 /* Set the last node in GIMPLE sequence *PS to LAST. */
1744 gimple_seq_set_last (gimple_seq
*ps
, gimple_seq_node last
)
1750 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1753 gimple_seq_set_first (gimple_seq
*ps
, gimple_seq_node first
)
1759 /* Return true if GIMPLE sequence S is empty. */
1762 gimple_seq_empty_p (gimple_seq s
)
1767 /* Allocate a new sequence and initialize its first element with STMT. */
1769 static inline gimple_seq
1770 gimple_seq_alloc_with_stmt (gimple
*stmt
)
1772 gimple_seq seq
= NULL
;
1773 gimple_seq_add_stmt (&seq
, stmt
);
1778 /* Returns the sequence of statements in BB. */
1780 static inline gimple_seq
1781 bb_seq (const_basic_block bb
)
1783 return (!(bb
->flags
& BB_RTL
)) ? bb
->il
.gimple
.seq
: NULL
;
1786 static inline gimple_seq
*
1787 bb_seq_addr (basic_block bb
)
1789 return (!(bb
->flags
& BB_RTL
)) ? &bb
->il
.gimple
.seq
: NULL
;
1792 /* Sets the sequence of statements in BB to SEQ. */
1795 set_bb_seq (basic_block bb
, gimple_seq seq
)
1797 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
1798 bb
->il
.gimple
.seq
= seq
;
1802 /* Return the code for GIMPLE statement G. */
1804 static inline enum gimple_code
1805 gimple_code (const gimple
*g
)
1811 /* Return the GSS code used by a GIMPLE code. */
1813 static inline enum gimple_statement_structure_enum
1814 gss_for_code (enum gimple_code code
)
1816 gcc_gimple_checking_assert ((unsigned int)code
< LAST_AND_UNUSED_GIMPLE_CODE
);
1817 return gss_for_code_
[code
];
1821 /* Return which GSS code is used by GS. */
1823 static inline enum gimple_statement_structure_enum
1824 gimple_statement_structure (gimple
*gs
)
1826 return gss_for_code (gimple_code (gs
));
1830 /* Return true if statement G has sub-statements. This is only true for
1831 High GIMPLE statements. */
1834 gimple_has_substatements (gimple
*g
)
1836 switch (gimple_code (g
))
1840 case GIMPLE_EH_FILTER
:
1841 case GIMPLE_EH_ELSE
:
1843 case GIMPLE_OMP_FOR
:
1844 case GIMPLE_OMP_MASTER
:
1845 case GIMPLE_OMP_MASKED
:
1846 case GIMPLE_OMP_TASKGROUP
:
1847 case GIMPLE_OMP_ORDERED
:
1848 case GIMPLE_OMP_SECTION
:
1849 case GIMPLE_OMP_PARALLEL
:
1850 case GIMPLE_OMP_TASK
:
1851 case GIMPLE_OMP_SCOPE
:
1852 case GIMPLE_OMP_SECTIONS
:
1853 case GIMPLE_OMP_SINGLE
:
1854 case GIMPLE_OMP_TARGET
:
1855 case GIMPLE_OMP_TEAMS
:
1856 case GIMPLE_OMP_CRITICAL
:
1857 case GIMPLE_WITH_CLEANUP_EXPR
:
1858 case GIMPLE_TRANSACTION
:
1867 /* Return the basic block holding statement G. */
1869 static inline basic_block
1870 gimple_bb (const gimple
*g
)
1876 /* Return the lexical scope block holding statement G. */
1879 gimple_block (const gimple
*g
)
1881 return LOCATION_BLOCK (g
->location
);
1884 /* Forward declare. */
1885 static inline void gimple_set_location (gimple
*, location_t
);
1887 /* Set BLOCK to be the lexical scope block holding statement G. */
1890 gimple_set_block (gimple
*g
, tree block
)
1892 gimple_set_location (g
, set_block (g
->location
, block
));
1895 /* Return location information for statement G. */
1897 static inline location_t
1898 gimple_location (const gimple
*g
)
1903 /* Return location information for statement G if g is not NULL.
1904 Otherwise, UNKNOWN_LOCATION is returned. */
1906 static inline location_t
1907 gimple_location_safe (const gimple
*g
)
1909 return g
? gimple_location (g
) : UNKNOWN_LOCATION
;
1912 /* Set location information for statement G. */
1915 gimple_set_location (gimple
*g
, location_t location
)
1917 /* Copy the no-warning data to the statement location. */
1918 if (g
->location
!= UNKNOWN_LOCATION
)
1919 copy_warning (location
, g
->location
);
1920 g
->location
= location
;
1923 /* Return address of the location information for statement G. */
1925 static inline location_t
*
1926 gimple_location_ptr (gimple
*g
)
1928 return &g
->location
;
1932 /* Return true if G contains location information. */
1935 gimple_has_location (const gimple
*g
)
1937 return LOCATION_LOCUS (gimple_location (g
)) != UNKNOWN_LOCATION
;
1941 /* Return non-artificial location information for statement G. */
1943 static inline location_t
1944 gimple_nonartificial_location (const gimple
*g
)
1946 location_t
*ploc
= NULL
;
1948 if (tree block
= gimple_block (g
))
1949 ploc
= block_nonartificial_location (block
);
1951 return ploc
? *ploc
: gimple_location (g
);
1955 /* Return the file name of the location of STMT. */
1957 static inline const char *
1958 gimple_filename (const gimple
*stmt
)
1960 return LOCATION_FILE (gimple_location (stmt
));
1964 /* Return the line number of the location of STMT. */
1967 gimple_lineno (const gimple
*stmt
)
1969 return LOCATION_LINE (gimple_location (stmt
));
1973 /* Determine whether SEQ is a singleton. */
1976 gimple_seq_singleton_p (gimple_seq seq
)
1978 return ((gimple_seq_first (seq
) != NULL
)
1979 && (gimple_seq_first (seq
) == gimple_seq_last (seq
)));
1982 /* Return true if no warnings should be emitted for statement STMT. */
1985 gimple_no_warning_p (const gimple
*stmt
)
1987 return stmt
->no_warning
;
1990 /* Set the no_warning flag of STMT to NO_WARNING. */
1993 gimple_set_no_warning (gimple
*stmt
, bool no_warning
)
1995 stmt
->no_warning
= (unsigned) no_warning
;
1998 /* Set the visited status on statement STMT to VISITED_P.
2000 Please note that this 'visited' property of the gimple statement is
2001 supposed to be undefined at pass boundaries. This means that a
2002 given pass should not assume it contains any useful value when the
2003 pass starts and thus can set it to any value it sees fit.
2005 You can learn more about the visited property of the gimple
2006 statement by reading the comments of the 'visited' data member of
2011 gimple_set_visited (gimple
*stmt
, bool visited_p
)
2013 stmt
->visited
= (unsigned) visited_p
;
2017 /* Return the visited status for statement STMT.
2019 Please note that this 'visited' property of the gimple statement is
2020 supposed to be undefined at pass boundaries. This means that a
2021 given pass should not assume it contains any useful value when the
2022 pass starts and thus can set it to any value it sees fit.
2024 You can learn more about the visited property of the gimple
2025 statement by reading the comments of the 'visited' data member of
2029 gimple_visited_p (gimple
*stmt
)
2031 return stmt
->visited
;
2035 /* Set pass local flag PLF on statement STMT to VAL_P.
2037 Please note that this PLF property of the gimple statement is
2038 supposed to be undefined at pass boundaries. This means that a
2039 given pass should not assume it contains any useful value when the
2040 pass starts and thus can set it to any value it sees fit.
2042 You can learn more about the PLF property by reading the comment of
2043 the 'plf' data member of struct gimple_statement_structure. */
2046 gimple_set_plf (gimple
*stmt
, enum plf_mask plf
, bool val_p
)
2049 stmt
->plf
|= (unsigned int) plf
;
2051 stmt
->plf
&= ~((unsigned int) plf
);
2055 /* Return the value of pass local flag PLF on statement STMT.
2057 Please note that this 'plf' property of the gimple statement is
2058 supposed to be undefined at pass boundaries. This means that a
2059 given pass should not assume it contains any useful value when the
2060 pass starts and thus can set it to any value it sees fit.
2062 You can learn more about the plf property by reading the comment of
2063 the 'plf' data member of struct gimple_statement_structure. */
2065 static inline unsigned int
2066 gimple_plf (gimple
*stmt
, enum plf_mask plf
)
2068 return stmt
->plf
& ((unsigned int) plf
);
2072 /* Set the UID of statement.
2074 Please note that this UID property is supposed to be undefined at
2075 pass boundaries. This means that a given pass should not assume it
2076 contains any useful value when the pass starts and thus can set it
2077 to any value it sees fit. */
2080 gimple_set_uid (gimple
*g
, unsigned uid
)
2086 /* Return the UID of statement.
2088 Please note that this UID property is supposed to be undefined at
2089 pass boundaries. This means that a given pass should not assume it
2090 contains any useful value when the pass starts and thus can set it
2091 to any value it sees fit. */
2093 static inline unsigned
2094 gimple_uid (const gimple
*g
)
2100 /* Make statement G a singleton sequence. */
2103 gimple_init_singleton (gimple
*g
)
2110 /* Return true if GIMPLE statement G has register or memory operands. */
2113 gimple_has_ops (const gimple
*g
)
2115 return gimple_code (g
) >= GIMPLE_COND
&& gimple_code (g
) <= GIMPLE_RETURN
;
2121 is_a_helper
<const gimple_statement_with_ops
*>::test (const gimple
*gs
)
2123 return gimple_has_ops (gs
);
2129 is_a_helper
<gimple_statement_with_ops
*>::test (gimple
*gs
)
2131 return gimple_has_ops (gs
);
2134 /* Return true if GIMPLE statement G has memory operands. */
2137 gimple_has_mem_ops (const gimple
*g
)
2139 return gimple_code (g
) >= GIMPLE_ASSIGN
&& gimple_code (g
) <= GIMPLE_RETURN
;
2145 is_a_helper
<const gimple_statement_with_memory_ops
*>::test (const gimple
*gs
)
2147 return gimple_has_mem_ops (gs
);
2153 is_a_helper
<gimple_statement_with_memory_ops
*>::test (gimple
*gs
)
2155 return gimple_has_mem_ops (gs
);
2158 /* Return the set of USE operands for statement G. */
2160 static inline struct use_optype_d
*
2161 gimple_use_ops (const gimple
*g
)
2163 const gimple_statement_with_ops
*ops_stmt
=
2164 dyn_cast
<const gimple_statement_with_ops
*> (g
);
2167 return ops_stmt
->use_ops
;
2171 /* Set USE to be the set of USE operands for statement G. */
2174 gimple_set_use_ops (gimple
*g
, struct use_optype_d
*use
)
2176 gimple_statement_with_ops
*ops_stmt
=
2177 as_a
<gimple_statement_with_ops
*> (g
);
2178 ops_stmt
->use_ops
= use
;
2182 /* Return the single VUSE operand of the statement G. */
2185 gimple_vuse (const gimple
*g
)
2187 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
2188 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
2191 return mem_ops_stmt
->vuse
;
2194 /* Return the single VDEF operand of the statement G. */
2197 gimple_vdef (const gimple
*g
)
2199 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
2200 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
2203 return mem_ops_stmt
->vdef
;
2206 /* Return the single VUSE operand of the statement G. */
2208 static inline tree
*
2209 gimple_vuse_ptr (gimple
*g
)
2211 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2212 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
2215 return &mem_ops_stmt
->vuse
;
2218 /* Return the single VDEF operand of the statement G. */
2220 static inline tree
*
2221 gimple_vdef_ptr (gimple
*g
)
2223 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2224 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
2227 return &mem_ops_stmt
->vdef
;
2230 /* Set the single VUSE operand of the statement G. */
2233 gimple_set_vuse (gimple
*g
, tree vuse
)
2235 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2236 as_a
<gimple_statement_with_memory_ops
*> (g
);
2237 mem_ops_stmt
->vuse
= vuse
;
2240 /* Set the single VDEF operand of the statement G. */
2243 gimple_set_vdef (gimple
*g
, tree vdef
)
2245 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2246 as_a
<gimple_statement_with_memory_ops
*> (g
);
2247 mem_ops_stmt
->vdef
= vdef
;
2251 /* Return true if statement G has operands and the modified field has
2255 gimple_modified_p (const gimple
*g
)
2257 return (gimple_has_ops (g
)) ? (bool) g
->modified
: false;
2261 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
2262 a MODIFIED field. */
2265 gimple_set_modified (gimple
*s
, bool modifiedp
)
2267 if (gimple_has_ops (s
))
2268 s
->modified
= (unsigned) modifiedp
;
2272 /* Return true if statement STMT contains volatile operands. */
2275 gimple_has_volatile_ops (const gimple
*stmt
)
2277 if (gimple_has_mem_ops (stmt
))
2278 return stmt
->has_volatile_ops
;
2284 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
2287 gimple_set_has_volatile_ops (gimple
*stmt
, bool volatilep
)
2289 if (gimple_has_mem_ops (stmt
))
2290 stmt
->has_volatile_ops
= (unsigned) volatilep
;
2293 /* Return true if STMT is in a transaction. */
2296 gimple_in_transaction (const gimple
*stmt
)
2298 return bb_in_transaction (gimple_bb (stmt
));
2301 /* Return true if statement STMT may access memory. */
2304 gimple_references_memory_p (gimple
*stmt
)
2306 return gimple_has_mem_ops (stmt
) && gimple_vuse (stmt
);
2310 /* Return the subcode for OMP statement S. */
2312 static inline unsigned
2313 gimple_omp_subcode (const gimple
*s
)
2315 gcc_gimple_checking_assert (gimple_code (s
) >= GIMPLE_OMP_ATOMIC_LOAD
2316 && gimple_code (s
) <= GIMPLE_OMP_ORDERED
);
2320 /* Set the subcode for OMP statement S to SUBCODE. */
2323 gimple_omp_set_subcode (gimple
*s
, unsigned int subcode
)
2325 /* We only have 16 bits for the subcode. Assert that we are not
2327 gcc_gimple_checking_assert (subcode
< (1 << 16));
2328 s
->subcode
= subcode
;
2331 /* Set the nowait flag on OMP_RETURN statement S. */
2334 gimple_omp_return_set_nowait (gimple
*s
)
2336 GIMPLE_CHECK (s
, GIMPLE_OMP_RETURN
);
2337 s
->subcode
|= GF_OMP_RETURN_NOWAIT
;
2341 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
2345 gimple_omp_return_nowait_p (const gimple
*g
)
2347 GIMPLE_CHECK (g
, GIMPLE_OMP_RETURN
);
2348 return (gimple_omp_subcode (g
) & GF_OMP_RETURN_NOWAIT
) != 0;
2352 /* Set the LHS of OMP return. */
2355 gimple_omp_return_set_lhs (gimple
*g
, tree lhs
)
2357 gimple_statement_omp_return
*omp_return_stmt
=
2358 as_a
<gimple_statement_omp_return
*> (g
);
2359 omp_return_stmt
->val
= lhs
;
2363 /* Get the LHS of OMP return. */
2366 gimple_omp_return_lhs (const gimple
*g
)
2368 const gimple_statement_omp_return
*omp_return_stmt
=
2369 as_a
<const gimple_statement_omp_return
*> (g
);
2370 return omp_return_stmt
->val
;
2374 /* Return a pointer to the LHS of OMP return. */
2376 static inline tree
*
2377 gimple_omp_return_lhs_ptr (gimple
*g
)
2379 gimple_statement_omp_return
*omp_return_stmt
=
2380 as_a
<gimple_statement_omp_return
*> (g
);
2381 return &omp_return_stmt
->val
;
2385 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
2389 gimple_omp_section_last_p (const gimple
*g
)
2391 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2392 return (gimple_omp_subcode (g
) & GF_OMP_SECTION_LAST
) != 0;
2396 /* Set the GF_OMP_SECTION_LAST flag on G. */
2399 gimple_omp_section_set_last (gimple
*g
)
2401 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2402 g
->subcode
|= GF_OMP_SECTION_LAST
;
2406 /* Return true if OMP ordered construct is stand-alone
2407 (G has the GF_OMP_ORDERED_STANDALONE flag set). */
2410 gimple_omp_ordered_standalone_p (const gimple
*g
)
2412 GIMPLE_CHECK (g
, GIMPLE_OMP_ORDERED
);
2413 return (gimple_omp_subcode (g
) & GF_OMP_ORDERED_STANDALONE
) != 0;
2417 /* Set the GF_OMP_ORDERED_STANDALONE flag on G. */
2420 gimple_omp_ordered_standalone (gimple
*g
)
2422 GIMPLE_CHECK (g
, GIMPLE_OMP_ORDERED
);
2423 g
->subcode
|= GF_OMP_ORDERED_STANDALONE
;
2427 /* Return true if OMP parallel statement G has the
2428 GF_OMP_PARALLEL_COMBINED flag set. */
2431 gimple_omp_parallel_combined_p (const gimple
*g
)
2433 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2434 return (gimple_omp_subcode (g
) & GF_OMP_PARALLEL_COMBINED
) != 0;
2438 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2439 value of COMBINED_P. */
2442 gimple_omp_parallel_set_combined_p (gimple
*g
, bool combined_p
)
2444 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2446 g
->subcode
|= GF_OMP_PARALLEL_COMBINED
;
2448 g
->subcode
&= ~GF_OMP_PARALLEL_COMBINED
;
2452 /* Return true if OMP atomic load/store statement G has the
2453 GF_OMP_ATOMIC_NEED_VALUE flag set. */
2456 gimple_omp_atomic_need_value_p (const gimple
*g
)
2458 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2459 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2460 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_NEED_VALUE
) != 0;
2464 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2467 gimple_omp_atomic_set_need_value (gimple
*g
)
2469 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2470 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2471 g
->subcode
|= GF_OMP_ATOMIC_NEED_VALUE
;
2475 /* Return true if OMP atomic load/store statement G has the
2476 GF_OMP_ATOMIC_WEAK flag set. */
2479 gimple_omp_atomic_weak_p (const gimple
*g
)
2481 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2482 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2483 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_WEAK
) != 0;
2487 /* Set the GF_OMP_ATOMIC_WEAK flag on G. */
2490 gimple_omp_atomic_set_weak (gimple
*g
)
2492 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2493 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2494 g
->subcode
|= GF_OMP_ATOMIC_WEAK
;
2498 /* Return the memory order of the OMP atomic load/store statement G. */
2500 static inline enum omp_memory_order
2501 gimple_omp_atomic_memory_order (const gimple
*g
)
2503 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2504 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2505 return (enum omp_memory_order
)
2506 (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_MEMORY_ORDER
);
2510 /* Set the memory order on G. */
2513 gimple_omp_atomic_set_memory_order (gimple
*g
, enum omp_memory_order mo
)
2515 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2516 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2517 g
->subcode
= ((g
->subcode
& ~GF_OMP_ATOMIC_MEMORY_ORDER
)
2518 | (mo
& GF_OMP_ATOMIC_MEMORY_ORDER
));
2522 /* Return the number of operands for statement GS. */
2524 static inline unsigned
2525 gimple_num_ops (const gimple
*gs
)
2531 /* Set the number of operands for statement GS. */
2534 gimple_set_num_ops (gimple
*gs
, unsigned num_ops
)
2536 gs
->num_ops
= num_ops
;
2540 /* Return the array of operands for statement GS. */
2542 static inline tree
*
2543 gimple_ops (gimple
*gs
)
2547 /* All the tuples have their operand vector at the very bottom
2548 of the structure. Note that those structures that do not
2549 have an operand vector have a zero offset. */
2550 off
= gimple_ops_offset_
[gimple_statement_structure (gs
)];
2551 gcc_gimple_checking_assert (off
!= 0);
2553 return (tree
*) ((char *) gs
+ off
);
2557 /* Return operand I for statement GS. */
2560 gimple_op (const gimple
*gs
, unsigned i
)
2562 if (gimple_has_ops (gs
))
2564 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2565 return gimple_ops (CONST_CAST_GIMPLE (gs
))[i
];
2571 /* Return a pointer to operand I for statement GS. */
2573 static inline tree
*
2574 gimple_op_ptr (gimple
*gs
, unsigned i
)
2576 if (gimple_has_ops (gs
))
2578 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2579 return gimple_ops (gs
) + i
;
2585 /* Set operand I of statement GS to OP. */
2588 gimple_set_op (gimple
*gs
, unsigned i
, tree op
)
2590 gcc_gimple_checking_assert (gimple_has_ops (gs
) && i
< gimple_num_ops (gs
));
2592 /* Note. It may be tempting to assert that OP matches
2593 is_gimple_operand, but that would be wrong. Different tuples
2594 accept slightly different sets of tree operands. Each caller
2595 should perform its own validation. */
2596 gimple_ops (gs
)[i
] = op
;
2599 /* Return true if GS is a GIMPLE_ASSIGN. */
2602 is_gimple_assign (const gimple
*gs
)
2604 return gimple_code (gs
) == GIMPLE_ASSIGN
;
2607 /* Determine if expression CODE is one of the valid expressions that can
2608 be used on the RHS of GIMPLE assignments. */
2610 static inline enum gimple_rhs_class
2611 get_gimple_rhs_class (enum tree_code code
)
2613 return (enum gimple_rhs_class
) gimple_rhs_class_table
[(int) code
];
2616 /* Return the LHS of assignment statement GS. */
2619 gimple_assign_lhs (const gassign
*gs
)
2625 gimple_assign_lhs (const gimple
*gs
)
2627 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2628 return gimple_assign_lhs (ass
);
2632 /* Return a pointer to the LHS of assignment statement GS. */
2634 static inline tree
*
2635 gimple_assign_lhs_ptr (gassign
*gs
)
2640 static inline tree
*
2641 gimple_assign_lhs_ptr (gimple
*gs
)
2643 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2644 return gimple_assign_lhs_ptr (ass
);
2648 /* Set LHS to be the LHS operand of assignment statement GS. */
2651 gimple_assign_set_lhs (gassign
*gs
, tree lhs
)
2655 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2656 SSA_NAME_DEF_STMT (lhs
) = gs
;
2660 gimple_assign_set_lhs (gimple
*gs
, tree lhs
)
2662 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2663 gimple_assign_set_lhs (ass
, lhs
);
2667 /* Return the first operand on the RHS of assignment statement GS. */
2670 gimple_assign_rhs1 (const gassign
*gs
)
2676 gimple_assign_rhs1 (const gimple
*gs
)
2678 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2679 return gimple_assign_rhs1 (ass
);
2683 /* Return a pointer to the first operand on the RHS of assignment
2686 static inline tree
*
2687 gimple_assign_rhs1_ptr (gassign
*gs
)
2692 static inline tree
*
2693 gimple_assign_rhs1_ptr (gimple
*gs
)
2695 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2696 return gimple_assign_rhs1_ptr (ass
);
2699 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2702 gimple_assign_set_rhs1 (gassign
*gs
, tree rhs
)
2708 gimple_assign_set_rhs1 (gimple
*gs
, tree rhs
)
2710 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2711 gimple_assign_set_rhs1 (ass
, rhs
);
2715 /* Return the second operand on the RHS of assignment statement GS.
2716 If GS does not have two operands, NULL is returned instead. */
2719 gimple_assign_rhs2 (const gassign
*gs
)
2721 if (gimple_num_ops (gs
) >= 3)
2728 gimple_assign_rhs2 (const gimple
*gs
)
2730 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2731 return gimple_assign_rhs2 (ass
);
2735 /* Return a pointer to the second operand on the RHS of assignment
2738 static inline tree
*
2739 gimple_assign_rhs2_ptr (gassign
*gs
)
2741 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 3);
2745 static inline tree
*
2746 gimple_assign_rhs2_ptr (gimple
*gs
)
2748 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2749 return gimple_assign_rhs2_ptr (ass
);
2753 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2756 gimple_assign_set_rhs2 (gassign
*gs
, tree rhs
)
2758 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 3);
2763 gimple_assign_set_rhs2 (gimple
*gs
, tree rhs
)
2765 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2766 return gimple_assign_set_rhs2 (ass
, rhs
);
2769 /* Return the third operand on the RHS of assignment statement GS.
2770 If GS does not have two operands, NULL is returned instead. */
2773 gimple_assign_rhs3 (const gassign
*gs
)
2775 if (gimple_num_ops (gs
) >= 4)
2782 gimple_assign_rhs3 (const gimple
*gs
)
2784 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2785 return gimple_assign_rhs3 (ass
);
2788 /* Return a pointer to the third operand on the RHS of assignment
2791 static inline tree
*
2792 gimple_assign_rhs3_ptr (gimple
*gs
)
2794 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2795 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 4);
2800 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2803 gimple_assign_set_rhs3 (gassign
*gs
, tree rhs
)
2805 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 4);
2810 gimple_assign_set_rhs3 (gimple
*gs
, tree rhs
)
2812 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2813 gimple_assign_set_rhs3 (ass
, rhs
);
2817 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2818 which expect to see only two operands. */
2821 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2824 gimple_assign_set_rhs_with_ops (gsi
, code
, op1
, op2
, NULL
);
2827 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2828 which expect to see only one operands. */
2831 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2834 gimple_assign_set_rhs_with_ops (gsi
, code
, op1
, NULL
, NULL
);
2837 /* Returns true if GS is a nontemporal move. */
2840 gimple_assign_nontemporal_move_p (const gassign
*gs
)
2842 return gs
->nontemporal_move
;
2845 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2848 gimple_assign_set_nontemporal_move (gimple
*gs
, bool nontemporal
)
2850 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2851 gs
->nontemporal_move
= nontemporal
;
2855 /* Return the code of the expression computed on the rhs of assignment
2856 statement GS. In case that the RHS is a single object, returns the
2857 tree code of the object. */
2859 static inline enum tree_code
2860 gimple_assign_rhs_code (const gassign
*gs
)
2862 enum tree_code code
= (enum tree_code
) gs
->subcode
;
2863 /* While we initially set subcode to the TREE_CODE of the rhs for
2864 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2865 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2866 if (get_gimple_rhs_class (code
) == GIMPLE_SINGLE_RHS
)
2867 code
= TREE_CODE (gs
->op
[1]);
2872 static inline enum tree_code
2873 gimple_assign_rhs_code (const gimple
*gs
)
2875 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2876 return gimple_assign_rhs_code (ass
);
2880 /* Set CODE to be the code for the expression computed on the RHS of
2884 gimple_assign_set_rhs_code (gimple
*s
, enum tree_code code
)
2886 GIMPLE_CHECK (s
, GIMPLE_ASSIGN
);
2891 /* Return the gimple rhs class of the code of the expression computed on
2892 the rhs of assignment statement GS.
2893 This will never return GIMPLE_INVALID_RHS. */
2895 static inline enum gimple_rhs_class
2896 gimple_assign_rhs_class (const gimple
*gs
)
2898 return get_gimple_rhs_class (gimple_assign_rhs_code (gs
));
2901 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2902 there is no operator associated with the assignment itself.
2903 Unlike gimple_assign_copy_p, this predicate returns true for
2904 any RHS operand, including those that perform an operation
2905 and do not have the semantics of a copy, such as COND_EXPR. */
2908 gimple_assign_single_p (const gimple
*gs
)
2910 return (is_gimple_assign (gs
)
2911 && gimple_assign_rhs_class (gs
) == GIMPLE_SINGLE_RHS
);
2914 /* Return true if GS performs a store to its lhs. */
2917 gimple_store_p (const gimple
*gs
)
2919 tree lhs
= gimple_get_lhs (gs
);
2920 return lhs
&& !is_gimple_reg (lhs
);
2923 /* Return true if GS is an assignment that loads from its rhs1. */
2926 gimple_assign_load_p (const gimple
*gs
)
2929 if (!gimple_assign_single_p (gs
))
2931 rhs
= gimple_assign_rhs1 (gs
);
2932 if (TREE_CODE (rhs
) == WITH_SIZE_EXPR
)
2934 rhs
= get_base_address (rhs
);
2935 return (DECL_P (rhs
)
2936 || TREE_CODE (rhs
) == MEM_REF
|| TREE_CODE (rhs
) == TARGET_MEM_REF
);
2940 /* Return true if S is a type-cast assignment. */
2943 gimple_assign_cast_p (const gimple
*s
)
2945 if (is_gimple_assign (s
))
2947 enum tree_code sc
= gimple_assign_rhs_code (s
);
2948 return CONVERT_EXPR_CODE_P (sc
)
2949 || sc
== VIEW_CONVERT_EXPR
2950 || sc
== FIX_TRUNC_EXPR
;
2956 /* Return true if S is a clobber statement. */
2959 gimple_clobber_p (const gimple
*s
)
2961 return gimple_assign_single_p (s
)
2962 && TREE_CLOBBER_P (gimple_assign_rhs1 (s
));
2965 /* Return true if S is a clobber statement. */
2968 gimple_clobber_p (const gimple
*s
, enum clobber_kind kind
)
2970 return gimple_clobber_p (s
)
2971 && CLOBBER_KIND (gimple_assign_rhs1 (s
)) == kind
;
2974 /* Return true if GS is a GIMPLE_CALL. */
2977 is_gimple_call (const gimple
*gs
)
2979 return gimple_code (gs
) == GIMPLE_CALL
;
2982 /* Return the LHS of call statement GS. */
2985 gimple_call_lhs (const gcall
*gs
)
2991 gimple_call_lhs (const gimple
*gs
)
2993 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
2994 return gimple_call_lhs (gc
);
2998 /* Return a pointer to the LHS of call statement GS. */
3000 static inline tree
*
3001 gimple_call_lhs_ptr (gcall
*gs
)
3006 static inline tree
*
3007 gimple_call_lhs_ptr (gimple
*gs
)
3009 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3010 return gimple_call_lhs_ptr (gc
);
3014 /* Set LHS to be the LHS operand of call statement GS. */
3017 gimple_call_set_lhs (gcall
*gs
, tree lhs
)
3020 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
3021 SSA_NAME_DEF_STMT (lhs
) = gs
;
3025 gimple_call_set_lhs (gimple
*gs
, tree lhs
)
3027 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3028 gimple_call_set_lhs (gc
, lhs
);
3032 /* Return true if call GS calls an internal-only function, as enumerated
3036 gimple_call_internal_p (const gcall
*gs
)
3038 return (gs
->subcode
& GF_CALL_INTERNAL
) != 0;
3042 gimple_call_internal_p (const gimple
*gs
)
3044 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3045 return gimple_call_internal_p (gc
);
3048 /* Return true if call GS is marked as nocf_check. */
3051 gimple_call_nocf_check_p (const gcall
*gs
)
3053 return (gs
->subcode
& GF_CALL_NOCF_CHECK
) != 0;
3056 /* Mark statement GS as nocf_check call. */
3059 gimple_call_set_nocf_check (gcall
*gs
, bool nocf_check
)
3062 gs
->subcode
|= GF_CALL_NOCF_CHECK
;
3064 gs
->subcode
&= ~GF_CALL_NOCF_CHECK
;
3067 /* Return the target of internal call GS. */
3069 static inline enum internal_fn
3070 gimple_call_internal_fn (const gcall
*gs
)
3072 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
3073 return gs
->u
.internal_fn
;
3076 static inline enum internal_fn
3077 gimple_call_internal_fn (const gimple
*gs
)
3079 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3080 return gimple_call_internal_fn (gc
);
3083 /* Return true, if this internal gimple call is unique. */
3086 gimple_call_internal_unique_p (const gcall
*gs
)
3088 return gimple_call_internal_fn (gs
) == IFN_UNIQUE
;
3092 gimple_call_internal_unique_p (const gimple
*gs
)
3094 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3095 return gimple_call_internal_unique_p (gc
);
3098 /* Return true if GS is an internal function FN. */
3101 gimple_call_internal_p (const gimple
*gs
, internal_fn fn
)
3103 return (is_gimple_call (gs
)
3104 && gimple_call_internal_p (gs
)
3105 && gimple_call_internal_fn (gs
) == fn
);
3108 /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
3109 that could alter control flow. */
3112 gimple_call_set_ctrl_altering (gcall
*s
, bool ctrl_altering_p
)
3114 if (ctrl_altering_p
)
3115 s
->subcode
|= GF_CALL_CTRL_ALTERING
;
3117 s
->subcode
&= ~GF_CALL_CTRL_ALTERING
;
3121 gimple_call_set_ctrl_altering (gimple
*s
, bool ctrl_altering_p
)
3123 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (s
);
3124 gimple_call_set_ctrl_altering (gc
, ctrl_altering_p
);
3127 /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
3128 flag is set. Such call could not be a stmt in the middle of a bb. */
3131 gimple_call_ctrl_altering_p (const gcall
*gs
)
3133 return (gs
->subcode
& GF_CALL_CTRL_ALTERING
) != 0;
3137 gimple_call_ctrl_altering_p (const gimple
*gs
)
3139 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3140 return gimple_call_ctrl_altering_p (gc
);
3144 /* Return the function type of the function called by GS. */
3147 gimple_call_fntype (const gcall
*gs
)
3149 if (gimple_call_internal_p (gs
))
3151 return gs
->u
.fntype
;
3155 gimple_call_fntype (const gimple
*gs
)
3157 const gcall
*call_stmt
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3158 return gimple_call_fntype (call_stmt
);
3161 /* Set the type of the function called by CALL_STMT to FNTYPE. */
3164 gimple_call_set_fntype (gcall
*call_stmt
, tree fntype
)
3166 gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt
));
3167 call_stmt
->u
.fntype
= fntype
;
3171 /* Return the tree node representing the function called by call
3175 gimple_call_fn (const gcall
*gs
)
3181 gimple_call_fn (const gimple
*gs
)
3183 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3184 return gimple_call_fn (gc
);
3187 /* Return a pointer to the tree node representing the function called by call
3190 static inline tree
*
3191 gimple_call_fn_ptr (gcall
*gs
)
3196 static inline tree
*
3197 gimple_call_fn_ptr (gimple
*gs
)
3199 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3200 return gimple_call_fn_ptr (gc
);
3204 /* Set FN to be the function called by call statement GS. */
3207 gimple_call_set_fn (gcall
*gs
, tree fn
)
3209 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
3214 /* Set FNDECL to be the function called by call statement GS. */
3217 gimple_call_set_fndecl (gcall
*gs
, tree decl
)
3219 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
3220 gs
->op
[1] = build1_loc (gimple_location (gs
), ADDR_EXPR
,
3221 build_pointer_type (TREE_TYPE (decl
)), decl
);
3225 gimple_call_set_fndecl (gimple
*gs
, tree decl
)
3227 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3228 gimple_call_set_fndecl (gc
, decl
);
3232 /* Set internal function FN to be the function called by call statement CALL_STMT. */
3235 gimple_call_set_internal_fn (gcall
*call_stmt
, enum internal_fn fn
)
3237 gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt
));
3238 call_stmt
->u
.internal_fn
= fn
;
3242 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
3243 Otherwise return NULL. This function is analogous to
3244 get_callee_fndecl in tree land. */
3247 gimple_call_fndecl (const gcall
*gs
)
3249 return gimple_call_addr_fndecl (gimple_call_fn (gs
));
3253 gimple_call_fndecl (const gimple
*gs
)
3255 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3256 return gimple_call_fndecl (gc
);
3260 /* Return the type returned by call statement GS. */
3263 gimple_call_return_type (const gcall
*gs
)
3265 tree type
= gimple_call_fntype (gs
);
3267 if (type
== NULL_TREE
)
3268 return TREE_TYPE (gimple_call_lhs (gs
));
3270 /* The type returned by a function is the type of its
3272 return TREE_TYPE (type
);
3276 /* Return the static chain for call statement GS. */
3279 gimple_call_chain (const gcall
*gs
)
3285 gimple_call_chain (const gimple
*gs
)
3287 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3288 return gimple_call_chain (gc
);
3292 /* Return a pointer to the static chain for call statement CALL_STMT. */
3294 static inline tree
*
3295 gimple_call_chain_ptr (gcall
*call_stmt
)
3297 return &call_stmt
->op
[2];
3300 /* Set CHAIN to be the static chain for call statement CALL_STMT. */
3303 gimple_call_set_chain (gcall
*call_stmt
, tree chain
)
3305 call_stmt
->op
[2] = chain
;
3309 /* Return the number of arguments used by call statement GS. */
3311 static inline unsigned
3312 gimple_call_num_args (const gcall
*gs
)
3314 return gimple_num_ops (gs
) - 3;
3317 static inline unsigned
3318 gimple_call_num_args (const gimple
*gs
)
3320 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3321 return gimple_call_num_args (gc
);
3325 /* Return the argument at position INDEX for call statement GS. */
3328 gimple_call_arg (const gcall
*gs
, unsigned index
)
3330 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3331 return gs
->op
[index
+ 3];
3335 gimple_call_arg (const gimple
*gs
, unsigned index
)
3337 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3338 return gimple_call_arg (gc
, index
);
3342 /* Return a pointer to the argument at position INDEX for call
3345 static inline tree
*
3346 gimple_call_arg_ptr (gcall
*gs
, unsigned index
)
3348 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3349 return &gs
->op
[index
+ 3];
3352 static inline tree
*
3353 gimple_call_arg_ptr (gimple
*gs
, unsigned index
)
3355 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3356 return gimple_call_arg_ptr (gc
, index
);
3360 /* Set ARG to be the argument at position INDEX for call statement GS. */
3363 gimple_call_set_arg (gcall
*gs
, unsigned index
, tree arg
)
3365 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3366 gs
->op
[index
+ 3] = arg
;
3370 gimple_call_set_arg (gimple
*gs
, unsigned index
, tree arg
)
3372 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3373 gimple_call_set_arg (gc
, index
, arg
);
3377 /* If TAIL_P is true, mark call statement S as being a tail call
3378 (i.e., a call just before the exit of a function). These calls are
3379 candidate for tail call optimization. */
3382 gimple_call_set_tail (gcall
*s
, bool tail_p
)
3385 s
->subcode
|= GF_CALL_TAILCALL
;
3387 s
->subcode
&= ~GF_CALL_TAILCALL
;
3391 /* Return true if GIMPLE_CALL S is marked as a tail call. */
3394 gimple_call_tail_p (const gcall
*s
)
3396 return (s
->subcode
& GF_CALL_TAILCALL
) != 0;
3399 /* Mark (or clear) call statement S as requiring tail call optimization. */
3402 gimple_call_set_must_tail (gcall
*s
, bool must_tail_p
)
3405 s
->subcode
|= GF_CALL_MUST_TAIL_CALL
;
3407 s
->subcode
&= ~GF_CALL_MUST_TAIL_CALL
;
3410 /* Return true if call statement has been marked as requiring
3411 tail call optimization. */
3414 gimple_call_must_tail_p (const gcall
*s
)
3416 return (s
->subcode
& GF_CALL_MUST_TAIL_CALL
) != 0;
3419 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
3420 slot optimization. This transformation uses the target of the call
3421 expansion as the return slot for calls that return in memory. */
3424 gimple_call_set_return_slot_opt (gcall
*s
, bool return_slot_opt_p
)
3426 if (return_slot_opt_p
)
3427 s
->subcode
|= GF_CALL_RETURN_SLOT_OPT
;
3429 s
->subcode
&= ~GF_CALL_RETURN_SLOT_OPT
;
3433 /* Return true if S is marked for return slot optimization. */
3436 gimple_call_return_slot_opt_p (const gcall
*s
)
3438 return (s
->subcode
& GF_CALL_RETURN_SLOT_OPT
) != 0;
3442 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
3443 thunk to the thunked-to function. */
3446 gimple_call_set_from_thunk (gcall
*s
, bool from_thunk_p
)
3449 s
->subcode
|= GF_CALL_FROM_THUNK
;
3451 s
->subcode
&= ~GF_CALL_FROM_THUNK
;
3455 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
3458 gimple_call_from_thunk_p (gcall
*s
)
3460 return (s
->subcode
& GF_CALL_FROM_THUNK
) != 0;
3464 /* If FROM_NEW_OR_DELETE_P is true, mark GIMPLE_CALL S as being a call
3465 to operator new or delete created from a new or delete expression. */
3468 gimple_call_set_from_new_or_delete (gcall
*s
, bool from_new_or_delete_p
)
3470 if (from_new_or_delete_p
)
3471 s
->subcode
|= GF_CALL_FROM_NEW_OR_DELETE
;
3473 s
->subcode
&= ~GF_CALL_FROM_NEW_OR_DELETE
;
3477 /* Return true if GIMPLE_CALL S is a call to operator new or delete from
3478 from a new or delete expression. */
3481 gimple_call_from_new_or_delete (const gcall
*s
)
3483 return (s
->subcode
& GF_CALL_FROM_NEW_OR_DELETE
) != 0;
3487 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
3488 argument pack in its argument list. */
3491 gimple_call_set_va_arg_pack (gcall
*s
, bool pass_arg_pack_p
)
3493 if (pass_arg_pack_p
)
3494 s
->subcode
|= GF_CALL_VA_ARG_PACK
;
3496 s
->subcode
&= ~GF_CALL_VA_ARG_PACK
;
3500 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
3501 argument pack in its argument list. */
3504 gimple_call_va_arg_pack_p (const gcall
*s
)
3506 return (s
->subcode
& GF_CALL_VA_ARG_PACK
) != 0;
3510 /* Return true if S is a noreturn call. */
3513 gimple_call_noreturn_p (const gcall
*s
)
3515 return (gimple_call_flags (s
) & ECF_NORETURN
) != 0;
3519 gimple_call_noreturn_p (const gimple
*s
)
3521 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (s
);
3522 return gimple_call_noreturn_p (gc
);
3526 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
3527 even if the called function can throw in other cases. */
3530 gimple_call_set_nothrow (gcall
*s
, bool nothrow_p
)
3533 s
->subcode
|= GF_CALL_NOTHROW
;
3535 s
->subcode
&= ~GF_CALL_NOTHROW
;
3538 /* Return true if S is a nothrow call. */
3541 gimple_call_nothrow_p (gcall
*s
)
3543 return (gimple_call_flags (s
) & ECF_NOTHROW
) != 0;
3546 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
3547 is known to be emitted for VLA objects. Those are wrapped by
3548 stack_save/stack_restore calls and hence can't lead to unbounded
3549 stack growth even when they occur in loops. */
3552 gimple_call_set_alloca_for_var (gcall
*s
, bool for_var
)
3555 s
->subcode
|= GF_CALL_ALLOCA_FOR_VAR
;
3557 s
->subcode
&= ~GF_CALL_ALLOCA_FOR_VAR
;
3560 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
3563 gimple_call_alloca_for_var_p (gcall
*s
)
3565 return (s
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
3569 gimple_call_alloca_for_var_p (gimple
*s
)
3571 const gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (s
);
3572 return (gc
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
3575 /* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
3576 pointers to nested function are descriptors instead of trampolines. */
3579 gimple_call_set_by_descriptor (gcall
*s
, bool by_descriptor_p
)
3581 if (by_descriptor_p
)
3582 s
->subcode
|= GF_CALL_BY_DESCRIPTOR
;
3584 s
->subcode
&= ~GF_CALL_BY_DESCRIPTOR
;
3587 /* Return true if S is a by-descriptor call. */
3590 gimple_call_by_descriptor_p (gcall
*s
)
3592 return (s
->subcode
& GF_CALL_BY_DESCRIPTOR
) != 0;
3595 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
3598 gimple_call_copy_flags (gcall
*dest_call
, gcall
*orig_call
)
3600 dest_call
->subcode
= orig_call
->subcode
;
3604 /* Return a pointer to the points-to solution for the set of call-used
3605 variables of the call CALL_STMT. */
3607 static inline struct pt_solution
*
3608 gimple_call_use_set (gcall
*call_stmt
)
3610 return &call_stmt
->call_used
;
3613 /* As above, but const. */
3615 static inline const pt_solution
*
3616 gimple_call_use_set (const gcall
*call_stmt
)
3618 return &call_stmt
->call_used
;
3621 /* Return a pointer to the points-to solution for the set of call-used
3622 variables of the call CALL_STMT. */
3624 static inline struct pt_solution
*
3625 gimple_call_clobber_set (gcall
*call_stmt
)
3627 return &call_stmt
->call_clobbered
;
3630 /* As above, but const. */
3632 static inline const pt_solution
*
3633 gimple_call_clobber_set (const gcall
*call_stmt
)
3635 return &call_stmt
->call_clobbered
;
3639 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
3643 gimple_has_lhs (const gimple
*stmt
)
3645 if (is_gimple_assign (stmt
))
3647 if (const gcall
*call
= dyn_cast
<const gcall
*> (stmt
))
3648 return gimple_call_lhs (call
) != NULL_TREE
;
3653 /* Return the code of the predicate computed by conditional statement GS. */
3655 static inline enum tree_code
3656 gimple_cond_code (const gcond
*gs
)
3658 return (enum tree_code
) gs
->subcode
;
3661 static inline enum tree_code
3662 gimple_cond_code (const gimple
*gs
)
3664 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3665 return gimple_cond_code (gc
);
3669 /* Set CODE to be the predicate code for the conditional statement GS. */
3672 gimple_cond_set_code (gcond
*gs
, enum tree_code code
)
3678 /* Return the LHS of the predicate computed by conditional statement GS. */
3681 gimple_cond_lhs (const gcond
*gs
)
3687 gimple_cond_lhs (const gimple
*gs
)
3689 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3690 return gimple_cond_lhs (gc
);
3693 /* Return the pointer to the LHS of the predicate computed by conditional
3696 static inline tree
*
3697 gimple_cond_lhs_ptr (gcond
*gs
)
3702 /* Set LHS to be the LHS operand of the predicate computed by
3703 conditional statement GS. */
3706 gimple_cond_set_lhs (gcond
*gs
, tree lhs
)
3712 /* Return the RHS operand of the predicate computed by conditional GS. */
3715 gimple_cond_rhs (const gcond
*gs
)
3721 gimple_cond_rhs (const gimple
*gs
)
3723 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3724 return gimple_cond_rhs (gc
);
3727 /* Return the pointer to the RHS operand of the predicate computed by
3730 static inline tree
*
3731 gimple_cond_rhs_ptr (gcond
*gs
)
3737 /* Set RHS to be the RHS operand of the predicate computed by
3738 conditional statement GS. */
3741 gimple_cond_set_rhs (gcond
*gs
, tree rhs
)
3747 /* Return the label used by conditional statement GS when its
3748 predicate evaluates to true. */
3751 gimple_cond_true_label (const gcond
*gs
)
3757 /* Set LABEL to be the label used by conditional statement GS when its
3758 predicate evaluates to true. */
3761 gimple_cond_set_true_label (gcond
*gs
, tree label
)
3767 /* Set LABEL to be the label used by conditional statement GS when its
3768 predicate evaluates to false. */
3771 gimple_cond_set_false_label (gcond
*gs
, tree label
)
3777 /* Return the label used by conditional statement GS when its
3778 predicate evaluates to false. */
3781 gimple_cond_false_label (const gcond
*gs
)
3787 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
3790 gimple_cond_make_false (gcond
*gs
)
3792 gimple_cond_set_lhs (gs
, boolean_false_node
);
3793 gimple_cond_set_rhs (gs
, boolean_false_node
);
3794 gs
->subcode
= NE_EXPR
;
3798 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
3801 gimple_cond_make_true (gcond
*gs
)
3803 gimple_cond_set_lhs (gs
, boolean_true_node
);
3804 gimple_cond_set_rhs (gs
, boolean_false_node
);
3805 gs
->subcode
= NE_EXPR
;
3808 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
3809 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3812 gimple_cond_true_p (const gcond
*gs
)
3814 tree lhs
= gimple_cond_lhs (gs
);
3815 tree rhs
= gimple_cond_rhs (gs
);
3816 enum tree_code code
= gimple_cond_code (gs
);
3818 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3821 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3824 if (code
== NE_EXPR
&& lhs
!= rhs
)
3827 if (code
== EQ_EXPR
&& lhs
== rhs
)
3833 /* Check if conditional statement GS is of the form 'if (1 != 1)',
3834 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3837 gimple_cond_false_p (const gcond
*gs
)
3839 tree lhs
= gimple_cond_lhs (gs
);
3840 tree rhs
= gimple_cond_rhs (gs
);
3841 enum tree_code code
= gimple_cond_code (gs
);
3843 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3846 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3849 if (code
== NE_EXPR
&& lhs
== rhs
)
3852 if (code
== EQ_EXPR
&& lhs
!= rhs
)
3858 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3861 gimple_cond_set_condition (gcond
*stmt
, enum tree_code code
, tree lhs
,
3864 gimple_cond_set_code (stmt
, code
);
3865 gimple_cond_set_lhs (stmt
, lhs
);
3866 gimple_cond_set_rhs (stmt
, rhs
);
3870 /* Return the tree code for the expression computed by STMT. This is
3871 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
3872 GIMPLE_CALL, return CALL_EXPR as the expression code for
3873 consistency. This is useful when the caller needs to deal with the
3874 three kinds of computation that GIMPLE supports. */
3876 static inline enum tree_code
3877 gimple_expr_code (const gimple
*stmt
)
3879 if (const gassign
*ass
= dyn_cast
<const gassign
*> (stmt
))
3880 return gimple_assign_rhs_code (ass
);
3881 if (const gcond
*cond
= dyn_cast
<const gcond
*> (stmt
))
3882 return gimple_cond_code (cond
);
3885 gcc_gimple_checking_assert (gimple_code (stmt
) == GIMPLE_CALL
);
3891 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3894 gimple_label_label (const glabel
*gs
)
3900 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3904 gimple_label_set_label (glabel
*gs
, tree label
)
3910 /* Return the destination of the unconditional jump GS. */
3913 gimple_goto_dest (const gimple
*gs
)
3915 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3916 return gimple_op (gs
, 0);
3920 /* Set DEST to be the destination of the unconditonal jump GS. */
3923 gimple_goto_set_dest (ggoto
*gs
, tree dest
)
3929 /* Return the variables declared in the GIMPLE_BIND statement GS. */
3932 gimple_bind_vars (const gbind
*bind_stmt
)
3934 return bind_stmt
->vars
;
3938 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
3942 gimple_bind_set_vars (gbind
*bind_stmt
, tree vars
)
3944 bind_stmt
->vars
= vars
;
3948 /* Append VARS to the set of variables declared in the GIMPLE_BIND
3952 gimple_bind_append_vars (gbind
*bind_stmt
, tree vars
)
3954 bind_stmt
->vars
= chainon (bind_stmt
->vars
, vars
);
3958 static inline gimple_seq
*
3959 gimple_bind_body_ptr (gbind
*bind_stmt
)
3961 return &bind_stmt
->body
;
3964 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
3966 static inline gimple_seq
3967 gimple_bind_body (const gbind
*gs
)
3969 return *gimple_bind_body_ptr (const_cast <gbind
*> (gs
));
3973 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
3977 gimple_bind_set_body (gbind
*bind_stmt
, gimple_seq seq
)
3979 bind_stmt
->body
= seq
;
3983 /* Append a statement to the end of a GIMPLE_BIND's body. */
3986 gimple_bind_add_stmt (gbind
*bind_stmt
, gimple
*stmt
)
3988 gimple_seq_add_stmt (&bind_stmt
->body
, stmt
);
3992 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
3995 gimple_bind_add_seq (gbind
*bind_stmt
, gimple_seq seq
)
3997 gimple_seq_add_seq (&bind_stmt
->body
, seq
);
4001 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
4002 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
4005 gimple_bind_block (const gbind
*bind_stmt
)
4007 return bind_stmt
->block
;
4011 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
4015 gimple_bind_set_block (gbind
*bind_stmt
, tree block
)
4017 gcc_gimple_checking_assert (block
== NULL_TREE
4018 || TREE_CODE (block
) == BLOCK
);
4019 bind_stmt
->block
= block
;
4023 /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
4025 static inline unsigned
4026 gimple_asm_ninputs (const gasm
*asm_stmt
)
4028 return asm_stmt
->ni
;
4032 /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
4034 static inline unsigned
4035 gimple_asm_noutputs (const gasm
*asm_stmt
)
4037 return asm_stmt
->no
;
4041 /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
4043 static inline unsigned
4044 gimple_asm_nclobbers (const gasm
*asm_stmt
)
4046 return asm_stmt
->nc
;
4049 /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
4051 static inline unsigned
4052 gimple_asm_nlabels (const gasm
*asm_stmt
)
4054 return asm_stmt
->nl
;
4057 /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
4060 gimple_asm_input_op (const gasm
*asm_stmt
, unsigned index
)
4062 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
4063 return asm_stmt
->op
[index
+ asm_stmt
->no
];
4066 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
4069 gimple_asm_set_input_op (gasm
*asm_stmt
, unsigned index
, tree in_op
)
4071 gcc_gimple_checking_assert (index
< asm_stmt
->ni
4072 && TREE_CODE (in_op
) == TREE_LIST
);
4073 asm_stmt
->op
[index
+ asm_stmt
->no
] = in_op
;
4077 /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
4080 gimple_asm_output_op (const gasm
*asm_stmt
, unsigned index
)
4082 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
4083 return asm_stmt
->op
[index
];
4086 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
4089 gimple_asm_set_output_op (gasm
*asm_stmt
, unsigned index
, tree out_op
)
4091 gcc_gimple_checking_assert (index
< asm_stmt
->no
4092 && TREE_CODE (out_op
) == TREE_LIST
);
4093 asm_stmt
->op
[index
] = out_op
;
4097 /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
4100 gimple_asm_clobber_op (const gasm
*asm_stmt
, unsigned index
)
4102 gcc_gimple_checking_assert (index
< asm_stmt
->nc
);
4103 return asm_stmt
->op
[index
+ asm_stmt
->ni
+ asm_stmt
->no
];
4107 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
4110 gimple_asm_set_clobber_op (gasm
*asm_stmt
, unsigned index
, tree clobber_op
)
4112 gcc_gimple_checking_assert (index
< asm_stmt
->nc
4113 && TREE_CODE (clobber_op
) == TREE_LIST
);
4114 asm_stmt
->op
[index
+ asm_stmt
->ni
+ asm_stmt
->no
] = clobber_op
;
4117 /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
4120 gimple_asm_label_op (const gasm
*asm_stmt
, unsigned index
)
4122 gcc_gimple_checking_assert (index
< asm_stmt
->nl
);
4123 return asm_stmt
->op
[index
+ asm_stmt
->no
+ asm_stmt
->ni
+ asm_stmt
->nc
];
4126 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
4129 gimple_asm_set_label_op (gasm
*asm_stmt
, unsigned index
, tree label_op
)
4131 gcc_gimple_checking_assert (index
< asm_stmt
->nl
4132 && TREE_CODE (label_op
) == TREE_LIST
);
4133 asm_stmt
->op
[index
+ asm_stmt
->no
+ asm_stmt
->ni
+ asm_stmt
->nc
] = label_op
;
4136 /* Return the string representing the assembly instruction in
4137 GIMPLE_ASM ASM_STMT. */
4139 static inline const char *
4140 gimple_asm_string (const gasm
*asm_stmt
)
4142 return asm_stmt
->string
;
4146 /* Return true if ASM_STMT is marked volatile. */
4149 gimple_asm_volatile_p (const gasm
*asm_stmt
)
4151 return (asm_stmt
->subcode
& GF_ASM_VOLATILE
) != 0;
4155 /* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile. */
4158 gimple_asm_set_volatile (gasm
*asm_stmt
, bool volatile_p
)
4161 asm_stmt
->subcode
|= GF_ASM_VOLATILE
;
4163 asm_stmt
->subcode
&= ~GF_ASM_VOLATILE
;
4167 /* Return true if ASM_STMT is marked inline. */
4170 gimple_asm_inline_p (const gasm
*asm_stmt
)
4172 return (asm_stmt
->subcode
& GF_ASM_INLINE
) != 0;
4176 /* If INLINE_P is true, mark asm statement ASM_STMT as inline. */
4179 gimple_asm_set_inline (gasm
*asm_stmt
, bool inline_p
)
4182 asm_stmt
->subcode
|= GF_ASM_INLINE
;
4184 asm_stmt
->subcode
&= ~GF_ASM_INLINE
;
4188 /* If INPUT_P is true, mark asm ASM_STMT as an ASM_INPUT. */
4191 gimple_asm_set_input (gasm
*asm_stmt
, bool input_p
)
4194 asm_stmt
->subcode
|= GF_ASM_INPUT
;
4196 asm_stmt
->subcode
&= ~GF_ASM_INPUT
;
4200 /* Return true if asm ASM_STMT is an ASM_INPUT. */
4203 gimple_asm_input_p (const gasm
*asm_stmt
)
4205 return (asm_stmt
->subcode
& GF_ASM_INPUT
) != 0;
4209 /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4212 gimple_catch_types (const gcatch
*catch_stmt
)
4214 return catch_stmt
->types
;
4218 /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4220 static inline tree
*
4221 gimple_catch_types_ptr (gcatch
*catch_stmt
)
4223 return &catch_stmt
->types
;
4227 /* Return a pointer to the GIMPLE sequence representing the body of
4228 the handler of GIMPLE_CATCH statement CATCH_STMT. */
4230 static inline gimple_seq
*
4231 gimple_catch_handler_ptr (gcatch
*catch_stmt
)
4233 return &catch_stmt
->handler
;
4237 /* Return the GIMPLE sequence representing the body of the handler of
4238 GIMPLE_CATCH statement CATCH_STMT. */
4240 static inline gimple_seq
4241 gimple_catch_handler (const gcatch
*catch_stmt
)
4243 return *gimple_catch_handler_ptr (const_cast <gcatch
*> (catch_stmt
));
4247 /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
4250 gimple_catch_set_types (gcatch
*catch_stmt
, tree t
)
4252 catch_stmt
->types
= t
;
4256 /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
4259 gimple_catch_set_handler (gcatch
*catch_stmt
, gimple_seq handler
)
4261 catch_stmt
->handler
= handler
;
4265 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
4268 gimple_eh_filter_types (const gimple
*gs
)
4270 const geh_filter
*eh_filter_stmt
= as_a
<const geh_filter
*> (gs
);
4271 return eh_filter_stmt
->types
;
4275 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
4278 static inline tree
*
4279 gimple_eh_filter_types_ptr (gimple
*gs
)
4281 geh_filter
*eh_filter_stmt
= as_a
<geh_filter
*> (gs
);
4282 return &eh_filter_stmt
->types
;
4286 /* Return a pointer to the sequence of statement to execute when
4287 GIMPLE_EH_FILTER statement fails. */
4289 static inline gimple_seq
*
4290 gimple_eh_filter_failure_ptr (gimple
*gs
)
4292 geh_filter
*eh_filter_stmt
= as_a
<geh_filter
*> (gs
);
4293 return &eh_filter_stmt
->failure
;
4297 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
4300 static inline gimple_seq
4301 gimple_eh_filter_failure (const gimple
*gs
)
4303 return *gimple_eh_filter_failure_ptr (const_cast <gimple
*> (gs
));
4307 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
4311 gimple_eh_filter_set_types (geh_filter
*eh_filter_stmt
, tree types
)
4313 eh_filter_stmt
->types
= types
;
4317 /* Set FAILURE to be the sequence of statements to execute on failure
4318 for GIMPLE_EH_FILTER EH_FILTER_STMT. */
4321 gimple_eh_filter_set_failure (geh_filter
*eh_filter_stmt
,
4324 eh_filter_stmt
->failure
= failure
;
4327 /* Get the function decl to be called by the MUST_NOT_THROW region. */
4330 gimple_eh_must_not_throw_fndecl (const geh_mnt
*eh_mnt_stmt
)
4332 return eh_mnt_stmt
->fndecl
;
4335 /* Set the function decl to be called by GS to DECL. */
4338 gimple_eh_must_not_throw_set_fndecl (geh_mnt
*eh_mnt_stmt
,
4341 eh_mnt_stmt
->fndecl
= decl
;
4344 /* GIMPLE_EH_ELSE accessors. */
4346 static inline gimple_seq
*
4347 gimple_eh_else_n_body_ptr (geh_else
*eh_else_stmt
)
4349 return &eh_else_stmt
->n_body
;
4352 static inline gimple_seq
4353 gimple_eh_else_n_body (const geh_else
*eh_else_stmt
)
4355 return *gimple_eh_else_n_body_ptr (const_cast <geh_else
*> (eh_else_stmt
));
4358 static inline gimple_seq
*
4359 gimple_eh_else_e_body_ptr (geh_else
*eh_else_stmt
)
4361 return &eh_else_stmt
->e_body
;
4364 static inline gimple_seq
4365 gimple_eh_else_e_body (const geh_else
*eh_else_stmt
)
4367 return *gimple_eh_else_e_body_ptr (const_cast <geh_else
*> (eh_else_stmt
));
4371 gimple_eh_else_set_n_body (geh_else
*eh_else_stmt
, gimple_seq seq
)
4373 eh_else_stmt
->n_body
= seq
;
4377 gimple_eh_else_set_e_body (geh_else
*eh_else_stmt
, gimple_seq seq
)
4379 eh_else_stmt
->e_body
= seq
;
4382 /* GIMPLE_TRY accessors. */
4384 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
4385 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
4387 static inline enum gimple_try_flags
4388 gimple_try_kind (const gimple
*gs
)
4390 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
4391 return (enum gimple_try_flags
) (gs
->subcode
& GIMPLE_TRY_KIND
);
4395 /* Set the kind of try block represented by GIMPLE_TRY GS. */
4398 gimple_try_set_kind (gtry
*gs
, enum gimple_try_flags kind
)
4400 gcc_gimple_checking_assert (kind
== GIMPLE_TRY_CATCH
4401 || kind
== GIMPLE_TRY_FINALLY
);
4402 if (gimple_try_kind (gs
) != kind
)
4403 gs
->subcode
= (unsigned int) kind
;
4407 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4410 gimple_try_catch_is_cleanup (const gimple
*gs
)
4412 gcc_gimple_checking_assert (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
);
4413 return (gs
->subcode
& GIMPLE_TRY_CATCH_IS_CLEANUP
) != 0;
4417 /* Return a pointer to the sequence of statements used as the
4418 body for GIMPLE_TRY GS. */
4420 static inline gimple_seq
*
4421 gimple_try_eval_ptr (gimple
*gs
)
4423 gtry
*try_stmt
= as_a
<gtry
*> (gs
);
4424 return &try_stmt
->eval
;
4428 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
4430 static inline gimple_seq
4431 gimple_try_eval (const gimple
*gs
)
4433 return *gimple_try_eval_ptr (const_cast <gimple
*> (gs
));
4437 /* Return a pointer to the sequence of statements used as the cleanup body for
4440 static inline gimple_seq
*
4441 gimple_try_cleanup_ptr (gimple
*gs
)
4443 gtry
*try_stmt
= as_a
<gtry
*> (gs
);
4444 return &try_stmt
->cleanup
;
4448 /* Return the sequence of statements used as the cleanup body for
4451 static inline gimple_seq
4452 gimple_try_cleanup (const gimple
*gs
)
4454 return *gimple_try_cleanup_ptr (const_cast <gimple
*> (gs
));
4458 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4461 gimple_try_set_catch_is_cleanup (gtry
*g
, bool catch_is_cleanup
)
4463 gcc_gimple_checking_assert (gimple_try_kind (g
) == GIMPLE_TRY_CATCH
);
4464 if (catch_is_cleanup
)
4465 g
->subcode
|= GIMPLE_TRY_CATCH_IS_CLEANUP
;
4467 g
->subcode
&= ~GIMPLE_TRY_CATCH_IS_CLEANUP
;
4471 /* Set EVAL to be the sequence of statements to use as the body for
4472 GIMPLE_TRY TRY_STMT. */
4475 gimple_try_set_eval (gtry
*try_stmt
, gimple_seq eval
)
4477 try_stmt
->eval
= eval
;
4481 /* Set CLEANUP to be the sequence of statements to use as the cleanup
4482 body for GIMPLE_TRY TRY_STMT. */
4485 gimple_try_set_cleanup (gtry
*try_stmt
, gimple_seq cleanup
)
4487 try_stmt
->cleanup
= cleanup
;
4491 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
4493 static inline gimple_seq
*
4494 gimple_wce_cleanup_ptr (gimple
*gs
)
4496 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
4497 return &wce_stmt
->cleanup
;
4501 /* Return the cleanup sequence for cleanup statement GS. */
4503 static inline gimple_seq
4504 gimple_wce_cleanup (gimple
*gs
)
4506 return *gimple_wce_cleanup_ptr (gs
);
4510 /* Set CLEANUP to be the cleanup sequence for GS. */
4513 gimple_wce_set_cleanup (gimple
*gs
, gimple_seq cleanup
)
4515 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
4516 wce_stmt
->cleanup
= cleanup
;
4520 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
4523 gimple_wce_cleanup_eh_only (const gimple
*gs
)
4525 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
4526 return gs
->subcode
!= 0;
4530 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
4533 gimple_wce_set_cleanup_eh_only (gimple
*gs
, bool eh_only_p
)
4535 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
4536 gs
->subcode
= (unsigned int) eh_only_p
;
4540 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
4542 static inline unsigned
4543 gimple_phi_capacity (const gimple
*gs
)
4545 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4546 return phi_stmt
->capacity
;
4550 /* Return the number of arguments in GIMPLE_PHI GS. This must always
4551 be exactly the number of incoming edges for the basic block holding
4554 static inline unsigned
4555 gimple_phi_num_args (const gimple
*gs
)
4557 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4558 return phi_stmt
->nargs
;
4562 /* Return the SSA name created by GIMPLE_PHI GS. */
4565 gimple_phi_result (const gphi
*gs
)
4571 gimple_phi_result (const gimple
*gs
)
4573 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4574 return gimple_phi_result (phi_stmt
);
4577 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
4579 static inline tree
*
4580 gimple_phi_result_ptr (gphi
*gs
)
4585 static inline tree
*
4586 gimple_phi_result_ptr (gimple
*gs
)
4588 gphi
*phi_stmt
= as_a
<gphi
*> (gs
);
4589 return gimple_phi_result_ptr (phi_stmt
);
4592 /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
4595 gimple_phi_set_result (gphi
*phi
, tree result
)
4597 phi
->result
= result
;
4598 if (result
&& TREE_CODE (result
) == SSA_NAME
)
4599 SSA_NAME_DEF_STMT (result
) = phi
;
4603 /* Return the PHI argument corresponding to incoming edge INDEX for
4606 static inline struct phi_arg_d
*
4607 gimple_phi_arg (gphi
*gs
, unsigned index
)
4609 gcc_gimple_checking_assert (index
< gs
->nargs
);
4610 return &(gs
->args
[index
]);
4613 static inline const phi_arg_d
*
4614 gimple_phi_arg (const gphi
*gs
, unsigned index
)
4616 gcc_gimple_checking_assert (index
< gs
->nargs
);
4617 return &(gs
->args
[index
]);
4620 static inline struct phi_arg_d
*
4621 gimple_phi_arg (gimple
*gs
, unsigned index
)
4623 gphi
*phi_stmt
= as_a
<gphi
*> (gs
);
4624 return gimple_phi_arg (phi_stmt
, index
);
4627 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
4628 for GIMPLE_PHI PHI. */
4631 gimple_phi_set_arg (gphi
*phi
, unsigned index
, struct phi_arg_d
* phiarg
)
4633 gcc_gimple_checking_assert (index
< phi
->nargs
);
4634 phi
->args
[index
] = *phiarg
;
4637 /* Return the PHI nodes for basic block BB, or NULL if there are no
4640 static inline gimple_seq
4641 phi_nodes (const_basic_block bb
)
4643 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
4644 return bb
->il
.gimple
.phi_nodes
;
4647 /* Return a pointer to the PHI nodes for basic block BB. */
4649 static inline gimple_seq
*
4650 phi_nodes_ptr (basic_block bb
)
4652 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
4653 return &bb
->il
.gimple
.phi_nodes
;
4656 /* Return the tree operand for argument I of PHI node GS. */
4659 gimple_phi_arg_def (const gphi
*gs
, size_t index
)
4661 return gimple_phi_arg (gs
, index
)->def
;
4665 gimple_phi_arg_def (gimple
*gs
, size_t index
)
4667 return gimple_phi_arg (gs
, index
)->def
;
4671 /* Return a pointer to the tree operand for argument I of phi node PHI. */
4673 static inline tree
*
4674 gimple_phi_arg_def_ptr (gphi
*phi
, size_t index
)
4676 return &gimple_phi_arg (phi
, index
)->def
;
4679 /* Return the edge associated with argument I of phi node PHI. */
4682 gimple_phi_arg_edge (const gphi
*phi
, size_t i
)
4684 return EDGE_PRED (gimple_bb (phi
), i
);
4687 /* Return the source location of gimple argument I of phi node PHI. */
4689 static inline location_t
4690 gimple_phi_arg_location (const gphi
*phi
, size_t i
)
4692 return gimple_phi_arg (phi
, i
)->locus
;
4695 /* Return the source location of the argument on edge E of phi node PHI. */
4697 static inline location_t
4698 gimple_phi_arg_location_from_edge (gphi
*phi
, edge e
)
4700 return gimple_phi_arg (phi
, e
->dest_idx
)->locus
;
4703 /* Set the source location of gimple argument I of phi node PHI to LOC. */
4706 gimple_phi_arg_set_location (gphi
*phi
, size_t i
, location_t loc
)
4708 gimple_phi_arg (phi
, i
)->locus
= loc
;
4711 /* Return address of source location of gimple argument I of phi node PHI. */
4713 static inline location_t
*
4714 gimple_phi_arg_location_ptr (gphi
*phi
, size_t i
)
4716 return &gimple_phi_arg (phi
, i
)->locus
;
4719 /* Return TRUE if argument I of phi node PHI has a location record. */
4722 gimple_phi_arg_has_location (const gphi
*phi
, size_t i
)
4724 return gimple_phi_arg_location (phi
, i
) != UNKNOWN_LOCATION
;
4727 /* Return the number of arguments that can be accessed by gimple_arg. */
4729 static inline unsigned
4730 gimple_num_args (const gimple
*gs
)
4732 if (auto phi
= dyn_cast
<const gphi
*> (gs
))
4733 return gimple_phi_num_args (phi
);
4734 if (auto call
= dyn_cast
<const gcall
*> (gs
))
4735 return gimple_call_num_args (call
);
4736 return gimple_num_ops (as_a
<const gassign
*> (gs
)) - 1;
4739 /* GS must be an assignment, a call, or a PHI.
4740 If it's an assignment, return rhs operand I.
4741 If it's a call, return function argument I.
4742 If it's a PHI, return the value of PHI argument I. */
4745 gimple_arg (const gimple
*gs
, unsigned int i
)
4747 if (auto phi
= dyn_cast
<const gphi
*> (gs
))
4748 return gimple_phi_arg_def (phi
, i
);
4749 if (auto call
= dyn_cast
<const gcall
*> (gs
))
4750 return gimple_call_arg (call
, i
);
4751 return gimple_op (as_a
<const gassign
*> (gs
), i
+ 1);
4754 /* Return a pointer to gimple_arg (GS, I). */
4756 static inline tree
*
4757 gimple_arg_ptr (gimple
*gs
, unsigned int i
)
4759 if (auto phi
= dyn_cast
<gphi
*> (gs
))
4760 return gimple_phi_arg_def_ptr (phi
, i
);
4761 if (auto call
= dyn_cast
<gcall
*> (gs
))
4762 return gimple_call_arg_ptr (call
, i
);
4763 return gimple_op_ptr (as_a
<gassign
*> (gs
), i
+ 1);
4766 /* Return the region number for GIMPLE_RESX RESX_STMT. */
4769 gimple_resx_region (const gresx
*resx_stmt
)
4771 return resx_stmt
->region
;
4774 /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
4777 gimple_resx_set_region (gresx
*resx_stmt
, int region
)
4779 resx_stmt
->region
= region
;
4782 /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
4785 gimple_eh_dispatch_region (const geh_dispatch
*eh_dispatch_stmt
)
4787 return eh_dispatch_stmt
->region
;
4790 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
4791 EH_DISPATCH_STMT. */
4794 gimple_eh_dispatch_set_region (geh_dispatch
*eh_dispatch_stmt
, int region
)
4796 eh_dispatch_stmt
->region
= region
;
4799 /* Return the number of labels associated with the switch statement GS. */
4801 static inline unsigned
4802 gimple_switch_num_labels (const gswitch
*gs
)
4805 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4806 num_ops
= gimple_num_ops (gs
);
4807 gcc_gimple_checking_assert (num_ops
> 1);
4812 /* Set NLABELS to be the number of labels for the switch statement GS. */
4815 gimple_switch_set_num_labels (gswitch
*g
, unsigned nlabels
)
4817 GIMPLE_CHECK (g
, GIMPLE_SWITCH
);
4818 gimple_set_num_ops (g
, nlabels
+ 1);
4822 /* Return the index variable used by the switch statement GS. */
4825 gimple_switch_index (const gswitch
*gs
)
4831 /* Return a pointer to the index variable for the switch statement GS. */
4833 static inline tree
*
4834 gimple_switch_index_ptr (gswitch
*gs
)
4840 /* Set INDEX to be the index variable for switch statement GS. */
4843 gimple_switch_set_index (gswitch
*gs
, tree index
)
4845 gcc_gimple_checking_assert (SSA_VAR_P (index
) || CONSTANT_CLASS_P (index
));
4850 /* Return the label numbered INDEX. The default label is 0, followed by any
4851 labels in a switch statement. */
4854 gimple_switch_label (const gswitch
*gs
, unsigned index
)
4856 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1);
4857 return gs
->op
[index
+ 1];
4860 /* Set the label number INDEX to LABEL. 0 is always the default label. */
4863 gimple_switch_set_label (gswitch
*gs
, unsigned index
, tree label
)
4865 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1
4866 && (label
== NULL_TREE
4867 || TREE_CODE (label
) == CASE_LABEL_EXPR
));
4868 gs
->op
[index
+ 1] = label
;
4871 /* Return the default label for a switch statement. */
4874 gimple_switch_default_label (const gswitch
*gs
)
4876 tree label
= gimple_switch_label (gs
, 0);
4877 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4881 /* Set the default label for a switch statement. */
4884 gimple_switch_set_default_label (gswitch
*gs
, tree label
)
4886 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4887 gimple_switch_set_label (gs
, 0, label
);
4890 /* Return true if GS is a GIMPLE_DEBUG statement. */
4893 is_gimple_debug (const gimple
*gs
)
4895 return gimple_code (gs
) == GIMPLE_DEBUG
;
4899 /* Return the first nondebug statement in GIMPLE sequence S. */
4901 static inline gimple
*
4902 gimple_seq_first_nondebug_stmt (gimple_seq s
)
4904 gimple_seq_node n
= gimple_seq_first (s
);
4905 while (n
&& is_gimple_debug (n
))
4911 /* Return the last nondebug statement in GIMPLE sequence S. */
4913 static inline gimple
*
4914 gimple_seq_last_nondebug_stmt (gimple_seq s
)
4917 for (n
= gimple_seq_last (s
);
4918 n
&& is_gimple_debug (n
);
4926 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
4929 gimple_debug_bind_p (const gimple
*s
)
4931 if (is_gimple_debug (s
))
4932 return s
->subcode
== GIMPLE_DEBUG_BIND
;
4937 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
4940 gimple_debug_bind_get_var (const gimple
*dbg
)
4942 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4943 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4944 return gimple_op (dbg
, 0);
4947 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
4951 gimple_debug_bind_get_value (const gimple
*dbg
)
4953 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4954 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4955 return gimple_op (dbg
, 1);
4958 /* Return a pointer to the value bound to the variable in a
4959 GIMPLE_DEBUG bind statement. */
4961 static inline tree
*
4962 gimple_debug_bind_get_value_ptr (gimple
*dbg
)
4964 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4965 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4966 return gimple_op_ptr (dbg
, 1);
4969 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
4972 gimple_debug_bind_set_var (gimple
*dbg
, tree var
)
4974 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4975 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4976 gimple_set_op (dbg
, 0, var
);
4979 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
4983 gimple_debug_bind_set_value (gimple
*dbg
, tree value
)
4985 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4986 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4987 gimple_set_op (dbg
, 1, value
);
4990 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
4992 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
4994 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
4998 gimple_debug_bind_reset_value (gimple
*dbg
)
5000 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5001 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5002 gimple_set_op (dbg
, 1, GIMPLE_DEBUG_BIND_NOVALUE
);
5005 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
5009 gimple_debug_bind_has_value_p (gimple
*dbg
)
5011 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5012 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5013 return gimple_op (dbg
, 1) != GIMPLE_DEBUG_BIND_NOVALUE
;
5016 #undef GIMPLE_DEBUG_BIND_NOVALUE
5018 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
5021 gimple_debug_source_bind_p (const gimple
*s
)
5023 if (is_gimple_debug (s
))
5024 return s
->subcode
== GIMPLE_DEBUG_SOURCE_BIND
;
5029 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
5032 gimple_debug_source_bind_get_var (const gimple
*dbg
)
5034 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5035 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5036 return gimple_op (dbg
, 0);
5039 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
5043 gimple_debug_source_bind_get_value (const gimple
*dbg
)
5045 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5046 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5047 return gimple_op (dbg
, 1);
5050 /* Return a pointer to the value bound to the variable in a
5051 GIMPLE_DEBUG source bind statement. */
5053 static inline tree
*
5054 gimple_debug_source_bind_get_value_ptr (gimple
*dbg
)
5056 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5057 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5058 return gimple_op_ptr (dbg
, 1);
5061 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
5064 gimple_debug_source_bind_set_var (gimple
*dbg
, tree var
)
5066 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5067 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5068 gimple_set_op (dbg
, 0, var
);
5071 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
5075 gimple_debug_source_bind_set_value (gimple
*dbg
, tree value
)
5077 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5078 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5079 gimple_set_op (dbg
, 1, value
);
5082 /* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement. */
5085 gimple_debug_begin_stmt_p (const gimple
*s
)
5087 if (is_gimple_debug (s
))
5088 return s
->subcode
== GIMPLE_DEBUG_BEGIN_STMT
;
5093 /* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement. */
5096 gimple_debug_inline_entry_p (const gimple
*s
)
5098 if (is_gimple_debug (s
))
5099 return s
->subcode
== GIMPLE_DEBUG_INLINE_ENTRY
;
5104 /* Return true if S is a GIMPLE_DEBUG non-binding marker statement. */
5107 gimple_debug_nonbind_marker_p (const gimple
*s
)
5109 if (is_gimple_debug (s
))
5110 return s
->subcode
== GIMPLE_DEBUG_BEGIN_STMT
5111 || s
->subcode
== GIMPLE_DEBUG_INLINE_ENTRY
;
5116 /* Return the line number for EXPR, or return -1 if we have no line
5117 number information for it. */
5119 get_lineno (const gimple
*stmt
)
5126 loc
= gimple_location (stmt
);
5127 if (loc
== UNKNOWN_LOCATION
)
5130 return LOCATION_LINE (loc
);
5133 /* Return a pointer to the body for the OMP statement GS. */
5135 static inline gimple_seq
*
5136 gimple_omp_body_ptr (gimple
*gs
)
5138 return &static_cast <gimple_statement_omp
*> (gs
)->body
;
5141 /* Return the body for the OMP statement GS. */
5143 static inline gimple_seq
5144 gimple_omp_body (const gimple
*gs
)
5146 return *gimple_omp_body_ptr (const_cast <gimple
*> (gs
));
5149 /* Set BODY to be the body for the OMP statement GS. */
5152 gimple_omp_set_body (gimple
*gs
, gimple_seq body
)
5154 static_cast <gimple_statement_omp
*> (gs
)->body
= body
;
5158 /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
5161 gimple_omp_critical_name (const gomp_critical
*crit_stmt
)
5163 return crit_stmt
->name
;
5167 /* Return a pointer to the name associated with OMP critical statement
5170 static inline tree
*
5171 gimple_omp_critical_name_ptr (gomp_critical
*crit_stmt
)
5173 return &crit_stmt
->name
;
5177 /* Set NAME to be the name associated with OMP critical statement
5181 gimple_omp_critical_set_name (gomp_critical
*crit_stmt
, tree name
)
5183 crit_stmt
->name
= name
;
5187 /* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
5190 gimple_omp_critical_clauses (const gomp_critical
*crit_stmt
)
5192 return crit_stmt
->clauses
;
5196 /* Return a pointer to the clauses associated with OMP critical statement
5199 static inline tree
*
5200 gimple_omp_critical_clauses_ptr (gomp_critical
*crit_stmt
)
5202 return &crit_stmt
->clauses
;
5206 /* Set CLAUSES to be the clauses associated with OMP critical statement
5210 gimple_omp_critical_set_clauses (gomp_critical
*crit_stmt
, tree clauses
)
5212 crit_stmt
->clauses
= clauses
;
5216 /* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
5219 gimple_omp_ordered_clauses (const gomp_ordered
*ord_stmt
)
5221 return ord_stmt
->clauses
;
5225 /* Return a pointer to the clauses associated with OMP ordered statement
5228 static inline tree
*
5229 gimple_omp_ordered_clauses_ptr (gomp_ordered
*ord_stmt
)
5231 return &ord_stmt
->clauses
;
5235 /* Set CLAUSES to be the clauses associated with OMP ordered statement
5239 gimple_omp_ordered_set_clauses (gomp_ordered
*ord_stmt
, tree clauses
)
5241 ord_stmt
->clauses
= clauses
;
5245 /* Return the clauses associated with OMP_SCAN statement SCAN_STMT. */
5248 gimple_omp_scan_clauses (const gomp_scan
*scan_stmt
)
5250 return scan_stmt
->clauses
;
5254 /* Return a pointer to the clauses associated with OMP scan statement
5257 static inline tree
*
5258 gimple_omp_scan_clauses_ptr (gomp_scan
*scan_stmt
)
5260 return &scan_stmt
->clauses
;
5264 /* Set CLAUSES to be the clauses associated with OMP scan statement
5268 gimple_omp_scan_set_clauses (gomp_scan
*scan_stmt
, tree clauses
)
5270 scan_stmt
->clauses
= clauses
;
5274 /* Return the clauses associated with OMP_TASKGROUP statement GS. */
5277 gimple_omp_taskgroup_clauses (const gimple
*gs
)
5279 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5281 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5285 /* Return a pointer to the clauses associated with OMP taskgroup statement
5288 static inline tree
*
5289 gimple_omp_taskgroup_clauses_ptr (gimple
*gs
)
5291 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5292 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5296 /* Set CLAUSES to be the clauses associated with OMP taskgroup statement
5300 gimple_omp_taskgroup_set_clauses (gimple
*gs
, tree clauses
)
5302 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5303 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5308 /* Return the clauses associated with OMP_MASKED statement GS. */
5311 gimple_omp_masked_clauses (const gimple
*gs
)
5313 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5315 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5319 /* Return a pointer to the clauses associated with OMP masked statement
5322 static inline tree
*
5323 gimple_omp_masked_clauses_ptr (gimple
*gs
)
5325 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5326 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5330 /* Set CLAUSES to be the clauses associated with OMP masked statement
5334 gimple_omp_masked_set_clauses (gimple
*gs
, tree clauses
)
5336 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5337 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5342 /* Return the clauses associated with OMP_SCOPE statement GS. */
5345 gimple_omp_scope_clauses (const gimple
*gs
)
5347 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5349 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5353 /* Return a pointer to the clauses associated with OMP scope statement
5356 static inline tree
*
5357 gimple_omp_scope_clauses_ptr (gimple
*gs
)
5359 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5360 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5364 /* Set CLAUSES to be the clauses associated with OMP scope statement
5368 gimple_omp_scope_set_clauses (gimple
*gs
, tree clauses
)
5370 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5371 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5376 /* Return the kind of the OMP_FOR statemement G. */
5379 gimple_omp_for_kind (const gimple
*g
)
5381 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5382 return (gimple_omp_subcode (g
) & GF_OMP_FOR_KIND_MASK
);
5386 /* Set the kind of the OMP_FOR statement G. */
5389 gimple_omp_for_set_kind (gomp_for
*g
, int kind
)
5391 g
->subcode
= (g
->subcode
& ~GF_OMP_FOR_KIND_MASK
)
5392 | (kind
& GF_OMP_FOR_KIND_MASK
);
5396 /* Return true if OMP_FOR statement G has the
5397 GF_OMP_FOR_COMBINED flag set. */
5400 gimple_omp_for_combined_p (const gimple
*g
)
5402 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5403 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED
) != 0;
5407 /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
5408 the boolean value of COMBINED_P. */
5411 gimple_omp_for_set_combined_p (gomp_for
*g
, bool combined_p
)
5414 g
->subcode
|= GF_OMP_FOR_COMBINED
;
5416 g
->subcode
&= ~GF_OMP_FOR_COMBINED
;
5420 /* Return true if the OMP_FOR statement G has the
5421 GF_OMP_FOR_COMBINED_INTO flag set. */
5424 gimple_omp_for_combined_into_p (const gimple
*g
)
5426 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5427 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED_INTO
) != 0;
5431 /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
5432 on the boolean value of COMBINED_P. */
5435 gimple_omp_for_set_combined_into_p (gomp_for
*g
, bool combined_p
)
5438 g
->subcode
|= GF_OMP_FOR_COMBINED_INTO
;
5440 g
->subcode
&= ~GF_OMP_FOR_COMBINED_INTO
;
5444 /* Return the clauses associated with the OMP_FOR statement GS. */
5447 gimple_omp_for_clauses (const gimple
*gs
)
5449 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5450 return omp_for_stmt
->clauses
;
5454 /* Return a pointer to the clauses associated with the OMP_FOR statement
5457 static inline tree
*
5458 gimple_omp_for_clauses_ptr (gimple
*gs
)
5460 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5461 return &omp_for_stmt
->clauses
;
5465 /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
5469 gimple_omp_for_set_clauses (gimple
*gs
, tree clauses
)
5471 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5472 omp_for_stmt
->clauses
= clauses
;
5476 /* Get the collapse count of the OMP_FOR statement GS. */
5478 static inline size_t
5479 gimple_omp_for_collapse (const gimple
*gs
)
5481 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5482 return omp_for_stmt
->collapse
;
5486 /* Return the condition code associated with the OMP_FOR statement GS. */
5488 static inline enum tree_code
5489 gimple_omp_for_cond (const gimple
*gs
, size_t i
)
5491 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5492 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5493 return omp_for_stmt
->iter
[i
].cond
;
5497 /* Set COND to be the condition code for the OMP_FOR statement GS. */
5500 gimple_omp_for_set_cond (gimple
*gs
, size_t i
, enum tree_code cond
)
5502 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5503 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond
) == tcc_comparison
5504 && i
< omp_for_stmt
->collapse
);
5505 omp_for_stmt
->iter
[i
].cond
= cond
;
5509 /* Return the index variable for the OMP_FOR statement GS. */
5512 gimple_omp_for_index (const gimple
*gs
, size_t i
)
5514 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5515 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5516 return omp_for_stmt
->iter
[i
].index
;
5520 /* Return a pointer to the index variable for the OMP_FOR statement GS. */
5522 static inline tree
*
5523 gimple_omp_for_index_ptr (gimple
*gs
, size_t i
)
5525 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5526 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5527 return &omp_for_stmt
->iter
[i
].index
;
5531 /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
5534 gimple_omp_for_set_index (gimple
*gs
, size_t i
, tree index
)
5536 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5537 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5538 omp_for_stmt
->iter
[i
].index
= index
;
5542 /* Return the initial value for the OMP_FOR statement GS. */
5545 gimple_omp_for_initial (const gimple
*gs
, size_t i
)
5547 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5548 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5549 return omp_for_stmt
->iter
[i
].initial
;
5553 /* Return a pointer to the initial value for the OMP_FOR statement GS. */
5555 static inline tree
*
5556 gimple_omp_for_initial_ptr (gimple
*gs
, size_t i
)
5558 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5559 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5560 return &omp_for_stmt
->iter
[i
].initial
;
5564 /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
5567 gimple_omp_for_set_initial (gimple
*gs
, size_t i
, tree initial
)
5569 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5570 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5571 omp_for_stmt
->iter
[i
].initial
= initial
;
5575 /* Return the final value for the OMP_FOR statement GS. */
5578 gimple_omp_for_final (const gimple
*gs
, size_t i
)
5580 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5581 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5582 return omp_for_stmt
->iter
[i
].final
;
5586 /* Return a pointer to the final value for the OMP_FOR statement GS. */
5588 static inline tree
*
5589 gimple_omp_for_final_ptr (gimple
*gs
, size_t i
)
5591 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5592 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5593 return &omp_for_stmt
->iter
[i
].final
;
5597 /* Set FINAL to be the final value for the OMP_FOR statement GS. */
5600 gimple_omp_for_set_final (gimple
*gs
, size_t i
, tree final
)
5602 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5603 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5604 omp_for_stmt
->iter
[i
].final
= final
;
5608 /* Return the increment value for the OMP_FOR statement GS. */
5611 gimple_omp_for_incr (const gimple
*gs
, size_t i
)
5613 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5614 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5615 return omp_for_stmt
->iter
[i
].incr
;
5619 /* Return a pointer to the increment value for the OMP_FOR statement GS. */
5621 static inline tree
*
5622 gimple_omp_for_incr_ptr (gimple
*gs
, size_t i
)
5624 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5625 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5626 return &omp_for_stmt
->iter
[i
].incr
;
5630 /* Set INCR to be the increment value for the OMP_FOR statement GS. */
5633 gimple_omp_for_set_incr (gimple
*gs
, size_t i
, tree incr
)
5635 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5636 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5637 omp_for_stmt
->iter
[i
].incr
= incr
;
5641 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
5642 statement GS starts. */
5644 static inline gimple_seq
*
5645 gimple_omp_for_pre_body_ptr (gimple
*gs
)
5647 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5648 return &omp_for_stmt
->pre_body
;
5652 /* Return the sequence of statements to execute before the OMP_FOR
5653 statement GS starts. */
5655 static inline gimple_seq
5656 gimple_omp_for_pre_body (const gimple
*gs
)
5658 return *gimple_omp_for_pre_body_ptr (const_cast <gimple
*> (gs
));
5662 /* Set PRE_BODY to be the sequence of statements to execute before the
5663 OMP_FOR statement GS starts. */
5666 gimple_omp_for_set_pre_body (gimple
*gs
, gimple_seq pre_body
)
5668 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5669 omp_for_stmt
->pre_body
= pre_body
;
5672 /* Return the clauses associated with OMP_PARALLEL GS. */
5675 gimple_omp_parallel_clauses (const gimple
*gs
)
5677 const gomp_parallel
*omp_parallel_stmt
= as_a
<const gomp_parallel
*> (gs
);
5678 return omp_parallel_stmt
->clauses
;
5682 /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
5684 static inline tree
*
5685 gimple_omp_parallel_clauses_ptr (gomp_parallel
*omp_parallel_stmt
)
5687 return &omp_parallel_stmt
->clauses
;
5691 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
5694 gimple_omp_parallel_set_clauses (gomp_parallel
*omp_parallel_stmt
,
5697 omp_parallel_stmt
->clauses
= clauses
;
5701 /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
5704 gimple_omp_parallel_child_fn (const gomp_parallel
*omp_parallel_stmt
)
5706 return omp_parallel_stmt
->child_fn
;
5709 /* Return a pointer to the child function used to hold the body of
5710 OMP_PARALLEL_STMT. */
5712 static inline tree
*
5713 gimple_omp_parallel_child_fn_ptr (gomp_parallel
*omp_parallel_stmt
)
5715 return &omp_parallel_stmt
->child_fn
;
5719 /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
5722 gimple_omp_parallel_set_child_fn (gomp_parallel
*omp_parallel_stmt
,
5725 omp_parallel_stmt
->child_fn
= child_fn
;
5729 /* Return the artificial argument used to send variables and values
5730 from the parent to the children threads in OMP_PARALLEL_STMT. */
5733 gimple_omp_parallel_data_arg (const gomp_parallel
*omp_parallel_stmt
)
5735 return omp_parallel_stmt
->data_arg
;
5739 /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
5741 static inline tree
*
5742 gimple_omp_parallel_data_arg_ptr (gomp_parallel
*omp_parallel_stmt
)
5744 return &omp_parallel_stmt
->data_arg
;
5748 /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
5751 gimple_omp_parallel_set_data_arg (gomp_parallel
*omp_parallel_stmt
,
5754 omp_parallel_stmt
->data_arg
= data_arg
;
5757 /* Return the clauses associated with OMP_TASK GS. */
5760 gimple_omp_task_clauses (const gimple
*gs
)
5762 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
5763 return omp_task_stmt
->clauses
;
5767 /* Return a pointer to the clauses associated with OMP_TASK GS. */
5769 static inline tree
*
5770 gimple_omp_task_clauses_ptr (gimple
*gs
)
5772 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5773 return &omp_task_stmt
->clauses
;
5777 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5781 gimple_omp_task_set_clauses (gimple
*gs
, tree clauses
)
5783 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5784 omp_task_stmt
->clauses
= clauses
;
5788 /* Return true if OMP task statement G has the
5789 GF_OMP_TASK_TASKLOOP flag set. */
5792 gimple_omp_task_taskloop_p (const gimple
*g
)
5794 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5795 return (gimple_omp_subcode (g
) & GF_OMP_TASK_TASKLOOP
) != 0;
5799 /* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
5800 value of TASKLOOP_P. */
5803 gimple_omp_task_set_taskloop_p (gimple
*g
, bool taskloop_p
)
5805 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5807 g
->subcode
|= GF_OMP_TASK_TASKLOOP
;
5809 g
->subcode
&= ~GF_OMP_TASK_TASKLOOP
;
5813 /* Return true if OMP task statement G has the
5814 GF_OMP_TASK_TASKWAIT flag set. */
5817 gimple_omp_task_taskwait_p (const gimple
*g
)
5819 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5820 return (gimple_omp_subcode (g
) & GF_OMP_TASK_TASKWAIT
) != 0;
5824 /* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
5825 value of TASKWAIT_P. */
5828 gimple_omp_task_set_taskwait_p (gimple
*g
, bool taskwait_p
)
5830 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5832 g
->subcode
|= GF_OMP_TASK_TASKWAIT
;
5834 g
->subcode
&= ~GF_OMP_TASK_TASKWAIT
;
5838 /* Return the child function used to hold the body of OMP_TASK GS. */
5841 gimple_omp_task_child_fn (const gimple
*gs
)
5843 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
5844 return omp_task_stmt
->child_fn
;
5847 /* Return a pointer to the child function used to hold the body of
5850 static inline tree
*
5851 gimple_omp_task_child_fn_ptr (gimple
*gs
)
5853 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5854 return &omp_task_stmt
->child_fn
;
5858 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
5861 gimple_omp_task_set_child_fn (gimple
*gs
, tree child_fn
)
5863 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5864 omp_task_stmt
->child_fn
= child_fn
;
5868 /* Return the artificial argument used to send variables and values
5869 from the parent to the children threads in OMP_TASK GS. */
5872 gimple_omp_task_data_arg (const gimple
*gs
)
5874 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
5875 return omp_task_stmt
->data_arg
;
5879 /* Return a pointer to the data argument for OMP_TASK GS. */
5881 static inline tree
*
5882 gimple_omp_task_data_arg_ptr (gimple
*gs
)
5884 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5885 return &omp_task_stmt
->data_arg
;
5889 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
5892 gimple_omp_task_set_data_arg (gimple
*gs
, tree data_arg
)
5894 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5895 omp_task_stmt
->data_arg
= data_arg
;
5899 /* Return the clauses associated with OMP_TASK GS. */
5902 gimple_omp_taskreg_clauses (const gimple
*gs
)
5904 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
5905 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
5906 return omp_taskreg_stmt
->clauses
;
5910 /* Return a pointer to the clauses associated with OMP_TASK GS. */
5912 static inline tree
*
5913 gimple_omp_taskreg_clauses_ptr (gimple
*gs
)
5915 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5916 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5917 return &omp_taskreg_stmt
->clauses
;
5921 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5925 gimple_omp_taskreg_set_clauses (gimple
*gs
, tree clauses
)
5927 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5928 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5929 omp_taskreg_stmt
->clauses
= clauses
;
5933 /* Return the child function used to hold the body of OMP_TASK GS. */
5936 gimple_omp_taskreg_child_fn (const gimple
*gs
)
5938 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
5939 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
5940 return omp_taskreg_stmt
->child_fn
;
5943 /* Return a pointer to the child function used to hold the body of
5946 static inline tree
*
5947 gimple_omp_taskreg_child_fn_ptr (gimple
*gs
)
5949 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5950 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5951 return &omp_taskreg_stmt
->child_fn
;
5955 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
5958 gimple_omp_taskreg_set_child_fn (gimple
*gs
, tree child_fn
)
5960 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5961 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5962 omp_taskreg_stmt
->child_fn
= child_fn
;
5966 /* Return the artificial argument used to send variables and values
5967 from the parent to the children threads in OMP_TASK GS. */
5970 gimple_omp_taskreg_data_arg (const gimple
*gs
)
5972 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
5973 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
5974 return omp_taskreg_stmt
->data_arg
;
5978 /* Return a pointer to the data argument for OMP_TASK GS. */
5980 static inline tree
*
5981 gimple_omp_taskreg_data_arg_ptr (gimple
*gs
)
5983 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5984 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5985 return &omp_taskreg_stmt
->data_arg
;
5989 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
5992 gimple_omp_taskreg_set_data_arg (gimple
*gs
, tree data_arg
)
5994 gimple_statement_omp_taskreg
*omp_taskreg_stmt
5995 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
5996 omp_taskreg_stmt
->data_arg
= data_arg
;
6000 /* Return the copy function used to hold the body of OMP_TASK GS. */
6003 gimple_omp_task_copy_fn (const gimple
*gs
)
6005 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6006 return omp_task_stmt
->copy_fn
;
6009 /* Return a pointer to the copy function used to hold the body of
6012 static inline tree
*
6013 gimple_omp_task_copy_fn_ptr (gimple
*gs
)
6015 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6016 return &omp_task_stmt
->copy_fn
;
6020 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
6023 gimple_omp_task_set_copy_fn (gimple
*gs
, tree copy_fn
)
6025 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6026 omp_task_stmt
->copy_fn
= copy_fn
;
6030 /* Return size of the data block in bytes in OMP_TASK GS. */
6033 gimple_omp_task_arg_size (const gimple
*gs
)
6035 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6036 return omp_task_stmt
->arg_size
;
6040 /* Return a pointer to the data block size for OMP_TASK GS. */
6042 static inline tree
*
6043 gimple_omp_task_arg_size_ptr (gimple
*gs
)
6045 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6046 return &omp_task_stmt
->arg_size
;
6050 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
6053 gimple_omp_task_set_arg_size (gimple
*gs
, tree arg_size
)
6055 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6056 omp_task_stmt
->arg_size
= arg_size
;
6060 /* Return align of the data block in bytes in OMP_TASK GS. */
6063 gimple_omp_task_arg_align (const gimple
*gs
)
6065 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6066 return omp_task_stmt
->arg_align
;
6070 /* Return a pointer to the data block align for OMP_TASK GS. */
6072 static inline tree
*
6073 gimple_omp_task_arg_align_ptr (gimple
*gs
)
6075 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6076 return &omp_task_stmt
->arg_align
;
6080 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
6083 gimple_omp_task_set_arg_align (gimple
*gs
, tree arg_align
)
6085 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6086 omp_task_stmt
->arg_align
= arg_align
;
6090 /* Return the clauses associated with OMP_SINGLE GS. */
6093 gimple_omp_single_clauses (const gimple
*gs
)
6095 const gomp_single
*omp_single_stmt
= as_a
<const gomp_single
*> (gs
);
6096 return omp_single_stmt
->clauses
;
6100 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
6102 static inline tree
*
6103 gimple_omp_single_clauses_ptr (gimple
*gs
)
6105 gomp_single
*omp_single_stmt
= as_a
<gomp_single
*> (gs
);
6106 return &omp_single_stmt
->clauses
;
6110 /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
6113 gimple_omp_single_set_clauses (gomp_single
*omp_single_stmt
, tree clauses
)
6115 omp_single_stmt
->clauses
= clauses
;
6119 /* Return the clauses associated with OMP_TARGET GS. */
6122 gimple_omp_target_clauses (const gimple
*gs
)
6124 const gomp_target
*omp_target_stmt
= as_a
<const gomp_target
*> (gs
);
6125 return omp_target_stmt
->clauses
;
6129 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
6131 static inline tree
*
6132 gimple_omp_target_clauses_ptr (gimple
*gs
)
6134 gomp_target
*omp_target_stmt
= as_a
<gomp_target
*> (gs
);
6135 return &omp_target_stmt
->clauses
;
6139 /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
6142 gimple_omp_target_set_clauses (gomp_target
*omp_target_stmt
,
6145 omp_target_stmt
->clauses
= clauses
;
6149 /* Return the kind of the OMP_TARGET G. */
6152 gimple_omp_target_kind (const gimple
*g
)
6154 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
6155 return (gimple_omp_subcode (g
) & GF_OMP_TARGET_KIND_MASK
);
6159 /* Set the kind of the OMP_TARGET G. */
6162 gimple_omp_target_set_kind (gomp_target
*g
, int kind
)
6164 g
->subcode
= (g
->subcode
& ~GF_OMP_TARGET_KIND_MASK
)
6165 | (kind
& GF_OMP_TARGET_KIND_MASK
);
6169 /* Return the child function used to hold the body of OMP_TARGET_STMT. */
6172 gimple_omp_target_child_fn (const gomp_target
*omp_target_stmt
)
6174 return omp_target_stmt
->child_fn
;
6177 /* Return a pointer to the child function used to hold the body of
6180 static inline tree
*
6181 gimple_omp_target_child_fn_ptr (gomp_target
*omp_target_stmt
)
6183 return &omp_target_stmt
->child_fn
;
6187 /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
6190 gimple_omp_target_set_child_fn (gomp_target
*omp_target_stmt
,
6193 omp_target_stmt
->child_fn
= child_fn
;
6197 /* Return the artificial argument used to send variables and values
6198 from the parent to the children threads in OMP_TARGET_STMT. */
6201 gimple_omp_target_data_arg (const gomp_target
*omp_target_stmt
)
6203 return omp_target_stmt
->data_arg
;
6207 /* Return a pointer to the data argument for OMP_TARGET GS. */
6209 static inline tree
*
6210 gimple_omp_target_data_arg_ptr (gomp_target
*omp_target_stmt
)
6212 return &omp_target_stmt
->data_arg
;
6216 /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
6219 gimple_omp_target_set_data_arg (gomp_target
*omp_target_stmt
,
6222 omp_target_stmt
->data_arg
= data_arg
;
6226 /* Return the clauses associated with OMP_TEAMS GS. */
6229 gimple_omp_teams_clauses (const gimple
*gs
)
6231 const gomp_teams
*omp_teams_stmt
= as_a
<const gomp_teams
*> (gs
);
6232 return omp_teams_stmt
->clauses
;
6236 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
6238 static inline tree
*
6239 gimple_omp_teams_clauses_ptr (gimple
*gs
)
6241 gomp_teams
*omp_teams_stmt
= as_a
<gomp_teams
*> (gs
);
6242 return &omp_teams_stmt
->clauses
;
6246 /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
6249 gimple_omp_teams_set_clauses (gomp_teams
*omp_teams_stmt
, tree clauses
)
6251 omp_teams_stmt
->clauses
= clauses
;
6254 /* Return the child function used to hold the body of OMP_TEAMS_STMT. */
6257 gimple_omp_teams_child_fn (const gomp_teams
*omp_teams_stmt
)
6259 return omp_teams_stmt
->child_fn
;
6262 /* Return a pointer to the child function used to hold the body of
6265 static inline tree
*
6266 gimple_omp_teams_child_fn_ptr (gomp_teams
*omp_teams_stmt
)
6268 return &omp_teams_stmt
->child_fn
;
6272 /* Set CHILD_FN to be the child function for OMP_TEAMS_STMT. */
6275 gimple_omp_teams_set_child_fn (gomp_teams
*omp_teams_stmt
, tree child_fn
)
6277 omp_teams_stmt
->child_fn
= child_fn
;
6281 /* Return the artificial argument used to send variables and values
6282 from the parent to the children threads in OMP_TEAMS_STMT. */
6285 gimple_omp_teams_data_arg (const gomp_teams
*omp_teams_stmt
)
6287 return omp_teams_stmt
->data_arg
;
6291 /* Return a pointer to the data argument for OMP_TEAMS_STMT. */
6293 static inline tree
*
6294 gimple_omp_teams_data_arg_ptr (gomp_teams
*omp_teams_stmt
)
6296 return &omp_teams_stmt
->data_arg
;
6300 /* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT. */
6303 gimple_omp_teams_set_data_arg (gomp_teams
*omp_teams_stmt
, tree data_arg
)
6305 omp_teams_stmt
->data_arg
= data_arg
;
6308 /* Return the host flag of an OMP_TEAMS_STMT. */
6311 gimple_omp_teams_host (const gomp_teams
*omp_teams_stmt
)
6313 return (gimple_omp_subcode (omp_teams_stmt
) & GF_OMP_TEAMS_HOST
) != 0;
6316 /* Set host flag of an OMP_TEAMS_STMT to VALUE. */
6319 gimple_omp_teams_set_host (gomp_teams
*omp_teams_stmt
, bool value
)
6322 omp_teams_stmt
->subcode
|= GF_OMP_TEAMS_HOST
;
6324 omp_teams_stmt
->subcode
&= ~GF_OMP_TEAMS_HOST
;
6327 /* Return the clauses associated with OMP_SECTIONS GS. */
6330 gimple_omp_sections_clauses (const gimple
*gs
)
6332 const gomp_sections
*omp_sections_stmt
= as_a
<const gomp_sections
*> (gs
);
6333 return omp_sections_stmt
->clauses
;
6337 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
6339 static inline tree
*
6340 gimple_omp_sections_clauses_ptr (gimple
*gs
)
6342 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6343 return &omp_sections_stmt
->clauses
;
6347 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
6351 gimple_omp_sections_set_clauses (gimple
*gs
, tree clauses
)
6353 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6354 omp_sections_stmt
->clauses
= clauses
;
6358 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
6362 gimple_omp_sections_control (const gimple
*gs
)
6364 const gomp_sections
*omp_sections_stmt
= as_a
<const gomp_sections
*> (gs
);
6365 return omp_sections_stmt
->control
;
6369 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
6372 static inline tree
*
6373 gimple_omp_sections_control_ptr (gimple
*gs
)
6375 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6376 return &omp_sections_stmt
->control
;
6380 /* Set CONTROL to be the set of clauses associated with the
6381 GIMPLE_OMP_SECTIONS in GS. */
6384 gimple_omp_sections_set_control (gimple
*gs
, tree control
)
6386 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6387 omp_sections_stmt
->control
= control
;
6391 /* Set the value being stored in an atomic store. */
6394 gimple_omp_atomic_store_set_val (gomp_atomic_store
*store_stmt
, tree val
)
6396 store_stmt
->val
= val
;
6400 /* Return the value being stored in an atomic store. */
6403 gimple_omp_atomic_store_val (const gomp_atomic_store
*store_stmt
)
6405 return store_stmt
->val
;
6409 /* Return a pointer to the value being stored in an atomic store. */
6411 static inline tree
*
6412 gimple_omp_atomic_store_val_ptr (gomp_atomic_store
*store_stmt
)
6414 return &store_stmt
->val
;
6418 /* Set the LHS of an atomic load. */
6421 gimple_omp_atomic_load_set_lhs (gomp_atomic_load
*load_stmt
, tree lhs
)
6423 load_stmt
->lhs
= lhs
;
6427 /* Get the LHS of an atomic load. */
6430 gimple_omp_atomic_load_lhs (const gomp_atomic_load
*load_stmt
)
6432 return load_stmt
->lhs
;
6436 /* Return a pointer to the LHS of an atomic load. */
6438 static inline tree
*
6439 gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load
*load_stmt
)
6441 return &load_stmt
->lhs
;
6445 /* Set the RHS of an atomic load. */
6448 gimple_omp_atomic_load_set_rhs (gomp_atomic_load
*load_stmt
, tree rhs
)
6450 load_stmt
->rhs
= rhs
;
6454 /* Get the RHS of an atomic load. */
6457 gimple_omp_atomic_load_rhs (const gomp_atomic_load
*load_stmt
)
6459 return load_stmt
->rhs
;
6463 /* Return a pointer to the RHS of an atomic load. */
6465 static inline tree
*
6466 gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load
*load_stmt
)
6468 return &load_stmt
->rhs
;
6472 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6475 gimple_omp_continue_control_def (const gomp_continue
*cont_stmt
)
6477 return cont_stmt
->control_def
;
6480 /* The same as above, but return the address. */
6482 static inline tree
*
6483 gimple_omp_continue_control_def_ptr (gomp_continue
*cont_stmt
)
6485 return &cont_stmt
->control_def
;
6488 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6491 gimple_omp_continue_set_control_def (gomp_continue
*cont_stmt
, tree def
)
6493 cont_stmt
->control_def
= def
;
6497 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6500 gimple_omp_continue_control_use (const gomp_continue
*cont_stmt
)
6502 return cont_stmt
->control_use
;
6506 /* The same as above, but return the address. */
6508 static inline tree
*
6509 gimple_omp_continue_control_use_ptr (gomp_continue
*cont_stmt
)
6511 return &cont_stmt
->control_use
;
6515 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6518 gimple_omp_continue_set_control_use (gomp_continue
*cont_stmt
, tree use
)
6520 cont_stmt
->control_use
= use
;
6523 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
6524 TRANSACTION_STMT. */
6526 static inline gimple_seq
*
6527 gimple_transaction_body_ptr (gtransaction
*transaction_stmt
)
6529 return &transaction_stmt
->body
;
6532 /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
6534 static inline gimple_seq
6535 gimple_transaction_body (const gtransaction
*transaction_stmt
)
6537 return transaction_stmt
->body
;
6540 /* Return the label associated with a GIMPLE_TRANSACTION. */
6543 gimple_transaction_label_norm (const gtransaction
*transaction_stmt
)
6545 return transaction_stmt
->label_norm
;
6548 static inline tree
*
6549 gimple_transaction_label_norm_ptr (gtransaction
*transaction_stmt
)
6551 return &transaction_stmt
->label_norm
;
6555 gimple_transaction_label_uninst (const gtransaction
*transaction_stmt
)
6557 return transaction_stmt
->label_uninst
;
6560 static inline tree
*
6561 gimple_transaction_label_uninst_ptr (gtransaction
*transaction_stmt
)
6563 return &transaction_stmt
->label_uninst
;
6567 gimple_transaction_label_over (const gtransaction
*transaction_stmt
)
6569 return transaction_stmt
->label_over
;
6572 static inline tree
*
6573 gimple_transaction_label_over_ptr (gtransaction
*transaction_stmt
)
6575 return &transaction_stmt
->label_over
;
6578 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
6580 static inline unsigned int
6581 gimple_transaction_subcode (const gtransaction
*transaction_stmt
)
6583 return transaction_stmt
->subcode
;
6586 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
6587 TRANSACTION_STMT. */
6590 gimple_transaction_set_body (gtransaction
*transaction_stmt
,
6593 transaction_stmt
->body
= body
;
6596 /* Set the label associated with a GIMPLE_TRANSACTION. */
6599 gimple_transaction_set_label_norm (gtransaction
*transaction_stmt
, tree label
)
6601 transaction_stmt
->label_norm
= label
;
6605 gimple_transaction_set_label_uninst (gtransaction
*transaction_stmt
, tree label
)
6607 transaction_stmt
->label_uninst
= label
;
6611 gimple_transaction_set_label_over (gtransaction
*transaction_stmt
, tree label
)
6613 transaction_stmt
->label_over
= label
;
6616 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
6619 gimple_transaction_set_subcode (gtransaction
*transaction_stmt
,
6620 unsigned int subcode
)
6622 transaction_stmt
->subcode
= subcode
;
6625 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
6627 static inline tree
*
6628 gimple_return_retval_ptr (greturn
*gs
)
6633 /* Return the return value for GIMPLE_RETURN GS. */
6636 gimple_return_retval (const greturn
*gs
)
6642 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
6645 gimple_return_set_retval (greturn
*gs
, tree retval
)
6651 /* Returns true when the gimple statement STMT is any of the OMP types. */
6653 #define CASE_GIMPLE_OMP \
6654 case GIMPLE_OMP_PARALLEL: \
6655 case GIMPLE_OMP_TASK: \
6656 case GIMPLE_OMP_FOR: \
6657 case GIMPLE_OMP_SECTIONS: \
6658 case GIMPLE_OMP_SECTIONS_SWITCH: \
6659 case GIMPLE_OMP_SINGLE: \
6660 case GIMPLE_OMP_TARGET: \
6661 case GIMPLE_OMP_TEAMS: \
6662 case GIMPLE_OMP_SCOPE: \
6663 case GIMPLE_OMP_SECTION: \
6664 case GIMPLE_OMP_MASTER: \
6665 case GIMPLE_OMP_MASKED: \
6666 case GIMPLE_OMP_TASKGROUP: \
6667 case GIMPLE_OMP_ORDERED: \
6668 case GIMPLE_OMP_CRITICAL: \
6669 case GIMPLE_OMP_SCAN: \
6670 case GIMPLE_OMP_RETURN: \
6671 case GIMPLE_OMP_ATOMIC_LOAD: \
6672 case GIMPLE_OMP_ATOMIC_STORE: \
6673 case GIMPLE_OMP_CONTINUE
6676 is_gimple_omp (const gimple
*stmt
)
6678 switch (gimple_code (stmt
))
6687 /* Return true if the OMP gimple statement STMT is any of the OpenACC types
6691 is_gimple_omp_oacc (const gimple
*stmt
)
6693 gcc_assert (is_gimple_omp (stmt
));
6694 switch (gimple_code (stmt
))
6696 case GIMPLE_OMP_ATOMIC_LOAD
:
6697 case GIMPLE_OMP_ATOMIC_STORE
:
6698 case GIMPLE_OMP_CONTINUE
:
6699 case GIMPLE_OMP_RETURN
:
6700 /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
6704 case GIMPLE_OMP_FOR
:
6705 switch (gimple_omp_for_kind (stmt
))
6707 case GF_OMP_FOR_KIND_OACC_LOOP
:
6712 case GIMPLE_OMP_TARGET
:
6713 switch (gimple_omp_target_kind (stmt
))
6715 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
6716 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
6717 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
6718 case GF_OMP_TARGET_KIND_OACC_DATA
:
6719 case GF_OMP_TARGET_KIND_OACC_UPDATE
:
6720 case GF_OMP_TARGET_KIND_OACC_ENTER_DATA
:
6721 case GF_OMP_TARGET_KIND_OACC_EXIT_DATA
:
6722 case GF_OMP_TARGET_KIND_OACC_DECLARE
:
6723 case GF_OMP_TARGET_KIND_OACC_HOST_DATA
:
6724 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
6725 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
6726 case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS
:
6737 /* Return true if the OMP gimple statement STMT is offloaded. */
6740 is_gimple_omp_offloaded (const gimple
*stmt
)
6742 gcc_assert (is_gimple_omp (stmt
));
6743 switch (gimple_code (stmt
))
6745 case GIMPLE_OMP_TARGET
:
6746 switch (gimple_omp_target_kind (stmt
))
6748 case GF_OMP_TARGET_KIND_REGION
:
6749 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
6750 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
6751 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
6752 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
6753 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
6764 /* Returns TRUE if statement G is a GIMPLE_NOP. */
6767 gimple_nop_p (const gimple
*g
)
6769 return gimple_code (g
) == GIMPLE_NOP
;
6773 /* Return true if GS is a GIMPLE_RESX. */
6776 is_gimple_resx (const gimple
*gs
)
6778 return gimple_code (gs
) == GIMPLE_RESX
;
6782 /* Enum and arrays used for allocation stats. Keep in sync with
6783 gimple.cc:gimple_alloc_kind_names. */
6784 enum gimple_alloc_kind
6786 gimple_alloc_kind_assign
, /* Assignments. */
6787 gimple_alloc_kind_phi
, /* PHI nodes. */
6788 gimple_alloc_kind_cond
, /* Conditionals. */
6789 gimple_alloc_kind_rest
, /* Everything else. */
6790 gimple_alloc_kind_all
6793 extern uint64_t gimple_alloc_counts
[];
6794 extern uint64_t gimple_alloc_sizes
[];
6796 /* Return the allocation kind for a given stmt CODE. */
6797 static inline enum gimple_alloc_kind
6798 gimple_alloc_kind (enum gimple_code code
)
6803 return gimple_alloc_kind_assign
;
6805 return gimple_alloc_kind_phi
;
6807 return gimple_alloc_kind_cond
;
6809 return gimple_alloc_kind_rest
;
6813 /* Return true if a location should not be emitted for this statement
6814 by annotate_all_with_location. */
6817 gimple_do_not_emit_location_p (gimple
*g
)
6819 return gimple_plf (g
, GF_PLF_1
);
6822 /* Mark statement G so a location will not be emitted by
6823 annotate_one_with_location. */
6826 gimple_set_do_not_emit_location (gimple
*g
)
6828 /* The PLF flags are initialized to 0 when a new tuple is created,
6829 so no need to initialize it anywhere. */
6830 gimple_set_plf (g
, GF_PLF_1
, true);
6833 #endif /* GCC_GIMPLE_H */