1 /* Gimple IR definitions.
3 Copyright (C) 2007-2025 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 /* Error out if a gimple tuple is addressed incorrectly. */
41 #if defined ENABLE_GIMPLE_CHECKING
42 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
43 extern void gimple_check_failed (const gimple
*, const char *, int, \
44 const char *, enum gimple_code
, \
45 enum tree_code
) ATTRIBUTE_NORETURN \
48 #define GIMPLE_CHECK(GS, CODE) \
50 const gimple *__gs = (GS); \
51 if (gimple_code (__gs) != (CODE)) \
52 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
53 (CODE), ERROR_MARK); \
57 GIMPLE_CHECK2(const gimple
*gs
,
58 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
59 const char *file
= __builtin_FILE (),
60 int line
= __builtin_LINE (),
61 const char *fun
= __builtin_FUNCTION ())
63 const char *file
= __FILE__
,
65 const char *fun
= NULL
)
68 T ret
= dyn_cast
<T
> (gs
);
70 gimple_check_failed (gs
, file
, line
, fun
,
71 std::remove_pointer
<T
>::type::code_
, ERROR_MARK
);
76 GIMPLE_CHECK2(gimple
*gs
,
77 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
78 const char *file
= __builtin_FILE (),
79 int line
= __builtin_LINE (),
80 const char *fun
= __builtin_FUNCTION ())
82 const char *file
= __FILE__
,
84 const char *fun
= NULL
)
87 T ret
= dyn_cast
<T
> (gs
);
89 gimple_check_failed (gs
, file
, line
, fun
,
90 std::remove_pointer
<T
>::type::code_
, ERROR_MARK
);
93 #else /* not ENABLE_GIMPLE_CHECKING */
94 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
95 #define GIMPLE_CHECK(GS, CODE) (void)0
98 GIMPLE_CHECK2(gimple
*gs
)
100 return as_a
<T
> (gs
);
102 template <typename T
>
104 GIMPLE_CHECK2(const gimple
*gs
)
106 return as_a
<T
> (gs
);
110 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
111 get_gimple_rhs_class. */
112 enum gimple_rhs_class
114 GIMPLE_INVALID_RHS
, /* The expression cannot be used on the RHS. */
115 GIMPLE_TERNARY_RHS
, /* The expression is a ternary operation. */
116 GIMPLE_BINARY_RHS
, /* The expression is a binary operation. */
117 GIMPLE_UNARY_RHS
, /* The expression is a unary operation. */
118 GIMPLE_SINGLE_RHS
/* The expression is a single object (an SSA
119 name, a _DECL, a _REF, etc. */
122 /* Specific flags for individual GIMPLE statements. These flags are
123 always stored in gimple.subcode and they may only be
124 defined for statement codes that do not use subcodes.
126 Values for the masks can overlap as long as the overlapping values
127 are never used in the same statement class.
129 The maximum mask value that can be defined is 1 << 15 (i.e., each
130 statement code can hold up to 16 bitflags).
132 Keep this list sorted. */
134 GF_ASM_BASIC
= 1 << 0,
135 GF_ASM_VOLATILE
= 1 << 1,
136 GF_ASM_INLINE
= 1 << 2,
137 GF_CALL_FROM_THUNK
= 1 << 0,
138 GF_CALL_RETURN_SLOT_OPT
= 1 << 1,
139 GF_CALL_TAILCALL
= 1 << 2,
140 GF_CALL_VA_ARG_PACK
= 1 << 3,
141 GF_CALL_NOTHROW
= 1 << 4,
142 GF_CALL_ALLOCA_FOR_VAR
= 1 << 5,
143 GF_CALL_INTERNAL
= 1 << 6,
144 GF_CALL_CTRL_ALTERING
= 1 << 7,
145 GF_CALL_MUST_TAIL_CALL
= 1 << 9,
146 GF_CALL_BY_DESCRIPTOR
= 1 << 10,
147 GF_CALL_NOCF_CHECK
= 1 << 11,
148 GF_CALL_FROM_NEW_OR_DELETE
= 1 << 12,
149 GF_CALL_XTHROW
= 1 << 13,
150 GF_OMP_PARALLEL_COMBINED
= 1 << 0,
151 GF_OMP_TASK_TASKLOOP
= 1 << 0,
152 GF_OMP_TASK_TASKWAIT
= 1 << 1,
153 GF_OMP_FOR_KIND_MASK
= (1 << 3) - 1,
154 GF_OMP_FOR_KIND_FOR
= 0,
155 GF_OMP_FOR_KIND_DISTRIBUTE
= 1,
156 GF_OMP_FOR_KIND_TASKLOOP
= 2,
157 GF_OMP_FOR_KIND_OACC_LOOP
= 4,
158 GF_OMP_FOR_KIND_SIMD
= 5,
159 GF_OMP_FOR_COMBINED
= 1 << 3,
160 GF_OMP_FOR_COMBINED_INTO
= 1 << 4,
161 GF_OMP_TARGET_KIND_MASK
= (1 << 5) - 1,
162 GF_OMP_TARGET_KIND_REGION
= 0,
163 GF_OMP_TARGET_KIND_DATA
= 1,
164 GF_OMP_TARGET_KIND_UPDATE
= 2,
165 GF_OMP_TARGET_KIND_ENTER_DATA
= 3,
166 GF_OMP_TARGET_KIND_EXIT_DATA
= 4,
167 GF_OMP_TARGET_KIND_OACC_PARALLEL
= 5,
168 GF_OMP_TARGET_KIND_OACC_KERNELS
= 6,
169 GF_OMP_TARGET_KIND_OACC_SERIAL
= 7,
170 GF_OMP_TARGET_KIND_OACC_DATA
= 8,
171 GF_OMP_TARGET_KIND_OACC_UPDATE
= 9,
172 GF_OMP_TARGET_KIND_OACC_ENTER_DATA
= 10,
173 GF_OMP_TARGET_KIND_OACC_EXIT_DATA
= 11,
174 GF_OMP_TARGET_KIND_OACC_DECLARE
= 12,
175 GF_OMP_TARGET_KIND_OACC_HOST_DATA
= 13,
176 /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
177 decomposed part, parallelized. */
178 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
= 14,
179 /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
180 decomposed part, "gang-single". */
181 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
= 15,
182 /* A 'GF_OMP_TARGET_KIND_OACC_DATA' representing an OpenACC 'kernels'
183 decomposed parts' 'data' construct. */
184 GF_OMP_TARGET_KIND_OACC_DATA_KERNELS
= 16,
185 GF_OMP_TEAMS_HOST
= 1 << 0,
187 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
188 a thread synchronization via some sort of barrier. The exact barrier
189 that would otherwise be emitted is dependent on the OMP statement with
190 which this return is associated. */
191 GF_OMP_RETURN_NOWAIT
= 1 << 0,
193 GF_OMP_SECTION_LAST
= 1 << 0,
194 GF_OMP_ORDERED_STANDALONE
= 1 << 0,
195 GF_OMP_ATOMIC_MEMORY_ORDER
= (1 << 6) - 1,
196 GF_OMP_ATOMIC_NEED_VALUE
= 1 << 6,
197 GF_OMP_ATOMIC_WEAK
= 1 << 7,
198 GF_PREDICT_TAKEN
= 1 << 15
201 /* This subcode tells apart different kinds of stmts that are not used
202 for codegen, but rather to retain debug information. */
203 enum gimple_debug_subcode
{
204 GIMPLE_DEBUG_BIND
= 0,
205 GIMPLE_DEBUG_SOURCE_BIND
= 1,
206 GIMPLE_DEBUG_BEGIN_STMT
= 2,
207 GIMPLE_DEBUG_INLINE_ENTRY
= 3
210 /* Masks for selecting a pass local flag (PLF) to work on. These
211 masks are used by gimple_set_plf and gimple_plf. */
217 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
218 are for 64 bit hosts. */
220 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
221 chain_next ("%h.next"), variable_size
))
225 Main identifying code for a tuple. */
226 ENUM_BITFIELD(gimple_code
) code
: 8;
228 /* Nonzero if a warning should not be emitted on this tuple. */
229 unsigned int no_warning
: 1;
231 /* Nonzero if this tuple has been visited. Passes are responsible
232 for clearing this bit before using it. */
233 unsigned int visited
: 1;
235 /* Nonzero if this tuple represents a non-temporal move; currently
236 only stores are supported. */
237 unsigned int nontemporal_move
: 1;
239 /* Pass local flags. These flags are free for any pass to use as
240 they see fit. Passes should not assume that these flags contain
241 any useful value when the pass starts. Any initial state that
242 the pass requires should be set on entry to the pass. See
243 gimple_set_plf and gimple_plf for usage. */
244 unsigned int plf
: 2;
246 /* Nonzero if this statement has been modified and needs to have its
247 operands rescanned. */
248 unsigned modified
: 1;
250 /* Nonzero if this statement contains volatile operands. */
251 unsigned has_volatile_ops
: 1;
253 /* Padding to get subcode to 16 bit alignment. */
256 /* The SUBCODE field can be used for tuple-specific flags for tuples
257 that do not require subcodes. Note that SUBCODE should be at
258 least as wide as tree codes, as several tuples store tree codes
260 unsigned int subcode
: 16;
262 /* UID of this statement. This is used by passes that want to assign IDs
263 to statements. It must be assigned and used by each pass. By default
264 it should be assumed to contain garbage. */
268 Number of operands in this tuple. */
271 /* Unused 32 bits padding on 64-bit hosts. */
274 Locus information for debug info. */
278 Basic block holding this statement. */
282 Linked lists of gimple statements. The next pointers form
283 a NULL terminated list, the prev pointers are a cyclic list.
284 A gimple statement is hence also a double-ended list of
285 statements, with the pointer itself being the first element,
286 and the prev pointer being the last. */
288 gimple
*GTY((skip
)) prev
;
292 /* Base structure for tuples with operands. */
294 /* This gimple subclass has no tag value. */
296 gimple_statement_with_ops_base
: public gimple
298 /* [ WORD 1-6 ] : base class */
301 SSA operand vectors. NOTE: It should be possible to
302 amalgamate these vectors with the operand vector OP. However,
303 the SSA operand vectors are organized differently and contain
304 more information (like immediate use chaining). */
305 struct use_optype_d
GTY((skip (""))) *use_ops
;
309 /* Statements that take register operands. */
311 struct GTY((tag("GSS_WITH_OPS")))
312 gimple_statement_with_ops
: public gimple_statement_with_ops_base
314 /* [ WORD 1-7 ] : base class */
317 Operand vector. NOTE! This must always be the last field
318 of this structure. In particular, this means that this
319 structure cannot be embedded inside another one. */
320 tree
GTY((length ("%h.num_ops"))) op
[1];
324 /* Base for statements that take both memory and register operands. */
326 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
327 gimple_statement_with_memory_ops_base
: public gimple_statement_with_ops_base
329 /* [ WORD 1-7 ] : base class */
332 Virtual operands for this statement. The GC will pick them
333 up via the ssa_names array. */
334 tree
GTY((skip (""))) vdef
;
335 tree
GTY((skip (""))) vuse
;
339 /* Statements that take both memory and register operands. */
341 struct GTY((tag("GSS_WITH_MEM_OPS")))
342 gimple_statement_with_memory_ops
:
343 public gimple_statement_with_memory_ops_base
345 /* [ WORD 1-9 ] : base class */
348 Operand vector. NOTE! This must always be the last field
349 of this structure. In particular, this means that this
350 structure cannot be embedded inside another one. */
351 tree
GTY((length ("%h.num_ops"))) op
[1];
355 /* Call statements that take both memory and register operands. */
357 struct GTY((tag("GSS_CALL")))
358 gcall
: public gimple_statement_with_memory_ops_base
360 /* [ WORD 1-9 ] : base class */
363 struct pt_solution call_used
;
364 struct pt_solution call_clobbered
;
367 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
368 tree
GTY ((tag ("0"))) fntype
;
369 enum internal_fn
GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn
;
373 Operand vector. NOTE! This must always be the last field
374 of this structure. In particular, this means that this
375 structure cannot be embedded inside another one. */
376 tree
GTY((length ("%h.num_ops"))) op
[1];
378 static const enum gimple_code code_
= GIMPLE_CALL
;
382 /* OMP statements. */
384 struct GTY((tag("GSS_OMP")))
385 gimple_statement_omp
: public gimple
387 /* [ WORD 1-6 ] : base class */
396 struct GTY((tag("GSS_BIND")))
397 gbind
: public gimple
399 /* [ WORD 1-6 ] : base class */
402 Variables declared in this scope. */
406 This is different than the BLOCK field in gimple,
407 which is analogous to TREE_BLOCK (i.e., the lexical block holding
408 this statement). This field is the equivalent of BIND_EXPR_BLOCK
409 in tree land (i.e., the lexical scope defined by this bind). See
420 struct GTY((tag("GSS_CATCH")))
421 gcatch
: public gimple
423 /* [ WORD 1-6 ] : base class */
433 /* GIMPLE_EH_FILTER */
435 struct GTY((tag("GSS_EH_FILTER")))
436 geh_filter
: public gimple
438 /* [ WORD 1-6 ] : base class */
451 struct GTY((tag("GSS_EH_ELSE")))
452 geh_else
: public gimple
454 /* [ WORD 1-6 ] : base class */
457 gimple_seq n_body
, e_body
;
460 /* GIMPLE_EH_MUST_NOT_THROW */
462 struct GTY((tag("GSS_EH_MNT")))
463 geh_mnt
: public gimple
465 /* [ WORD 1-6 ] : base class */
467 /* [ WORD 7 ] Abort function decl. */
473 struct GTY((tag("GSS_PHI")))
476 /* [ WORD 1-6 ] : base class */
486 struct phi_arg_d
GTY ((length ("%h.nargs"))) args
[1];
490 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
492 struct GTY((tag("GSS_EH_CTRL")))
493 gimple_statement_eh_ctrl
: public gimple
495 /* [ WORD 1-6 ] : base class */
498 Exception region number. */
502 struct GTY((tag("GSS_EH_CTRL")))
503 gresx
: public gimple_statement_eh_ctrl
505 /* No extra fields; adds invariant:
506 stmt->code == GIMPLE_RESX. */
509 struct GTY((tag("GSS_EH_CTRL")))
510 geh_dispatch
: public gimple_statement_eh_ctrl
512 /* No extra fields; adds invariant:
513 stmt->code == GIMPLE_EH_DISPATH. */
519 struct GTY((tag("GSS_TRY")))
522 /* [ WORD 1-6 ] : base class */
525 Expression to evaluate. */
529 Cleanup expression. */
533 /* Kind of GIMPLE_TRY statements. */
534 enum gimple_try_flags
537 GIMPLE_TRY_CATCH
= 1 << 0,
540 GIMPLE_TRY_FINALLY
= 1 << 1,
541 GIMPLE_TRY_KIND
= GIMPLE_TRY_CATCH
| GIMPLE_TRY_FINALLY
,
543 /* Analogous to TRY_CATCH_IS_CLEANUP. */
544 GIMPLE_TRY_CATCH_IS_CLEANUP
= 1 << 2
547 /* GIMPLE_WITH_CLEANUP_EXPR */
549 struct GTY((tag("GSS_WCE")))
550 gimple_statement_wce
: public gimple
552 /* [ WORD 1-6 ] : base class */
554 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
555 executed if an exception is thrown, not on normal exit of its
556 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
560 Cleanup expression. */
567 struct GTY((tag("GSS_ASM")))
568 gasm
: public gimple_statement_with_memory_ops_base
570 /* [ WORD 1-9 ] : base class */
573 __asm__ statement. */
577 Number of inputs, outputs, clobbers, labels. */
584 Operand vector. NOTE! This must always be the last field
585 of this structure. In particular, this means that this
586 structure cannot be embedded inside another one. */
587 tree
GTY((length ("%h.num_ops"))) op
[1];
590 /* GIMPLE_OMP_CRITICAL */
592 struct GTY((tag("GSS_OMP_CRITICAL")))
593 gomp_critical
: public gimple_statement_omp
595 /* [ WORD 1-7 ] : base class */
601 Critical section name. */
606 struct GTY(()) gimple_omp_for_iter
{
607 /* Condition code. */
610 /* Index variable. */
625 struct GTY((tag("GSS_OMP_FOR")))
626 gomp_for
: public gimple_statement_omp
628 /* [ WORD 1-7 ] : base class */
634 Number of elements in iter array. */
638 struct gimple_omp_for_iter
* GTY((length ("%h.collapse"))) iter
;
641 Pre-body evaluated before the loop body begins. */
646 /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
648 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
649 gimple_statement_omp_parallel_layout
: public gimple_statement_omp
651 /* [ WORD 1-7 ] : base class */
658 Child function holding the body of the parallel region. */
662 Shared data argument. */
666 /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
667 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
668 gimple_statement_omp_taskreg
: public gimple_statement_omp_parallel_layout
670 /* No extra fields; adds invariant:
671 stmt->code == GIMPLE_OMP_PARALLEL
672 || stmt->code == GIMPLE_OMP_TASK
673 || stmt->code == GIMPLE_OMP_TEAMS. */
676 /* GIMPLE_OMP_PARALLEL */
677 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
678 gomp_parallel
: public gimple_statement_omp_taskreg
680 /* No extra fields; adds invariant:
681 stmt->code == GIMPLE_OMP_PARALLEL. */
684 /* GIMPLE_OMP_TARGET */
685 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
686 gomp_target
: public gimple_statement_omp_parallel_layout
688 /* No extra fields; adds invariant:
689 stmt->code == GIMPLE_OMP_TARGET. */
692 /* GIMPLE_OMP_TASK */
694 struct GTY((tag("GSS_OMP_TASK")))
695 gomp_task
: public gimple_statement_omp_taskreg
697 /* [ WORD 1-10 ] : base class */
700 Child function holding firstprivate initialization if needed. */
704 Size and alignment in bytes of the argument data block. */
710 /* GIMPLE_OMP_SECTION */
711 /* Uses struct gimple_statement_omp. */
714 /* GIMPLE_OMP_SECTIONS */
716 struct GTY((tag("GSS_OMP_SECTIONS")))
717 gomp_sections
: public gimple_statement_omp
719 /* [ WORD 1-7 ] : base class */
725 The control variable used for deciding which of the sections to
730 /* GIMPLE_OMP_CONTINUE.
732 Note: This does not inherit from gimple_statement_omp, because we
733 do not need the body field. */
735 struct GTY((tag("GSS_OMP_CONTINUE")))
736 gomp_continue
: public gimple
738 /* [ WORD 1-6 ] : base class */
747 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
748 GIMPLE_OMP_SCAN, GIMPLE_OMP_MASKED, GIMPLE_OMP_SCOPE, GIMPLE_OMP_DISPATCH,
749 GIMPLE_OMP_INTEROP. */
751 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
752 gimple_statement_omp_single_layout
: public gimple_statement_omp
754 /* [ WORD 1-7 ] : base class */
760 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
761 gomp_single
: public gimple_statement_omp_single_layout
763 /* No extra fields; adds invariant:
764 stmt->code == GIMPLE_OMP_SINGLE. */
767 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
768 gomp_teams
: public gimple_statement_omp_taskreg
770 /* No extra fields; adds invariant:
771 stmt->code == GIMPLE_OMP_TEAMS. */
774 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
775 gomp_ordered
: public gimple_statement_omp_single_layout
777 /* No extra fields; adds invariant:
778 stmt->code == GIMPLE_OMP_ORDERED. */
781 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
782 gomp_scan
: public gimple_statement_omp_single_layout
784 /* No extra fields; adds invariant:
785 stmt->code == GIMPLE_OMP_SCAN. */
789 /* GIMPLE_OMP_ATOMIC_LOAD.
790 Note: This is based on gimple, not g_s_omp, because g_s_omp
791 contains a sequence, which we don't need here. */
793 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
794 gomp_atomic_load
: public gimple
796 /* [ WORD 1-6 ] : base class */
802 /* GIMPLE_OMP_ATOMIC_STORE.
803 See note on GIMPLE_OMP_ATOMIC_LOAD. */
805 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
806 gimple_statement_omp_atomic_store_layout
: public gimple
808 /* [ WORD 1-6 ] : base class */
814 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
816 public gimple_statement_omp_atomic_store_layout
818 /* No extra fields; adds invariant:
819 stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
822 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
823 gimple_statement_omp_return
:
824 public gimple_statement_omp_atomic_store_layout
826 /* No extra fields; adds invariant:
827 stmt->code == GIMPLE_OMP_RETURN. */
832 struct GTY((tag("GSS_ASSUME")))
833 gimple_statement_assume
: public gimple
835 /* [ WORD 1-6 ] : base class */
844 /* GIMPLE_TRANSACTION. */
846 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
848 /* The __transaction_atomic was declared [[outer]] or it is
849 __transaction_relaxed. */
850 #define GTMA_IS_OUTER (1u << 0)
851 #define GTMA_IS_RELAXED (1u << 1)
852 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
854 /* The transaction is seen to not have an abort. */
855 #define GTMA_HAVE_ABORT (1u << 2)
856 /* The transaction is seen to have loads or stores. */
857 #define GTMA_HAVE_LOAD (1u << 3)
858 #define GTMA_HAVE_STORE (1u << 4)
859 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
860 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
861 /* The transaction WILL enter serial irrevocable mode.
862 An irrevocable block post-dominates the entire transaction, such
863 that all invocations of the transaction will go serial-irrevocable.
864 In such case, we don't bother instrumenting the transaction, and
865 tell the runtime that it should begin the transaction in
866 serial-irrevocable mode. */
867 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
868 /* The transaction contains no instrumentation code whatsover, most
869 likely because it is guaranteed to go irrevocable upon entry. */
870 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
872 struct GTY((tag("GSS_TRANSACTION")))
873 gtransaction
: public gimple_statement_with_memory_ops_base
875 /* [ WORD 1-9 ] : base class */
886 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
887 enum gimple_statement_structure_enum
{
888 #include "gsstruct.def"
893 /* A statement with the invariant that
894 stmt->code == GIMPLE_COND
895 i.e. a conditional jump statement. */
897 struct GTY((tag("GSS_WITH_OPS")))
898 gcond
: public gimple_statement_with_ops
900 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
901 static const enum gimple_code code_
= GIMPLE_COND
;
904 /* A statement with the invariant that
905 stmt->code == GIMPLE_DEBUG
906 i.e. a debug statement. */
908 struct GTY((tag("GSS_WITH_OPS")))
909 gdebug
: public gimple_statement_with_ops
911 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
914 /* A statement with the invariant that
915 stmt->code == GIMPLE_GOTO
916 i.e. a goto statement. */
918 struct GTY((tag("GSS_WITH_OPS")))
919 ggoto
: public gimple_statement_with_ops
921 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
924 /* A statement with the invariant that
925 stmt->code == GIMPLE_LABEL
926 i.e. a label statement. */
928 struct GTY((tag("GSS_WITH_OPS")))
929 glabel
: public gimple_statement_with_ops
931 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
934 /* A statement with the invariant that
935 stmt->code == GIMPLE_SWITCH
936 i.e. a switch statement. */
938 struct GTY((tag("GSS_WITH_OPS")))
939 gswitch
: public gimple_statement_with_ops
941 /* no additional fields; this uses the layout for GSS_WITH_OPS. */
944 /* A statement with the invariant that
945 stmt->code == GIMPLE_ASSIGN
946 i.e. an assignment statement. */
948 struct GTY((tag("GSS_WITH_MEM_OPS")))
949 gassign
: public gimple_statement_with_memory_ops
951 static const enum gimple_code code_
= GIMPLE_ASSIGN
;
952 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
955 /* A statement with the invariant that
956 stmt->code == GIMPLE_RETURN
957 i.e. a return statement. */
959 struct GTY((tag("GSS_WITH_MEM_OPS")))
960 greturn
: public gimple_statement_with_memory_ops
962 /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
968 is_a_helper
<gasm
*>::test (gimple
*gs
)
970 return gs
->code
== GIMPLE_ASM
;
976 is_a_helper
<gassign
*>::test (gimple
*gs
)
978 return gs
->code
== GIMPLE_ASSIGN
;
984 is_a_helper
<const gassign
*>::test (const gimple
*gs
)
986 return gs
->code
== GIMPLE_ASSIGN
;
992 is_a_helper
<gbind
*>::test (gimple
*gs
)
994 return gs
->code
== GIMPLE_BIND
;
1000 is_a_helper
<gcall
*>::test (gimple
*gs
)
1002 return gs
->code
== GIMPLE_CALL
;
1008 is_a_helper
<gcatch
*>::test (gimple
*gs
)
1010 return gs
->code
== GIMPLE_CATCH
;
1016 is_a_helper
<gcond
*>::test (gimple
*gs
)
1018 return gs
->code
== GIMPLE_COND
;
1024 is_a_helper
<const gcond
*>::test (const gimple
*gs
)
1026 return gs
->code
== GIMPLE_COND
;
1032 is_a_helper
<gdebug
*>::test (gimple
*gs
)
1034 return gs
->code
== GIMPLE_DEBUG
;
1040 is_a_helper
<const gdebug
*>::test (const gimple
*gs
)
1042 return gs
->code
== GIMPLE_DEBUG
;
1048 is_a_helper
<ggoto
*>::test (gimple
*gs
)
1050 return gs
->code
== GIMPLE_GOTO
;
1056 is_a_helper
<const ggoto
*>::test (const gimple
*gs
)
1058 return gs
->code
== GIMPLE_GOTO
;
1064 is_a_helper
<glabel
*>::test (gimple
*gs
)
1066 return gs
->code
== GIMPLE_LABEL
;
1072 is_a_helper
<const glabel
*>::test (const gimple
*gs
)
1074 return gs
->code
== GIMPLE_LABEL
;
1080 is_a_helper
<gresx
*>::test (gimple
*gs
)
1082 return gs
->code
== GIMPLE_RESX
;
1088 is_a_helper
<geh_dispatch
*>::test (gimple
*gs
)
1090 return gs
->code
== GIMPLE_EH_DISPATCH
;
1096 is_a_helper
<geh_else
*>::test (gimple
*gs
)
1098 return gs
->code
== GIMPLE_EH_ELSE
;
1104 is_a_helper
<const geh_else
*>::test (const gimple
*gs
)
1106 return gs
->code
== GIMPLE_EH_ELSE
;
1112 is_a_helper
<geh_filter
*>::test (gimple
*gs
)
1114 return gs
->code
== GIMPLE_EH_FILTER
;
1120 is_a_helper
<geh_mnt
*>::test (gimple
*gs
)
1122 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
1128 is_a_helper
<const geh_mnt
*>::test (const gimple
*gs
)
1130 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
1136 is_a_helper
<gomp_atomic_load
*>::test (gimple
*gs
)
1138 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1144 is_a_helper
<gomp_atomic_store
*>::test (gimple
*gs
)
1146 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1152 is_a_helper
<gimple_statement_omp_return
*>::test (gimple
*gs
)
1154 return gs
->code
== GIMPLE_OMP_RETURN
;
1160 is_a_helper
<gomp_continue
*>::test (gimple
*gs
)
1162 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1168 is_a_helper
<gomp_critical
*>::test (gimple
*gs
)
1170 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1176 is_a_helper
<gomp_ordered
*>::test (gimple
*gs
)
1178 return gs
->code
== GIMPLE_OMP_ORDERED
;
1184 is_a_helper
<gomp_scan
*>::test (gimple
*gs
)
1186 return gs
->code
== GIMPLE_OMP_SCAN
;
1192 is_a_helper
<gomp_for
*>::test (gimple
*gs
)
1194 return gs
->code
== GIMPLE_OMP_FOR
;
1200 is_a_helper
<gimple_statement_omp_taskreg
*>::test (gimple
*gs
)
1202 return (gs
->code
== GIMPLE_OMP_PARALLEL
1203 || gs
->code
== GIMPLE_OMP_TASK
1204 || gs
->code
== GIMPLE_OMP_TEAMS
);
1210 is_a_helper
<gomp_parallel
*>::test (gimple
*gs
)
1212 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1218 is_a_helper
<gomp_target
*>::test (gimple
*gs
)
1220 return gs
->code
== GIMPLE_OMP_TARGET
;
1226 is_a_helper
<gomp_sections
*>::test (gimple
*gs
)
1228 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1234 is_a_helper
<gomp_single
*>::test (gimple
*gs
)
1236 return gs
->code
== GIMPLE_OMP_SINGLE
;
1242 is_a_helper
<gomp_teams
*>::test (gimple
*gs
)
1244 return gs
->code
== GIMPLE_OMP_TEAMS
;
1250 is_a_helper
<gomp_task
*>::test (gimple
*gs
)
1252 return gs
->code
== GIMPLE_OMP_TASK
;
1258 is_a_helper
<gphi
*>::test (gimple
*gs
)
1260 return gs
->code
== GIMPLE_PHI
;
1266 is_a_helper
<greturn
*>::test (gimple
*gs
)
1268 return gs
->code
== GIMPLE_RETURN
;
1274 is_a_helper
<gswitch
*>::test (gimple
*gs
)
1276 return gs
->code
== GIMPLE_SWITCH
;
1282 is_a_helper
<const gswitch
*>::test (const gimple
*gs
)
1284 return gs
->code
== GIMPLE_SWITCH
;
1290 is_a_helper
<gimple_statement_assume
*>::test (gimple
*gs
)
1292 return gs
->code
== GIMPLE_ASSUME
;
1298 is_a_helper
<gtransaction
*>::test (gimple
*gs
)
1300 return gs
->code
== GIMPLE_TRANSACTION
;
1306 is_a_helper
<gtry
*>::test (gimple
*gs
)
1308 return gs
->code
== GIMPLE_TRY
;
1314 is_a_helper
<const gtry
*>::test (const gimple
*gs
)
1316 return gs
->code
== GIMPLE_TRY
;
1322 is_a_helper
<gimple_statement_wce
*>::test (gimple
*gs
)
1324 return gs
->code
== GIMPLE_WITH_CLEANUP_EXPR
;
1330 is_a_helper
<const gasm
*>::test (const gimple
*gs
)
1332 return gs
->code
== GIMPLE_ASM
;
1338 is_a_helper
<const gbind
*>::test (const gimple
*gs
)
1340 return gs
->code
== GIMPLE_BIND
;
1346 is_a_helper
<const gcall
*>::test (const gimple
*gs
)
1348 return gs
->code
== GIMPLE_CALL
;
1354 is_a_helper
<const gcatch
*>::test (const gimple
*gs
)
1356 return gs
->code
== GIMPLE_CATCH
;
1362 is_a_helper
<const gresx
*>::test (const gimple
*gs
)
1364 return gs
->code
== GIMPLE_RESX
;
1370 is_a_helper
<const geh_dispatch
*>::test (const gimple
*gs
)
1372 return gs
->code
== GIMPLE_EH_DISPATCH
;
1378 is_a_helper
<const geh_filter
*>::test (const gimple
*gs
)
1380 return gs
->code
== GIMPLE_EH_FILTER
;
1386 is_a_helper
<const gomp_atomic_load
*>::test (const gimple
*gs
)
1388 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1394 is_a_helper
<const gomp_atomic_store
*>::test (const gimple
*gs
)
1396 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1402 is_a_helper
<const gimple_statement_omp_return
*>::test (const gimple
*gs
)
1404 return gs
->code
== GIMPLE_OMP_RETURN
;
1410 is_a_helper
<const gomp_continue
*>::test (const gimple
*gs
)
1412 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1418 is_a_helper
<const gomp_critical
*>::test (const gimple
*gs
)
1420 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1426 is_a_helper
<const gomp_ordered
*>::test (const gimple
*gs
)
1428 return gs
->code
== GIMPLE_OMP_ORDERED
;
1434 is_a_helper
<const gomp_scan
*>::test (const gimple
*gs
)
1436 return gs
->code
== GIMPLE_OMP_SCAN
;
1442 is_a_helper
<const gomp_for
*>::test (const gimple
*gs
)
1444 return gs
->code
== GIMPLE_OMP_FOR
;
1450 is_a_helper
<const gimple_statement_omp_taskreg
*>::test (const gimple
*gs
)
1452 return (gs
->code
== GIMPLE_OMP_PARALLEL
1453 || gs
->code
== GIMPLE_OMP_TASK
1454 || gs
->code
== GIMPLE_OMP_TEAMS
);
1460 is_a_helper
<const gomp_parallel
*>::test (const gimple
*gs
)
1462 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1468 is_a_helper
<const gomp_target
*>::test (const gimple
*gs
)
1470 return gs
->code
== GIMPLE_OMP_TARGET
;
1476 is_a_helper
<const gomp_sections
*>::test (const gimple
*gs
)
1478 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1484 is_a_helper
<const gomp_single
*>::test (const gimple
*gs
)
1486 return gs
->code
== GIMPLE_OMP_SINGLE
;
1492 is_a_helper
<const gomp_teams
*>::test (const gimple
*gs
)
1494 return gs
->code
== GIMPLE_OMP_TEAMS
;
1500 is_a_helper
<const gomp_task
*>::test (const gimple
*gs
)
1502 return gs
->code
== GIMPLE_OMP_TASK
;
1508 is_a_helper
<const gphi
*>::test (const gimple
*gs
)
1510 return gs
->code
== GIMPLE_PHI
;
1516 is_a_helper
<const greturn
*>::test (const gimple
*gs
)
1518 return gs
->code
== GIMPLE_RETURN
;
1524 is_a_helper
<const gimple_statement_assume
*>::test (const gimple
*gs
)
1526 return gs
->code
== GIMPLE_ASSUME
;
1532 is_a_helper
<const gtransaction
*>::test (const gimple
*gs
)
1534 return gs
->code
== GIMPLE_TRANSACTION
;
1537 /* Offset in bytes to the location of the operand vector.
1538 Zero if there is no operand vector for this tuple structure. */
1539 extern size_t const gimple_ops_offset_
[];
1541 /* Map GIMPLE codes to GSS codes. */
1542 extern enum gimple_statement_structure_enum
const gss_for_code_
[];
1544 /* This variable holds the currently expanded gimple statement for purposes
1545 of comminucating the profile info to the builtin expanders. */
1546 extern gimple
*currently_expanding_gimple_stmt
;
1548 size_t gimple_size (enum gimple_code code
, unsigned num_ops
= 0);
1549 void gimple_init (gimple
*g
, enum gimple_code code
, unsigned num_ops
);
1550 gimple
*gimple_alloc (enum gimple_code
, unsigned CXX_MEM_STAT_INFO
);
1551 greturn
*gimple_build_return (tree
);
1552 void gimple_call_reset_alias_info (gcall
*);
1553 gcall
*gimple_build_call_vec (tree
, const vec
<tree
> &);
1554 gcall
*gimple_build_call (tree
, unsigned, ...);
1555 gcall
*gimple_build_call_valist (tree
, unsigned, va_list);
1556 gcall
*gimple_build_call_internal (enum internal_fn
, unsigned, ...);
1557 gcall
*gimple_build_call_internal_vec (enum internal_fn
, const vec
<tree
> &);
1558 gcall
*gimple_build_call_from_tree (tree
, tree
);
1559 gassign
*gimple_build_assign (tree
, tree CXX_MEM_STAT_INFO
);
1560 gassign
*gimple_build_assign (tree
, enum tree_code
,
1561 tree
, tree
, tree CXX_MEM_STAT_INFO
);
1562 gassign
*gimple_build_assign (tree
, enum tree_code
,
1563 tree
, tree CXX_MEM_STAT_INFO
);
1564 gassign
*gimple_build_assign (tree
, enum tree_code
, tree CXX_MEM_STAT_INFO
);
1565 gcond
*gimple_build_cond (enum tree_code
, tree
, tree
, tree
, tree
);
1566 gcond
*gimple_build_cond_from_tree (tree
, tree
, tree
);
1567 void gimple_cond_set_condition_from_tree (gcond
*, tree
);
1568 glabel
*gimple_build_label (tree label
);
1569 ggoto
*gimple_build_goto (tree dest
);
1570 gimple
*gimple_build_nop (void);
1571 gbind
*gimple_build_bind (tree
, gimple_seq
, tree
);
1572 gasm
*gimple_build_asm_vec (const char *, vec
<tree
, va_gc
> *,
1573 vec
<tree
, va_gc
> *, vec
<tree
, va_gc
> *,
1574 vec
<tree
, va_gc
> *);
1575 gcatch
*gimple_build_catch (tree
, gimple_seq
);
1576 geh_filter
*gimple_build_eh_filter (tree
, gimple_seq
);
1577 geh_mnt
*gimple_build_eh_must_not_throw (tree
);
1578 geh_else
*gimple_build_eh_else (gimple_seq
, gimple_seq
);
1579 gtry
*gimple_build_try (gimple_seq
, gimple_seq
,
1580 enum gimple_try_flags
);
1581 gimple
*gimple_build_wce (gimple_seq
);
1582 gresx
*gimple_build_resx (int);
1583 gswitch
*gimple_build_switch_nlabels (unsigned, tree
, tree
);
1584 gswitch
*gimple_build_switch (tree
, tree
, const vec
<tree
> &);
1585 geh_dispatch
*gimple_build_eh_dispatch (int);
1586 gdebug
*gimple_build_debug_bind (tree
, tree
, gimple
* CXX_MEM_STAT_INFO
);
1587 gdebug
*gimple_build_debug_source_bind (tree
, tree
, gimple
* CXX_MEM_STAT_INFO
);
1588 gdebug
*gimple_build_debug_begin_stmt (tree
, location_t CXX_MEM_STAT_INFO
);
1589 gdebug
*gimple_build_debug_inline_entry (tree
, location_t CXX_MEM_STAT_INFO
);
1590 gomp_critical
*gimple_build_omp_critical (gimple_seq
, tree
, tree
);
1591 gomp_for
*gimple_build_omp_for (gimple_seq
, int, tree
, size_t, gimple_seq
);
1592 gomp_parallel
*gimple_build_omp_parallel (gimple_seq
, tree
, tree
, tree
);
1593 gomp_task
*gimple_build_omp_task (gimple_seq
, tree
, tree
, tree
, tree
,
1595 gimple
*gimple_build_omp_section (gimple_seq
);
1596 gimple
*gimple_build_omp_structured_block (gimple_seq
);
1597 gimple
*gimple_build_omp_scope (gimple_seq
, tree
);
1598 gimple
*gimple_build_omp_dispatch (gimple_seq
, tree
);
1599 gimple
*gimple_build_omp_interop (tree
);
1600 gimple
*gimple_build_omp_master (gimple_seq
);
1601 gimple
*gimple_build_omp_masked (gimple_seq
, tree
);
1602 gimple
*gimple_build_omp_taskgroup (gimple_seq
, tree
);
1603 gomp_continue
*gimple_build_omp_continue (tree
, tree
);
1604 gomp_ordered
*gimple_build_omp_ordered (gimple_seq
, tree
);
1605 gimple
*gimple_build_omp_return (bool);
1606 gomp_scan
*gimple_build_omp_scan (gimple_seq
, tree
);
1607 gomp_sections
*gimple_build_omp_sections (gimple_seq
, tree
);
1608 gimple
*gimple_build_omp_sections_switch (void);
1609 gomp_single
*gimple_build_omp_single (gimple_seq
, tree
);
1610 gomp_target
*gimple_build_omp_target (gimple_seq
, int, tree
);
1611 gomp_teams
*gimple_build_omp_teams (gimple_seq
, tree
);
1612 gomp_atomic_load
*gimple_build_omp_atomic_load (tree
, tree
,
1613 enum omp_memory_order
);
1614 gomp_atomic_store
*gimple_build_omp_atomic_store (tree
, enum omp_memory_order
);
1615 gimple
*gimple_build_assume (tree
, gimple_seq
);
1616 gtransaction
*gimple_build_transaction (gimple_seq
);
1617 extern void gimple_seq_add_stmt (gimple_seq
*, gimple
*);
1618 extern void gimple_seq_add_stmt_without_update (gimple_seq
*, gimple
*);
1619 void gimple_seq_add_seq (gimple_seq
*, gimple_seq
);
1620 void gimple_seq_add_seq_without_update (gimple_seq
*, gimple_seq
);
1621 extern void annotate_all_with_location_after (gimple_seq
, gimple_stmt_iterator
,
1623 extern void annotate_all_with_location (gimple_seq
, location_t
);
1624 bool empty_body_p (gimple_seq
);
1625 gimple_seq
gimple_seq_copy (gimple_seq
);
1626 bool gimple_call_same_target_p (const gimple
*, const gimple
*);
1627 int gimple_call_flags (const gimple
*);
1628 int gimple_call_arg_flags (const gcall
*, unsigned);
1629 int gimple_call_retslot_flags (const gcall
*);
1630 int gimple_call_static_chain_flags (const gcall
*);
1631 int gimple_call_return_flags (const gcall
*);
1632 bool gimple_call_nonnull_result_p (gcall
*);
1633 tree
gimple_call_nonnull_arg (gcall
*);
1634 bool gimple_assign_copy_p (gimple
*);
1635 bool gimple_assign_ssa_name_copy_p (gimple
*);
1636 bool gimple_assign_unary_nop_p (gimple
*);
1637 bool gimple_assign_load_p (const gimple
*);
1638 void gimple_set_bb (gimple
*, basic_block
);
1639 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator
*, tree
);
1640 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*, enum tree_code
,
1642 tree
gimple_get_lhs (const gimple
*);
1643 void gimple_set_lhs (gimple
*, tree
);
1644 gimple
*gimple_copy (gimple
*);
1645 void gimple_move_vops (gimple
*, gimple
*);
1646 bool gimple_has_side_effects (const gimple
*);
1647 bool gimple_could_trap_p_1 (const gimple
*, bool, bool);
1648 bool gimple_could_trap_p (const gimple
*);
1649 bool gimple_assign_rhs_could_trap_p (gimple
*);
1650 extern void dump_gimple_statistics (void);
1651 unsigned get_gimple_rhs_num_ops (enum tree_code
);
1652 gcall
*gimple_call_copy_skip_args (gcall
*, bitmap
);
1653 extern bool gimple_compare_field_offset (tree
, tree
);
1654 extern tree
gimple_unsigned_type (tree
);
1655 extern tree
gimple_signed_type (tree
);
1656 extern alias_set_type
gimple_get_alias_set (tree
);
1657 extern bool gimple_ior_addresses_taken (bitmap
, gimple
*);
1658 extern bool gimple_builtin_call_types_compatible_p (const gimple
*, tree
);
1659 extern combined_fn
gimple_call_combined_fn (const gimple
*);
1660 extern bool gimple_call_operator_delete_p (const gcall
*);
1661 extern bool gimple_call_builtin_p (const gimple
*);
1662 extern bool gimple_call_builtin_p (const gimple
*, enum built_in_class
);
1663 extern bool gimple_call_builtin_p (const gimple
*, enum built_in_function
);
1664 extern bool gimple_asm_clobbers_memory_p (const gasm
*);
1665 extern void dump_decl_set (FILE *, bitmap
);
1666 extern bool nonfreeing_call_p (gimple
*);
1667 extern bool nonbarrier_call_p (gimple
*);
1668 extern bool infer_nonnull_range (gimple
*, tree
);
1669 extern bool infer_nonnull_range_by_dereference (gimple
*, tree
);
1670 extern bool infer_nonnull_range_by_attribute (gimple
*, tree
, tree
* = NULL
,
1672 extern void sort_case_labels (vec
<tree
> &);
1673 extern void preprocess_case_label_vec_for_gimple (vec
<tree
> &, tree
, tree
*);
1674 extern void gimple_seq_set_location (gimple_seq
, location_t
);
1675 extern void gimple_seq_discard (gimple_seq
);
1676 extern void maybe_remove_unused_call_args (struct function
*, gimple
*);
1677 extern bool gimple_inexpensive_call_p (gcall
*);
1678 extern bool stmt_can_terminate_bb_p (gimple
*);
1679 extern location_t
gimple_or_expr_nonartificial_location (gimple
*, tree
);
1680 gcall
*gimple_build_builtin_unreachable (location_t
);
1682 /* Return the disposition for a warning (or all warnings by default)
1684 extern bool warning_suppressed_p (const gimple
*, opt_code
= all_warnings
)
1685 ATTRIBUTE_NONNULL (1);
1686 /* Set the disposition for a warning (or all warnings by default)
1687 at a location to enabled by default. */
1688 extern void suppress_warning (gimple
*, opt_code
= all_warnings
,
1689 bool = true) ATTRIBUTE_NONNULL (1);
1691 /* Copy the warning disposition mapping from one statement to another. */
1692 extern void copy_warning (gimple
*, const gimple
*)
1693 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1694 /* Copy the warning disposition mapping from an expression to a statement. */
1695 extern void copy_warning (gimple
*, const_tree
)
1696 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1697 /* Copy the warning disposition mapping from a statement to an expression. */
1698 extern void copy_warning (tree
, const gimple
*)
1699 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1701 /* Formal (expression) temporary table handling: multiple occurrences of
1702 the same scalar expression are evaluated into the same temporary. */
1704 typedef struct gimple_temp_hash_elt
1707 tree temp
; /* Value */
1710 /* Get the number of the next statement uid to be allocated. */
1712 gimple_stmt_max_uid (struct function
*fn
)
1714 return fn
->last_stmt_uid
;
1717 /* Set the number of the next statement uid to be allocated. */
1719 set_gimple_stmt_max_uid (struct function
*fn
, unsigned int maxid
)
1721 fn
->last_stmt_uid
= maxid
;
1724 /* Set the number of the next statement uid to be allocated. */
1726 inc_gimple_stmt_max_uid (struct function
*fn
)
1728 return fn
->last_stmt_uid
++;
1731 /* Return the first node in GIMPLE sequence S. */
1733 inline gimple_seq_node
1734 gimple_seq_first (gimple_seq s
)
1740 /* Return the first statement in GIMPLE sequence S. */
1743 gimple_seq_first_stmt (gimple_seq s
)
1745 gimple_seq_node n
= gimple_seq_first (s
);
1749 /* Return the first statement in GIMPLE sequence S as a gbind *,
1750 verifying that it has code GIMPLE_BIND in a checked build. */
1753 gimple_seq_first_stmt_as_a_bind (gimple_seq s
)
1755 gimple_seq_node n
= gimple_seq_first (s
);
1756 return as_a
<gbind
*> (n
);
1760 /* Return the last node in GIMPLE sequence S. */
1762 inline gimple_seq_node
1763 gimple_seq_last (gimple_seq s
)
1765 return s
? s
->prev
: NULL
;
1769 /* Return the last statement in GIMPLE sequence S. */
1772 gimple_seq_last_stmt (gimple_seq s
)
1774 gimple_seq_node n
= gimple_seq_last (s
);
1779 /* Set the last node in GIMPLE sequence *PS to LAST. */
1782 gimple_seq_set_last (gimple_seq
*ps
, gimple_seq_node last
)
1788 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1791 gimple_seq_set_first (gimple_seq
*ps
, gimple_seq_node first
)
1797 /* Return true if GIMPLE sequence S is empty. */
1800 gimple_seq_empty_p (gimple_seq s
)
1805 /* Allocate a new sequence and initialize its first element with STMT. */
1808 gimple_seq_alloc_with_stmt (gimple
*stmt
)
1810 gimple_seq seq
= NULL
;
1811 gimple_seq_add_stmt (&seq
, stmt
);
1816 /* Returns the sequence of statements in BB. */
1819 bb_seq (const_basic_block bb
)
1821 return (!(bb
->flags
& BB_RTL
)) ? bb
->il
.gimple
.seq
: NULL
;
1825 bb_seq_addr (basic_block bb
)
1827 return (!(bb
->flags
& BB_RTL
)) ? &bb
->il
.gimple
.seq
: NULL
;
1830 /* Sets the sequence of statements in BB to SEQ. */
1833 set_bb_seq (basic_block bb
, gimple_seq seq
)
1835 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
1836 bb
->il
.gimple
.seq
= seq
;
1840 /* Return the code for GIMPLE statement G. */
1842 inline enum gimple_code
1843 gimple_code (const gimple
*g
)
1849 /* Return the GSS code used by a GIMPLE code. */
1851 inline enum gimple_statement_structure_enum
1852 gss_for_code (enum gimple_code code
)
1854 gcc_gimple_checking_assert ((unsigned int)code
< LAST_AND_UNUSED_GIMPLE_CODE
);
1855 return gss_for_code_
[code
];
1859 /* Return which GSS code is used by GS. */
1861 inline enum gimple_statement_structure_enum
1862 gimple_statement_structure (gimple
*gs
)
1864 return gss_for_code (gimple_code (gs
));
1868 /* Return true if statement G has sub-statements. This is only true for
1869 High GIMPLE statements. */
1872 gimple_has_substatements (gimple
*g
)
1874 switch (gimple_code (g
))
1879 case GIMPLE_EH_FILTER
:
1880 case GIMPLE_EH_ELSE
:
1882 case GIMPLE_OMP_FOR
:
1883 case GIMPLE_OMP_MASTER
:
1884 case GIMPLE_OMP_MASKED
:
1885 case GIMPLE_OMP_TASKGROUP
:
1886 case GIMPLE_OMP_ORDERED
:
1887 case GIMPLE_OMP_SECTION
:
1888 case GIMPLE_OMP_STRUCTURED_BLOCK
:
1889 case GIMPLE_OMP_PARALLEL
:
1890 case GIMPLE_OMP_TASK
:
1891 case GIMPLE_OMP_SCOPE
:
1892 case GIMPLE_OMP_DISPATCH
:
1893 case GIMPLE_OMP_SECTIONS
:
1894 case GIMPLE_OMP_SINGLE
:
1895 case GIMPLE_OMP_TARGET
:
1896 case GIMPLE_OMP_TEAMS
:
1897 case GIMPLE_OMP_CRITICAL
:
1898 case GIMPLE_WITH_CLEANUP_EXPR
:
1899 case GIMPLE_TRANSACTION
:
1908 /* Return the basic block holding statement G. */
1911 gimple_bb (const gimple
*g
)
1917 /* Return the lexical scope block holding statement G. */
1920 gimple_block (const gimple
*g
)
1922 return LOCATION_BLOCK (g
->location
);
1925 /* Forward declare. */
1926 inline void gimple_set_location (gimple
*, location_t
);
1928 /* Set BLOCK to be the lexical scope block holding statement G. */
1931 gimple_set_block (gimple
*g
, tree block
)
1933 gimple_set_location (g
, set_block (g
->location
, block
));
1936 /* Return location information for statement G. */
1939 gimple_location (const gimple
*g
)
1944 /* Return location information for statement G if g is not NULL.
1945 Otherwise, UNKNOWN_LOCATION is returned. */
1948 gimple_location_safe (const gimple
*g
)
1950 return g
? gimple_location (g
) : UNKNOWN_LOCATION
;
1953 /* Set location information for statement G. */
1956 gimple_set_location (gimple
*g
, location_t location
)
1958 /* Copy the no-warning data to the statement location. */
1959 if (g
->location
!= UNKNOWN_LOCATION
)
1960 copy_warning (location
, g
->location
);
1961 g
->location
= location
;
1964 /* Return address of the location information for statement G. */
1967 gimple_location_ptr (gimple
*g
)
1969 return &g
->location
;
1973 /* Return true if G contains location information. */
1976 gimple_has_location (const gimple
*g
)
1978 return LOCATION_LOCUS (gimple_location (g
)) != UNKNOWN_LOCATION
;
1982 /* Return non-artificial location information for statement G. */
1985 gimple_nonartificial_location (const gimple
*g
)
1987 location_t
*ploc
= NULL
;
1989 if (tree block
= gimple_block (g
))
1990 ploc
= block_nonartificial_location (block
);
1992 return ploc
? *ploc
: gimple_location (g
);
1996 /* Return the file name of the location of STMT. */
1999 gimple_filename (const gimple
*stmt
)
2001 return LOCATION_FILE (gimple_location (stmt
));
2005 /* Return the line number of the location of STMT. */
2008 gimple_lineno (const gimple
*stmt
)
2010 return LOCATION_LINE (gimple_location (stmt
));
2014 /* Determine whether SEQ is a singleton. */
2017 gimple_seq_singleton_p (gimple_seq seq
)
2019 return ((gimple_seq_first (seq
) != NULL
)
2020 && (gimple_seq_first (seq
) == gimple_seq_last (seq
)));
2023 /* Return true if no warnings should be emitted for statement STMT. */
2026 gimple_no_warning_p (const gimple
*stmt
)
2028 return stmt
->no_warning
;
2031 /* Set the no_warning flag of STMT to NO_WARNING. */
2034 gimple_set_no_warning (gimple
*stmt
, bool no_warning
)
2036 stmt
->no_warning
= (unsigned) no_warning
;
2039 /* Set the visited status on statement STMT to VISITED_P.
2041 Please note that this 'visited' property of the gimple statement is
2042 supposed to be undefined at pass boundaries. This means that a
2043 given pass should not assume it contains any useful value when the
2044 pass starts and thus can set it to any value it sees fit.
2046 You can learn more about the visited property of the gimple
2047 statement by reading the comments of the 'visited' data member of
2052 gimple_set_visited (gimple
*stmt
, bool visited_p
)
2054 stmt
->visited
= (unsigned) visited_p
;
2058 /* Return the visited status for statement STMT.
2060 Please note that this 'visited' property of the gimple statement is
2061 supposed to be undefined at pass boundaries. This means that a
2062 given pass should not assume it contains any useful value when the
2063 pass starts and thus can set it to any value it sees fit.
2065 You can learn more about the visited property of the gimple
2066 statement by reading the comments of the 'visited' data member of
2070 gimple_visited_p (gimple
*stmt
)
2072 return stmt
->visited
;
2076 /* Set pass local flag PLF on statement STMT to VAL_P.
2078 Please note that this PLF property of the gimple statement is
2079 supposed to be undefined at pass boundaries. This means that a
2080 given pass should not assume it contains any useful value when the
2081 pass starts and thus can set it to any value it sees fit.
2083 You can learn more about the PLF property by reading the comment of
2084 the 'plf' data member of struct gimple_statement_structure. */
2087 gimple_set_plf (gimple
*stmt
, enum plf_mask plf
, bool val_p
)
2090 stmt
->plf
|= (unsigned int) plf
;
2092 stmt
->plf
&= ~((unsigned int) plf
);
2096 /* Return the value of pass local flag PLF on statement STMT.
2098 Please note that this 'plf' property of the gimple statement is
2099 supposed to be undefined at pass boundaries. This means that a
2100 given pass should not assume it contains any useful value when the
2101 pass starts and thus can set it to any value it sees fit.
2103 You can learn more about the plf property by reading the comment of
2104 the 'plf' data member of struct gimple_statement_structure. */
2107 gimple_plf (gimple
*stmt
, enum plf_mask plf
)
2109 return stmt
->plf
& ((unsigned int) plf
);
2113 /* Set the UID of statement.
2115 Please note that this UID property is supposed to be undefined at
2116 pass boundaries. This means that a given pass should not assume it
2117 contains any useful value when the pass starts and thus can set it
2118 to any value it sees fit. */
2121 gimple_set_uid (gimple
*g
, unsigned uid
)
2127 /* Return the UID of statement.
2129 Please note that this UID property is supposed to be undefined at
2130 pass boundaries. This means that a given pass should not assume it
2131 contains any useful value when the pass starts and thus can set it
2132 to any value it sees fit. */
2135 gimple_uid (const gimple
*g
)
2141 /* Make statement G a singleton sequence. */
2144 gimple_init_singleton (gimple
*g
)
2151 /* Return true if GIMPLE statement G has register or memory operands. */
2154 gimple_has_ops (const gimple
*g
)
2156 return gimple_code (g
) >= GIMPLE_COND
&& gimple_code (g
) <= GIMPLE_RETURN
;
2162 is_a_helper
<const gimple_statement_with_ops
*>::test (const gimple
*gs
)
2164 return gimple_has_ops (gs
);
2170 is_a_helper
<gimple_statement_with_ops
*>::test (gimple
*gs
)
2172 return gimple_has_ops (gs
);
2175 /* Return true if GIMPLE statement G has memory operands. */
2178 gimple_has_mem_ops (const gimple
*g
)
2180 return gimple_code (g
) >= GIMPLE_ASSIGN
&& gimple_code (g
) <= GIMPLE_RETURN
;
2186 is_a_helper
<const gimple_statement_with_memory_ops
*>::test (const gimple
*gs
)
2188 return gimple_has_mem_ops (gs
);
2194 is_a_helper
<gimple_statement_with_memory_ops
*>::test (gimple
*gs
)
2196 return gimple_has_mem_ops (gs
);
2199 /* Return the set of USE operands for statement G. */
2201 inline struct use_optype_d
*
2202 gimple_use_ops (const gimple
*g
)
2204 const gimple_statement_with_ops
*ops_stmt
=
2205 dyn_cast
<const gimple_statement_with_ops
*> (g
);
2208 return ops_stmt
->use_ops
;
2212 /* Set USE to be the set of USE operands for statement G. */
2215 gimple_set_use_ops (gimple
*g
, struct use_optype_d
*use
)
2217 gimple_statement_with_ops
*ops_stmt
=
2218 as_a
<gimple_statement_with_ops
*> (g
);
2219 ops_stmt
->use_ops
= use
;
2223 /* Return the single VUSE operand of the statement G. */
2226 gimple_vuse (const gimple
*g
)
2228 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
2229 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
2232 return mem_ops_stmt
->vuse
;
2235 /* Return the single VDEF operand of the statement G. */
2238 gimple_vdef (const gimple
*g
)
2240 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
2241 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
2244 return mem_ops_stmt
->vdef
;
2247 /* Return the single VUSE operand of the statement G. */
2250 gimple_vuse_ptr (gimple
*g
)
2252 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2253 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
2256 return &mem_ops_stmt
->vuse
;
2259 /* Return the single VDEF operand of the statement G. */
2262 gimple_vdef_ptr (gimple
*g
)
2264 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2265 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
2268 return &mem_ops_stmt
->vdef
;
2271 /* Set the single VUSE operand of the statement G. */
2274 gimple_set_vuse (gimple
*g
, tree vuse
)
2276 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2277 as_a
<gimple_statement_with_memory_ops
*> (g
);
2278 mem_ops_stmt
->vuse
= vuse
;
2281 /* Set the single VDEF operand of the statement G. */
2284 gimple_set_vdef (gimple
*g
, tree vdef
)
2286 gimple_statement_with_memory_ops
*mem_ops_stmt
=
2287 as_a
<gimple_statement_with_memory_ops
*> (g
);
2288 mem_ops_stmt
->vdef
= vdef
;
2292 /* Return true if statement G has operands and the modified field has
2296 gimple_modified_p (const gimple
*g
)
2298 return (gimple_has_ops (g
)) ? (bool) g
->modified
: false;
2302 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
2303 a MODIFIED field. */
2306 gimple_set_modified (gimple
*s
, bool modifiedp
)
2308 if (gimple_has_ops (s
))
2309 s
->modified
= (unsigned) modifiedp
;
2313 /* Return true if statement STMT contains volatile operands. */
2316 gimple_has_volatile_ops (const gimple
*stmt
)
2318 if (gimple_has_mem_ops (stmt
))
2319 return stmt
->has_volatile_ops
;
2325 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
2328 gimple_set_has_volatile_ops (gimple
*stmt
, bool volatilep
)
2330 if (gimple_has_mem_ops (stmt
))
2331 stmt
->has_volatile_ops
= (unsigned) volatilep
;
2334 /* Return true if STMT is in a transaction. */
2337 gimple_in_transaction (const gimple
*stmt
)
2339 return bb_in_transaction (gimple_bb (stmt
));
2342 /* Return true if statement STMT may access memory. */
2345 gimple_references_memory_p (gimple
*stmt
)
2347 return gimple_has_mem_ops (stmt
) && gimple_vuse (stmt
);
2351 /* Return the subcode for OMP statement S. */
2354 gimple_omp_subcode (const gimple
*s
)
2356 gcc_gimple_checking_assert (gimple_code (s
) >= GIMPLE_OMP_ATOMIC_LOAD
2357 && gimple_code (s
) <= GIMPLE_OMP_ORDERED
);
2361 /* Set the subcode for OMP statement S to SUBCODE. */
2364 gimple_omp_set_subcode (gimple
*s
, unsigned int subcode
)
2366 /* We only have 16 bits for the subcode. Assert that we are not
2368 gcc_gimple_checking_assert (subcode
< (1 << 16));
2369 s
->subcode
= subcode
;
2372 /* Set the nowait flag on OMP_RETURN statement S. */
2375 gimple_omp_return_set_nowait (gimple
*s
)
2377 GIMPLE_CHECK (s
, GIMPLE_OMP_RETURN
);
2378 s
->subcode
|= GF_OMP_RETURN_NOWAIT
;
2382 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
2386 gimple_omp_return_nowait_p (const gimple
*g
)
2388 GIMPLE_CHECK (g
, GIMPLE_OMP_RETURN
);
2389 return (gimple_omp_subcode (g
) & GF_OMP_RETURN_NOWAIT
) != 0;
2393 /* Set the LHS of OMP return. */
2396 gimple_omp_return_set_lhs (gimple
*g
, tree lhs
)
2398 gimple_statement_omp_return
*omp_return_stmt
=
2399 as_a
<gimple_statement_omp_return
*> (g
);
2400 omp_return_stmt
->val
= lhs
;
2404 /* Get the LHS of OMP return. */
2407 gimple_omp_return_lhs (const gimple
*g
)
2409 const gimple_statement_omp_return
*omp_return_stmt
=
2410 as_a
<const gimple_statement_omp_return
*> (g
);
2411 return omp_return_stmt
->val
;
2415 /* Return a pointer to the LHS of OMP return. */
2418 gimple_omp_return_lhs_ptr (gimple
*g
)
2420 gimple_statement_omp_return
*omp_return_stmt
=
2421 as_a
<gimple_statement_omp_return
*> (g
);
2422 return &omp_return_stmt
->val
;
2426 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
2430 gimple_omp_section_last_p (const gimple
*g
)
2432 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2433 return (gimple_omp_subcode (g
) & GF_OMP_SECTION_LAST
) != 0;
2437 /* Set the GF_OMP_SECTION_LAST flag on G. */
2440 gimple_omp_section_set_last (gimple
*g
)
2442 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2443 g
->subcode
|= GF_OMP_SECTION_LAST
;
2447 /* Return true if OMP ordered construct is stand-alone
2448 (G has the GF_OMP_ORDERED_STANDALONE flag set). */
2451 gimple_omp_ordered_standalone_p (const gimple
*g
)
2453 GIMPLE_CHECK (g
, GIMPLE_OMP_ORDERED
);
2454 return (gimple_omp_subcode (g
) & GF_OMP_ORDERED_STANDALONE
) != 0;
2458 /* Set the GF_OMP_ORDERED_STANDALONE flag on G. */
2461 gimple_omp_ordered_standalone (gimple
*g
)
2463 GIMPLE_CHECK (g
, GIMPLE_OMP_ORDERED
);
2464 g
->subcode
|= GF_OMP_ORDERED_STANDALONE
;
2468 /* Return true if OMP parallel statement G has the
2469 GF_OMP_PARALLEL_COMBINED flag set. */
2472 gimple_omp_parallel_combined_p (const gimple
*g
)
2474 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2475 return (gimple_omp_subcode (g
) & GF_OMP_PARALLEL_COMBINED
) != 0;
2479 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2480 value of COMBINED_P. */
2483 gimple_omp_parallel_set_combined_p (gimple
*g
, bool combined_p
)
2485 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2487 g
->subcode
|= GF_OMP_PARALLEL_COMBINED
;
2489 g
->subcode
&= ~GF_OMP_PARALLEL_COMBINED
;
2493 /* Return true if OMP atomic load/store statement G has the
2494 GF_OMP_ATOMIC_NEED_VALUE flag set. */
2497 gimple_omp_atomic_need_value_p (const gimple
*g
)
2499 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2500 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2501 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_NEED_VALUE
) != 0;
2505 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2508 gimple_omp_atomic_set_need_value (gimple
*g
)
2510 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2511 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2512 g
->subcode
|= GF_OMP_ATOMIC_NEED_VALUE
;
2516 /* Return true if OMP atomic load/store statement G has the
2517 GF_OMP_ATOMIC_WEAK flag set. */
2520 gimple_omp_atomic_weak_p (const gimple
*g
)
2522 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2523 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2524 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_WEAK
) != 0;
2528 /* Set the GF_OMP_ATOMIC_WEAK flag on G. */
2531 gimple_omp_atomic_set_weak (gimple
*g
)
2533 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2534 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2535 g
->subcode
|= GF_OMP_ATOMIC_WEAK
;
2539 /* Return the memory order of the OMP atomic load/store statement G. */
2541 inline enum omp_memory_order
2542 gimple_omp_atomic_memory_order (const gimple
*g
)
2544 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2545 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2546 return (enum omp_memory_order
)
2547 (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_MEMORY_ORDER
);
2551 /* Set the memory order on G. */
2554 gimple_omp_atomic_set_memory_order (gimple
*g
, enum omp_memory_order mo
)
2556 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2557 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2558 g
->subcode
= ((g
->subcode
& ~GF_OMP_ATOMIC_MEMORY_ORDER
)
2559 | (mo
& GF_OMP_ATOMIC_MEMORY_ORDER
));
2563 /* Return the number of operands for statement GS. */
2566 gimple_num_ops (const gimple
*gs
)
2572 /* Set the number of operands for statement GS. */
2575 gimple_set_num_ops (gimple
*gs
, unsigned num_ops
)
2577 gs
->num_ops
= num_ops
;
2581 /* Return the array of operands for statement GS. */
2584 gimple_ops (gimple
*gs
)
2588 /* All the tuples have their operand vector at the very bottom
2589 of the structure. Note that those structures that do not
2590 have an operand vector have a zero offset. */
2591 off
= gimple_ops_offset_
[gimple_statement_structure (gs
)];
2592 gcc_gimple_checking_assert (off
!= 0);
2594 return (tree
*) ((char *) gs
+ off
);
2598 /* Return operand I for statement GS. */
2601 gimple_op (const gimple
*gs
, unsigned i
)
2603 if (gimple_has_ops (gs
))
2605 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2606 return gimple_ops (CONST_CAST_GIMPLE (gs
))[i
];
2612 /* Return a pointer to operand I for statement GS. */
2615 gimple_op_ptr (gimple
*gs
, unsigned i
)
2617 if (gimple_has_ops (gs
))
2619 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2620 return gimple_ops (gs
) + i
;
2626 /* Set operand I of statement GS to OP. */
2629 gimple_set_op (gimple
*gs
, unsigned i
, tree op
)
2631 gcc_gimple_checking_assert (gimple_has_ops (gs
) && i
< gimple_num_ops (gs
));
2633 /* Note. It may be tempting to assert that OP matches
2634 is_gimple_operand, but that would be wrong. Different tuples
2635 accept slightly different sets of tree operands. Each caller
2636 should perform its own validation. */
2637 gimple_ops (gs
)[i
] = op
;
2640 /* Return true if GS is a GIMPLE_ASSIGN. */
2643 is_gimple_assign (const gimple
*gs
)
2645 return gimple_code (gs
) == GIMPLE_ASSIGN
;
2648 /* Determine if expression CODE is one of the valid expressions that can
2649 be used on the RHS of GIMPLE assignments. */
2651 inline enum gimple_rhs_class
2652 get_gimple_rhs_class (enum tree_code code
)
2654 return (enum gimple_rhs_class
) gimple_rhs_class_table
[(int) code
];
2657 /* Return the LHS of assignment statement GS. */
2660 gimple_assign_lhs (const gassign
*gs
)
2666 gimple_assign_lhs (const gimple
*gs
)
2668 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2669 return gimple_assign_lhs (ass
);
2673 /* Return a pointer to the LHS of assignment statement GS. */
2676 gimple_assign_lhs_ptr (gassign
*gs
)
2682 gimple_assign_lhs_ptr (gimple
*gs
)
2684 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2685 return gimple_assign_lhs_ptr (ass
);
2689 /* Set LHS to be the LHS operand of assignment statement GS. */
2692 gimple_assign_set_lhs (gassign
*gs
, tree lhs
)
2696 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2697 SSA_NAME_DEF_STMT (lhs
) = gs
;
2701 gimple_assign_set_lhs (gimple
*gs
, tree lhs
)
2703 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2704 gimple_assign_set_lhs (ass
, lhs
);
2708 /* Return the first operand on the RHS of assignment statement GS. */
2711 gimple_assign_rhs1 (const gassign
*gs
)
2717 gimple_assign_rhs1 (const gimple
*gs
)
2719 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2720 return gimple_assign_rhs1 (ass
);
2724 /* Return a pointer to the first operand on the RHS of assignment
2728 gimple_assign_rhs1_ptr (gassign
*gs
)
2734 gimple_assign_rhs1_ptr (gimple
*gs
)
2736 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2737 return gimple_assign_rhs1_ptr (ass
);
2740 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2743 gimple_assign_set_rhs1 (gassign
*gs
, tree rhs
)
2749 gimple_assign_set_rhs1 (gimple
*gs
, tree rhs
)
2751 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2752 gimple_assign_set_rhs1 (ass
, rhs
);
2756 /* Return the second operand on the RHS of assignment statement GS.
2757 If GS does not have two operands, NULL is returned instead. */
2760 gimple_assign_rhs2 (const gassign
*gs
)
2762 if (gimple_num_ops (gs
) >= 3)
2769 gimple_assign_rhs2 (const gimple
*gs
)
2771 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2772 return gimple_assign_rhs2 (ass
);
2776 /* Return a pointer to the second operand on the RHS of assignment
2780 gimple_assign_rhs2_ptr (gassign
*gs
)
2782 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 3);
2787 gimple_assign_rhs2_ptr (gimple
*gs
)
2789 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2790 return gimple_assign_rhs2_ptr (ass
);
2794 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2797 gimple_assign_set_rhs2 (gassign
*gs
, tree rhs
)
2799 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 3);
2804 gimple_assign_set_rhs2 (gimple
*gs
, tree rhs
)
2806 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2807 return gimple_assign_set_rhs2 (ass
, rhs
);
2810 /* Return the third operand on the RHS of assignment statement GS.
2811 If GS does not have two operands, NULL is returned instead. */
2814 gimple_assign_rhs3 (const gassign
*gs
)
2816 if (gimple_num_ops (gs
) >= 4)
2823 gimple_assign_rhs3 (const gimple
*gs
)
2825 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2826 return gimple_assign_rhs3 (ass
);
2829 /* Return a pointer to the third operand on the RHS of assignment
2833 gimple_assign_rhs3_ptr (gimple
*gs
)
2835 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2836 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 4);
2841 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2844 gimple_assign_set_rhs3 (gassign
*gs
, tree rhs
)
2846 gcc_gimple_checking_assert (gimple_num_ops (gs
) >= 4);
2851 gimple_assign_set_rhs3 (gimple
*gs
, tree rhs
)
2853 gassign
*ass
= GIMPLE_CHECK2
<gassign
*> (gs
);
2854 gimple_assign_set_rhs3 (ass
, rhs
);
2858 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2859 which expect to see only two operands. */
2862 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2865 gimple_assign_set_rhs_with_ops (gsi
, code
, op1
, op2
, NULL
);
2868 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2869 which expect to see only one operands. */
2872 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2875 gimple_assign_set_rhs_with_ops (gsi
, code
, op1
, NULL
, NULL
);
2878 /* Returns true if GS is a nontemporal move. */
2881 gimple_assign_nontemporal_move_p (const gassign
*gs
)
2883 return gs
->nontemporal_move
;
2886 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2889 gimple_assign_set_nontemporal_move (gimple
*gs
, bool nontemporal
)
2891 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2892 gs
->nontemporal_move
= nontemporal
;
2896 /* Return the code of the expression computed on the rhs of assignment
2897 statement GS. In case that the RHS is a single object, returns the
2898 tree code of the object. */
2900 inline enum tree_code
2901 gimple_assign_rhs_code (const gassign
*gs
)
2903 enum tree_code code
= (enum tree_code
) gs
->subcode
;
2904 /* While we initially set subcode to the TREE_CODE of the rhs for
2905 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2906 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2907 if (get_gimple_rhs_class (code
) == GIMPLE_SINGLE_RHS
)
2908 code
= TREE_CODE (gs
->op
[1]);
2913 inline enum tree_code
2914 gimple_assign_rhs_code (const gimple
*gs
)
2916 const gassign
*ass
= GIMPLE_CHECK2
<const gassign
*> (gs
);
2917 return gimple_assign_rhs_code (ass
);
2921 /* Set CODE to be the code for the expression computed on the RHS of
2925 gimple_assign_set_rhs_code (gimple
*s
, enum tree_code code
)
2927 GIMPLE_CHECK (s
, GIMPLE_ASSIGN
);
2932 /* Return the gimple rhs class of the code of the expression computed on
2933 the rhs of assignment statement GS.
2934 This will never return GIMPLE_INVALID_RHS. */
2936 inline enum gimple_rhs_class
2937 gimple_assign_rhs_class (const gimple
*gs
)
2939 return get_gimple_rhs_class (gimple_assign_rhs_code (gs
));
2942 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2943 there is no operator associated with the assignment itself.
2944 Unlike gimple_assign_copy_p, this predicate returns true for
2945 any RHS operand, including those that perform an operation
2946 and do not have the semantics of a copy, such as COND_EXPR. */
2949 gimple_assign_single_p (const gimple
*gs
)
2951 return (is_gimple_assign (gs
)
2952 && gimple_assign_rhs_class (gs
) == GIMPLE_SINGLE_RHS
);
2955 /* Return true if GS performs a store to its lhs. */
2958 gimple_store_p (const gimple
*gs
)
2960 tree lhs
= gimple_get_lhs (gs
);
2961 return lhs
&& !is_gimple_reg (lhs
);
2964 /* Return true if S is a type-cast assignment. */
2967 gimple_assign_cast_p (const gimple
*s
)
2969 if (is_gimple_assign (s
))
2971 enum tree_code sc
= gimple_assign_rhs_code (s
);
2972 return CONVERT_EXPR_CODE_P (sc
)
2973 || sc
== VIEW_CONVERT_EXPR
2974 || sc
== FIX_TRUNC_EXPR
;
2980 /* Return true if S is a clobber statement. */
2983 gimple_clobber_p (const gimple
*s
)
2985 return gimple_assign_single_p (s
)
2986 && TREE_CLOBBER_P (gimple_assign_rhs1 (s
));
2989 /* Return true if S is a clobber statement. */
2992 gimple_clobber_p (const gimple
*s
, enum clobber_kind kind
)
2994 return gimple_clobber_p (s
)
2995 && CLOBBER_KIND (gimple_assign_rhs1 (s
)) == kind
;
2998 /* Return true if GS is a GIMPLE_CALL. */
3001 is_gimple_call (const gimple
*gs
)
3003 return gimple_code (gs
) == GIMPLE_CALL
;
3006 /* Return the LHS of call statement GS. */
3009 gimple_call_lhs (const gcall
*gs
)
3015 gimple_call_lhs (const gimple
*gs
)
3017 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3018 return gimple_call_lhs (gc
);
3022 /* Return a pointer to the LHS of call statement GS. */
3025 gimple_call_lhs_ptr (gcall
*gs
)
3031 gimple_call_lhs_ptr (gimple
*gs
)
3033 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3034 return gimple_call_lhs_ptr (gc
);
3038 /* Set LHS to be the LHS operand of call statement GS. */
3041 gimple_call_set_lhs (gcall
*gs
, tree lhs
)
3044 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
3045 SSA_NAME_DEF_STMT (lhs
) = gs
;
3049 gimple_call_set_lhs (gimple
*gs
, tree lhs
)
3051 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3052 gimple_call_set_lhs (gc
, lhs
);
3056 /* Return true if call GS calls an internal-only function, as enumerated
3060 gimple_call_internal_p (const gcall
*gs
)
3062 return (gs
->subcode
& GF_CALL_INTERNAL
) != 0;
3066 gimple_call_internal_p (const gimple
*gs
)
3068 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3069 return gimple_call_internal_p (gc
);
3072 /* Return true if call GS is marked as nocf_check. */
3075 gimple_call_nocf_check_p (const gcall
*gs
)
3077 return (gs
->subcode
& GF_CALL_NOCF_CHECK
) != 0;
3080 /* Mark statement GS as nocf_check call. */
3083 gimple_call_set_nocf_check (gcall
*gs
, bool nocf_check
)
3086 gs
->subcode
|= GF_CALL_NOCF_CHECK
;
3088 gs
->subcode
&= ~GF_CALL_NOCF_CHECK
;
3091 /* Return the target of internal call GS. */
3093 inline enum internal_fn
3094 gimple_call_internal_fn (const gcall
*gs
)
3096 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
3097 return gs
->u
.internal_fn
;
3100 inline enum internal_fn
3101 gimple_call_internal_fn (const gimple
*gs
)
3103 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3104 return gimple_call_internal_fn (gc
);
3107 /* Return true, if this internal gimple call is unique. */
3110 gimple_call_internal_unique_p (const gcall
*gs
)
3112 return gimple_call_internal_fn (gs
) == IFN_UNIQUE
;
3116 gimple_call_internal_unique_p (const gimple
*gs
)
3118 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3119 return gimple_call_internal_unique_p (gc
);
3122 /* Return true if GS is an internal function FN. */
3125 gimple_call_internal_p (const gimple
*gs
, internal_fn fn
)
3127 return (is_gimple_call (gs
)
3128 && gimple_call_internal_p (gs
)
3129 && gimple_call_internal_fn (gs
) == fn
);
3132 /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
3133 that could alter control flow. */
3136 gimple_call_set_ctrl_altering (gcall
*s
, bool ctrl_altering_p
)
3138 if (ctrl_altering_p
)
3139 s
->subcode
|= GF_CALL_CTRL_ALTERING
;
3141 s
->subcode
&= ~GF_CALL_CTRL_ALTERING
;
3145 gimple_call_set_ctrl_altering (gimple
*s
, bool ctrl_altering_p
)
3147 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (s
);
3148 gimple_call_set_ctrl_altering (gc
, ctrl_altering_p
);
3151 /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
3152 flag is set. Such call could not be a stmt in the middle of a bb. */
3155 gimple_call_ctrl_altering_p (const gcall
*gs
)
3157 return (gs
->subcode
& GF_CALL_CTRL_ALTERING
) != 0;
3161 gimple_call_ctrl_altering_p (const gimple
*gs
)
3163 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3164 return gimple_call_ctrl_altering_p (gc
);
3168 /* Return the function type of the function called by GS. */
3171 gimple_call_fntype (const gcall
*gs
)
3173 if (gimple_call_internal_p (gs
))
3175 return gs
->u
.fntype
;
3179 gimple_call_fntype (const gimple
*gs
)
3181 const gcall
*call_stmt
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3182 return gimple_call_fntype (call_stmt
);
3185 /* Set the type of the function called by CALL_STMT to FNTYPE. */
3188 gimple_call_set_fntype (gcall
*call_stmt
, tree fntype
)
3190 gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt
));
3191 call_stmt
->u
.fntype
= fntype
;
3195 /* Return the tree node representing the function called by call
3199 gimple_call_fn (const gcall
*gs
)
3205 gimple_call_fn (const gimple
*gs
)
3207 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3208 return gimple_call_fn (gc
);
3211 /* Return a pointer to the tree node representing the function called by call
3215 gimple_call_fn_ptr (gcall
*gs
)
3221 gimple_call_fn_ptr (gimple
*gs
)
3223 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3224 return gimple_call_fn_ptr (gc
);
3228 /* Set FN to be the function called by call statement GS. */
3231 gimple_call_set_fn (gcall
*gs
, tree fn
)
3233 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
3238 /* Set FNDECL to be the function called by call statement GS. */
3241 gimple_call_set_fndecl (gcall
*gs
, tree decl
)
3243 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
3244 gs
->op
[1] = build1_loc (gimple_location (gs
), ADDR_EXPR
,
3245 build_pointer_type (TREE_TYPE (decl
)), decl
);
3249 gimple_call_set_fndecl (gimple
*gs
, tree decl
)
3251 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3252 gimple_call_set_fndecl (gc
, decl
);
3256 /* Set internal function FN to be the function called by call statement CALL_STMT. */
3259 gimple_call_set_internal_fn (gcall
*call_stmt
, enum internal_fn fn
)
3261 gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt
));
3262 call_stmt
->u
.internal_fn
= fn
;
3266 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
3267 Otherwise return NULL. This function is analogous to
3268 get_callee_fndecl in tree land. */
3271 gimple_call_fndecl (const gcall
*gs
)
3273 return gimple_call_addr_fndecl (gimple_call_fn (gs
));
3277 gimple_call_fndecl (const gimple
*gs
)
3279 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3280 return gimple_call_fndecl (gc
);
3284 /* Return the type returned by call statement GS. */
3287 gimple_call_return_type (const gcall
*gs
)
3289 tree type
= gimple_call_fntype (gs
);
3291 if (type
== NULL_TREE
)
3292 return TREE_TYPE (gimple_call_lhs (gs
));
3294 /* The type returned by a function is the type of its
3296 return TREE_TYPE (type
);
3300 /* Return the static chain for call statement GS. */
3303 gimple_call_chain (const gcall
*gs
)
3309 gimple_call_chain (const gimple
*gs
)
3311 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3312 return gimple_call_chain (gc
);
3316 /* Return a pointer to the static chain for call statement CALL_STMT. */
3319 gimple_call_chain_ptr (gcall
*call_stmt
)
3321 return &call_stmt
->op
[2];
3324 /* Set CHAIN to be the static chain for call statement CALL_STMT. */
3327 gimple_call_set_chain (gcall
*call_stmt
, tree chain
)
3329 call_stmt
->op
[2] = chain
;
3333 /* Return the number of arguments used by call statement GS. */
3336 gimple_call_num_args (const gcall
*gs
)
3338 return gimple_num_ops (gs
) - 3;
3342 gimple_call_num_args (const gimple
*gs
)
3344 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3345 return gimple_call_num_args (gc
);
3349 /* Return the argument at position INDEX for call statement GS. */
3352 gimple_call_arg (const gcall
*gs
, unsigned index
)
3354 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3355 return gs
->op
[index
+ 3];
3359 gimple_call_arg (const gimple
*gs
, unsigned index
)
3361 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (gs
);
3362 return gimple_call_arg (gc
, index
);
3366 /* Return a pointer to the argument at position INDEX for call
3370 gimple_call_arg_ptr (gcall
*gs
, unsigned index
)
3372 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3373 return &gs
->op
[index
+ 3];
3377 gimple_call_arg_ptr (gimple
*gs
, unsigned index
)
3379 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3380 return gimple_call_arg_ptr (gc
, index
);
3384 /* Set ARG to be the argument at position INDEX for call statement GS. */
3387 gimple_call_set_arg (gcall
*gs
, unsigned index
, tree arg
)
3389 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 3);
3390 gs
->op
[index
+ 3] = arg
;
3394 gimple_call_set_arg (gimple
*gs
, unsigned index
, tree arg
)
3396 gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (gs
);
3397 gimple_call_set_arg (gc
, index
, arg
);
3401 /* If TAIL_P is true, mark call statement S as being a tail call
3402 (i.e., a call just before the exit of a function). These calls are
3403 candidate for tail call optimization. */
3406 gimple_call_set_tail (gcall
*s
, bool tail_p
)
3409 s
->subcode
|= GF_CALL_TAILCALL
;
3411 s
->subcode
&= ~GF_CALL_TAILCALL
;
3415 /* Return true if GIMPLE_CALL S is marked as a tail call. */
3418 gimple_call_tail_p (const gcall
*s
)
3420 return (s
->subcode
& GF_CALL_TAILCALL
) != 0;
3423 /* Mark (or clear) call statement S as requiring tail call optimization. */
3426 gimple_call_set_must_tail (gcall
*s
, bool must_tail_p
)
3429 s
->subcode
|= GF_CALL_MUST_TAIL_CALL
;
3431 s
->subcode
&= ~GF_CALL_MUST_TAIL_CALL
;
3434 /* Return true if call statement has been marked as requiring
3435 tail call optimization. */
3438 gimple_call_must_tail_p (const gcall
*s
)
3440 return (s
->subcode
& GF_CALL_MUST_TAIL_CALL
) != 0;
3443 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
3444 slot optimization. This transformation uses the target of the call
3445 expansion as the return slot for calls that return in memory. */
3448 gimple_call_set_return_slot_opt (gcall
*s
, bool return_slot_opt_p
)
3450 if (return_slot_opt_p
)
3451 s
->subcode
|= GF_CALL_RETURN_SLOT_OPT
;
3453 s
->subcode
&= ~GF_CALL_RETURN_SLOT_OPT
;
3457 /* Return true if S is marked for return slot optimization. */
3460 gimple_call_return_slot_opt_p (const gcall
*s
)
3462 return (s
->subcode
& GF_CALL_RETURN_SLOT_OPT
) != 0;
3466 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
3467 thunk to the thunked-to function. */
3470 gimple_call_set_from_thunk (gcall
*s
, bool from_thunk_p
)
3473 s
->subcode
|= GF_CALL_FROM_THUNK
;
3475 s
->subcode
&= ~GF_CALL_FROM_THUNK
;
3479 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
3482 gimple_call_from_thunk_p (gcall
*s
)
3484 return (s
->subcode
& GF_CALL_FROM_THUNK
) != 0;
3488 /* If FROM_NEW_OR_DELETE_P is true, mark GIMPLE_CALL S as being a call
3489 to operator new or delete created from a new or delete expression. */
3492 gimple_call_set_from_new_or_delete (gcall
*s
, bool from_new_or_delete_p
)
3494 if (from_new_or_delete_p
)
3495 s
->subcode
|= GF_CALL_FROM_NEW_OR_DELETE
;
3497 s
->subcode
&= ~GF_CALL_FROM_NEW_OR_DELETE
;
3501 /* Return true if GIMPLE_CALL S is a call to operator new or delete from
3502 from a new or delete expression. */
3505 gimple_call_from_new_or_delete (const gcall
*s
)
3507 return (s
->subcode
& GF_CALL_FROM_NEW_OR_DELETE
) != 0;
3511 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
3512 argument pack in its argument list. */
3515 gimple_call_set_va_arg_pack (gcall
*s
, bool pass_arg_pack_p
)
3517 if (pass_arg_pack_p
)
3518 s
->subcode
|= GF_CALL_VA_ARG_PACK
;
3520 s
->subcode
&= ~GF_CALL_VA_ARG_PACK
;
3524 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
3525 argument pack in its argument list. */
3528 gimple_call_va_arg_pack_p (const gcall
*s
)
3530 return (s
->subcode
& GF_CALL_VA_ARG_PACK
) != 0;
3534 /* Return true if S is a noreturn call. */
3537 gimple_call_noreturn_p (const gcall
*s
)
3539 return (gimple_call_flags (s
) & ECF_NORETURN
) != 0;
3543 gimple_call_noreturn_p (const gimple
*s
)
3545 const gcall
*gc
= GIMPLE_CHECK2
<const gcall
*> (s
);
3546 return gimple_call_noreturn_p (gc
);
3550 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
3551 even if the called function can throw in other cases. */
3554 gimple_call_set_nothrow (gcall
*s
, bool nothrow_p
)
3557 s
->subcode
|= GF_CALL_NOTHROW
;
3559 s
->subcode
&= ~GF_CALL_NOTHROW
;
3562 /* Return true if S is a nothrow call. */
3565 gimple_call_nothrow_p (const gcall
*s
)
3567 return (gimple_call_flags (s
) & ECF_NOTHROW
) != 0;
3570 /* If EXPECTED_THROW_P is true, GIMPLE_CALL S is a call that is known
3571 to be more likely to throw than to run forever, terminate the
3572 program or return by other means. */
3575 gimple_call_set_expected_throw (gcall
*s
, bool expected_throw_p
)
3577 if (expected_throw_p
)
3578 s
->subcode
|= GF_CALL_XTHROW
;
3580 s
->subcode
&= ~GF_CALL_XTHROW
;
3583 /* Return true if S is a call that is more likely to end by
3584 propagating an exception than by other means. */
3587 gimple_call_expected_throw_p (gcall
*s
)
3589 return (gimple_call_flags (s
) & ECF_XTHROW
) != 0;
3592 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
3593 is known to be emitted for VLA objects. Those are wrapped by
3594 stack_save/stack_restore calls and hence can't lead to unbounded
3595 stack growth even when they occur in loops. */
3598 gimple_call_set_alloca_for_var (gcall
*s
, bool for_var
)
3601 s
->subcode
|= GF_CALL_ALLOCA_FOR_VAR
;
3603 s
->subcode
&= ~GF_CALL_ALLOCA_FOR_VAR
;
3606 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
3609 gimple_call_alloca_for_var_p (gcall
*s
)
3611 return (s
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
3615 gimple_call_alloca_for_var_p (gimple
*s
)
3617 const gcall
*gc
= GIMPLE_CHECK2
<gcall
*> (s
);
3618 return (gc
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
3621 /* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
3622 pointers to nested function are descriptors instead of trampolines. */
3625 gimple_call_set_by_descriptor (gcall
*s
, bool by_descriptor_p
)
3627 if (by_descriptor_p
)
3628 s
->subcode
|= GF_CALL_BY_DESCRIPTOR
;
3630 s
->subcode
&= ~GF_CALL_BY_DESCRIPTOR
;
3633 /* Return true if S is a by-descriptor call. */
3636 gimple_call_by_descriptor_p (gcall
*s
)
3638 return (s
->subcode
& GF_CALL_BY_DESCRIPTOR
) != 0;
3641 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
3644 gimple_call_copy_flags (gcall
*dest_call
, gcall
*orig_call
)
3646 dest_call
->subcode
= orig_call
->subcode
;
3650 /* Return a pointer to the points-to solution for the set of call-used
3651 variables of the call CALL_STMT. */
3653 inline struct pt_solution
*
3654 gimple_call_use_set (gcall
*call_stmt
)
3656 return &call_stmt
->call_used
;
3659 /* As above, but const. */
3661 inline const pt_solution
*
3662 gimple_call_use_set (const gcall
*call_stmt
)
3664 return &call_stmt
->call_used
;
3667 /* Return a pointer to the points-to solution for the set of call-used
3668 variables of the call CALL_STMT. */
3670 inline struct pt_solution
*
3671 gimple_call_clobber_set (gcall
*call_stmt
)
3673 return &call_stmt
->call_clobbered
;
3676 /* As above, but const. */
3678 inline const pt_solution
*
3679 gimple_call_clobber_set (const gcall
*call_stmt
)
3681 return &call_stmt
->call_clobbered
;
3685 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
3689 gimple_has_lhs (const gimple
*stmt
)
3691 if (is_gimple_assign (stmt
))
3693 if (const gcall
*call
= dyn_cast
<const gcall
*> (stmt
))
3694 return gimple_call_lhs (call
) != NULL_TREE
;
3699 /* Return the code of the predicate computed by conditional statement GS. */
3701 inline enum tree_code
3702 gimple_cond_code (const gcond
*gs
)
3704 return (enum tree_code
) gs
->subcode
;
3707 inline enum tree_code
3708 gimple_cond_code (const gimple
*gs
)
3710 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3711 return gimple_cond_code (gc
);
3715 /* Set CODE to be the predicate code for the conditional statement GS. */
3718 gimple_cond_set_code (gcond
*gs
, enum tree_code code
)
3720 gcc_gimple_checking_assert (TREE_CODE_CLASS (code
) == tcc_comparison
);
3725 /* Return the LHS of the predicate computed by conditional statement GS. */
3728 gimple_cond_lhs (const gcond
*gs
)
3734 gimple_cond_lhs (const gimple
*gs
)
3736 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3737 return gimple_cond_lhs (gc
);
3740 /* Return the pointer to the LHS of the predicate computed by conditional
3744 gimple_cond_lhs_ptr (gcond
*gs
)
3749 /* Set LHS to be the LHS operand of the predicate computed by
3750 conditional statement GS. */
3753 gimple_cond_set_lhs (gcond
*gs
, tree lhs
)
3759 /* Return the RHS operand of the predicate computed by conditional GS. */
3762 gimple_cond_rhs (const gcond
*gs
)
3768 gimple_cond_rhs (const gimple
*gs
)
3770 const gcond
*gc
= GIMPLE_CHECK2
<const gcond
*> (gs
);
3771 return gimple_cond_rhs (gc
);
3774 /* Return the pointer to the RHS operand of the predicate computed by
3778 gimple_cond_rhs_ptr (gcond
*gs
)
3784 /* Set RHS to be the RHS operand of the predicate computed by
3785 conditional statement GS. */
3788 gimple_cond_set_rhs (gcond
*gs
, tree rhs
)
3794 /* Return the label used by conditional statement GS when its
3795 predicate evaluates to true. */
3798 gimple_cond_true_label (const gcond
*gs
)
3804 /* Set LABEL to be the label used by conditional statement GS when its
3805 predicate evaluates to true. */
3808 gimple_cond_set_true_label (gcond
*gs
, tree label
)
3814 /* Set LABEL to be the label used by conditional statement GS when its
3815 predicate evaluates to false. */
3818 gimple_cond_set_false_label (gcond
*gs
, tree label
)
3824 /* Return the label used by conditional statement GS when its
3825 predicate evaluates to false. */
3828 gimple_cond_false_label (const gcond
*gs
)
3834 /* Set the conditional COND_STMT to be of the form 'if (0 != 0)'. */
3837 gimple_cond_make_false (gcond
*gs
)
3839 gimple_cond_set_lhs (gs
, boolean_false_node
);
3840 gimple_cond_set_rhs (gs
, boolean_false_node
);
3841 gs
->subcode
= NE_EXPR
;
3845 /* Set the conditional COND_STMT to be of the form 'if (1 != 0)'. */
3848 gimple_cond_make_true (gcond
*gs
)
3850 gimple_cond_set_lhs (gs
, boolean_true_node
);
3851 gimple_cond_set_rhs (gs
, boolean_false_node
);
3852 gs
->subcode
= NE_EXPR
;
3855 /* Check if conditional statement GS is of the form 'if (1 == 1)',
3856 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3859 gimple_cond_true_p (const gcond
*gs
)
3861 tree lhs
= gimple_cond_lhs (gs
);
3862 tree rhs
= gimple_cond_rhs (gs
);
3863 enum tree_code code
= gimple_cond_code (gs
);
3865 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3868 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3871 if (code
== NE_EXPR
&& lhs
!= rhs
)
3874 if (code
== EQ_EXPR
&& lhs
== rhs
)
3880 /* Check if conditional statement GS is in the caonical form of 'if (1 != 0)'. */
3883 gimple_cond_true_canonical_p (const gcond
*gs
)
3885 tree lhs
= gimple_cond_lhs (gs
);
3886 tree rhs
= gimple_cond_rhs (gs
);
3887 tree_code code
= gimple_cond_code (gs
);
3889 && lhs
== boolean_true_node
3890 && rhs
== boolean_false_node
)
3895 /* Check if conditional statement GS is of the form 'if (1 != 1)',
3896 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3899 gimple_cond_false_p (const gcond
*gs
)
3901 tree lhs
= gimple_cond_lhs (gs
);
3902 tree rhs
= gimple_cond_rhs (gs
);
3903 enum tree_code code
= gimple_cond_code (gs
);
3905 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3908 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3911 if (code
== NE_EXPR
&& lhs
== rhs
)
3914 if (code
== EQ_EXPR
&& lhs
!= rhs
)
3920 /* Check if conditional statement GS is in the caonical form of 'if (0 != 0)'. */
3923 gimple_cond_false_canonical_p (const gcond
*gs
)
3925 tree lhs
= gimple_cond_lhs (gs
);
3926 tree rhs
= gimple_cond_rhs (gs
);
3927 tree_code code
= gimple_cond_code (gs
);
3929 && lhs
== boolean_false_node
3930 && rhs
== boolean_false_node
)
3935 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3938 gimple_cond_set_condition (gcond
*stmt
, enum tree_code code
, tree lhs
,
3941 gimple_cond_set_code (stmt
, code
);
3942 gimple_cond_set_lhs (stmt
, lhs
);
3943 gimple_cond_set_rhs (stmt
, rhs
);
3947 /* Return the tree code for the expression computed by STMT. This is
3948 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
3949 GIMPLE_CALL, return CALL_EXPR as the expression code for
3950 consistency. This is useful when the caller needs to deal with the
3951 three kinds of computation that GIMPLE supports. */
3953 inline enum tree_code
3954 gimple_expr_code (const gimple
*stmt
)
3956 if (const gassign
*ass
= dyn_cast
<const gassign
*> (stmt
))
3957 return gimple_assign_rhs_code (ass
);
3958 if (const gcond
*cond
= dyn_cast
<const gcond
*> (stmt
))
3959 return gimple_cond_code (cond
);
3962 gcc_gimple_checking_assert (gimple_code (stmt
) == GIMPLE_CALL
);
3968 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3971 gimple_label_label (const glabel
*gs
)
3977 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3981 gimple_label_set_label (glabel
*gs
, tree label
)
3987 /* Return the destination of the unconditional jump GS. */
3990 gimple_goto_dest (const gimple
*gs
)
3992 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3993 return gimple_op (gs
, 0);
3997 /* Set DEST to be the destination of the unconditonal jump GS. */
4000 gimple_goto_set_dest (ggoto
*gs
, tree dest
)
4006 /* Return the variables declared in the GIMPLE_BIND statement GS. */
4009 gimple_bind_vars (const gbind
*bind_stmt
)
4011 return bind_stmt
->vars
;
4015 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
4019 gimple_bind_set_vars (gbind
*bind_stmt
, tree vars
)
4021 bind_stmt
->vars
= vars
;
4025 /* Append VARS to the set of variables declared in the GIMPLE_BIND
4029 gimple_bind_append_vars (gbind
*bind_stmt
, tree vars
)
4031 bind_stmt
->vars
= chainon (bind_stmt
->vars
, vars
);
4036 gimple_bind_body_ptr (gbind
*bind_stmt
)
4038 return &bind_stmt
->body
;
4041 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
4044 gimple_bind_body (const gbind
*gs
)
4046 return *gimple_bind_body_ptr (const_cast <gbind
*> (gs
));
4050 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
4054 gimple_bind_set_body (gbind
*bind_stmt
, gimple_seq seq
)
4056 bind_stmt
->body
= seq
;
4060 /* Append a statement to the end of a GIMPLE_BIND's body. */
4063 gimple_bind_add_stmt (gbind
*bind_stmt
, gimple
*stmt
)
4065 gimple_seq_add_stmt (&bind_stmt
->body
, stmt
);
4069 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
4072 gimple_bind_add_seq (gbind
*bind_stmt
, gimple_seq seq
)
4074 gimple_seq_add_seq (&bind_stmt
->body
, seq
);
4078 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
4079 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
4082 gimple_bind_block (const gbind
*bind_stmt
)
4084 return bind_stmt
->block
;
4088 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
4092 gimple_bind_set_block (gbind
*bind_stmt
, tree block
)
4094 gcc_gimple_checking_assert (block
== NULL_TREE
4095 || TREE_CODE (block
) == BLOCK
);
4096 bind_stmt
->block
= block
;
4100 /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
4103 gimple_asm_ninputs (const gasm
*asm_stmt
)
4105 return asm_stmt
->ni
;
4109 /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
4112 gimple_asm_noutputs (const gasm
*asm_stmt
)
4114 return asm_stmt
->no
;
4118 /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
4121 gimple_asm_nclobbers (const gasm
*asm_stmt
)
4123 return asm_stmt
->nc
;
4126 /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
4129 gimple_asm_nlabels (const gasm
*asm_stmt
)
4131 return asm_stmt
->nl
;
4134 /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
4137 gimple_asm_input_op (const gasm
*asm_stmt
, unsigned index
)
4139 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
4140 return asm_stmt
->op
[index
+ asm_stmt
->no
];
4143 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
4146 gimple_asm_set_input_op (gasm
*asm_stmt
, unsigned index
, tree in_op
)
4148 gcc_gimple_checking_assert (index
< asm_stmt
->ni
4149 && TREE_CODE (in_op
) == TREE_LIST
);
4150 asm_stmt
->op
[index
+ asm_stmt
->no
] = in_op
;
4154 /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
4157 gimple_asm_output_op (const gasm
*asm_stmt
, unsigned index
)
4159 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
4160 return asm_stmt
->op
[index
];
4163 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
4166 gimple_asm_set_output_op (gasm
*asm_stmt
, unsigned index
, tree out_op
)
4168 gcc_gimple_checking_assert (index
< asm_stmt
->no
4169 && TREE_CODE (out_op
) == TREE_LIST
);
4170 asm_stmt
->op
[index
] = out_op
;
4174 /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
4177 gimple_asm_clobber_op (const gasm
*asm_stmt
, unsigned index
)
4179 gcc_gimple_checking_assert (index
< asm_stmt
->nc
);
4180 return asm_stmt
->op
[index
+ asm_stmt
->ni
+ asm_stmt
->no
];
4184 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
4187 gimple_asm_set_clobber_op (gasm
*asm_stmt
, unsigned index
, tree clobber_op
)
4189 gcc_gimple_checking_assert (index
< asm_stmt
->nc
4190 && TREE_CODE (clobber_op
) == TREE_LIST
);
4191 asm_stmt
->op
[index
+ asm_stmt
->ni
+ asm_stmt
->no
] = clobber_op
;
4194 /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
4197 gimple_asm_label_op (const gasm
*asm_stmt
, unsigned index
)
4199 gcc_gimple_checking_assert (index
< asm_stmt
->nl
);
4200 return asm_stmt
->op
[index
+ asm_stmt
->no
+ asm_stmt
->ni
+ asm_stmt
->nc
];
4203 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
4206 gimple_asm_set_label_op (gasm
*asm_stmt
, unsigned index
, tree label_op
)
4208 gcc_gimple_checking_assert (index
< asm_stmt
->nl
4209 && TREE_CODE (label_op
) == TREE_LIST
);
4210 asm_stmt
->op
[index
+ asm_stmt
->no
+ asm_stmt
->ni
+ asm_stmt
->nc
] = label_op
;
4213 /* Return the string representing the assembly instruction in
4214 GIMPLE_ASM ASM_STMT. */
4217 gimple_asm_string (const gasm
*asm_stmt
)
4219 return asm_stmt
->string
;
4223 /* Return true if ASM_STMT is marked volatile. */
4226 gimple_asm_volatile_p (const gasm
*asm_stmt
)
4228 return (asm_stmt
->subcode
& GF_ASM_VOLATILE
) != 0;
4232 /* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile. */
4235 gimple_asm_set_volatile (gasm
*asm_stmt
, bool volatile_p
)
4238 asm_stmt
->subcode
|= GF_ASM_VOLATILE
;
4240 asm_stmt
->subcode
&= ~GF_ASM_VOLATILE
;
4244 /* Return true if ASM_STMT is marked inline. */
4247 gimple_asm_inline_p (const gasm
*asm_stmt
)
4249 return (asm_stmt
->subcode
& GF_ASM_INLINE
) != 0;
4253 /* If INLINE_P is true, mark asm statement ASM_STMT as inline. */
4256 gimple_asm_set_inline (gasm
*asm_stmt
, bool inline_p
)
4259 asm_stmt
->subcode
|= GF_ASM_INLINE
;
4261 asm_stmt
->subcode
&= ~GF_ASM_INLINE
;
4265 /* Mark whether asm ASM_STMT is a basic asm or an extended asm, based on
4269 gimple_asm_set_basic (gasm
*asm_stmt
, bool basic_p
)
4272 asm_stmt
->subcode
|= GF_ASM_BASIC
;
4274 asm_stmt
->subcode
&= ~GF_ASM_BASIC
;
4278 /* Return true if asm ASM_STMT is a basic asm rather than an extended asm. */
4281 gimple_asm_basic_p (const gasm
*asm_stmt
)
4283 return (asm_stmt
->subcode
& GF_ASM_BASIC
) != 0;
4287 /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4290 gimple_catch_types (const gcatch
*catch_stmt
)
4292 return catch_stmt
->types
;
4296 /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4299 gimple_catch_types_ptr (gcatch
*catch_stmt
)
4301 return &catch_stmt
->types
;
4305 /* Return a pointer to the GIMPLE sequence representing the body of
4306 the handler of GIMPLE_CATCH statement CATCH_STMT. */
4309 gimple_catch_handler_ptr (gcatch
*catch_stmt
)
4311 return &catch_stmt
->handler
;
4315 /* Return the GIMPLE sequence representing the body of the handler of
4316 GIMPLE_CATCH statement CATCH_STMT. */
4319 gimple_catch_handler (const gcatch
*catch_stmt
)
4321 return *gimple_catch_handler_ptr (const_cast <gcatch
*> (catch_stmt
));
4325 /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
4328 gimple_catch_set_types (gcatch
*catch_stmt
, tree t
)
4330 catch_stmt
->types
= t
;
4334 /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
4337 gimple_catch_set_handler (gcatch
*catch_stmt
, gimple_seq handler
)
4339 catch_stmt
->handler
= handler
;
4343 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
4346 gimple_eh_filter_types (const gimple
*gs
)
4348 const geh_filter
*eh_filter_stmt
= as_a
<const geh_filter
*> (gs
);
4349 return eh_filter_stmt
->types
;
4353 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
4357 gimple_eh_filter_types_ptr (gimple
*gs
)
4359 geh_filter
*eh_filter_stmt
= as_a
<geh_filter
*> (gs
);
4360 return &eh_filter_stmt
->types
;
4364 /* Return a pointer to the sequence of statement to execute when
4365 GIMPLE_EH_FILTER statement fails. */
4368 gimple_eh_filter_failure_ptr (gimple
*gs
)
4370 geh_filter
*eh_filter_stmt
= as_a
<geh_filter
*> (gs
);
4371 return &eh_filter_stmt
->failure
;
4375 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
4379 gimple_eh_filter_failure (const gimple
*gs
)
4381 return *gimple_eh_filter_failure_ptr (const_cast <gimple
*> (gs
));
4385 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
4389 gimple_eh_filter_set_types (geh_filter
*eh_filter_stmt
, tree types
)
4391 eh_filter_stmt
->types
= types
;
4395 /* Set FAILURE to be the sequence of statements to execute on failure
4396 for GIMPLE_EH_FILTER EH_FILTER_STMT. */
4399 gimple_eh_filter_set_failure (geh_filter
*eh_filter_stmt
,
4402 eh_filter_stmt
->failure
= failure
;
4405 /* Get the function decl to be called by the MUST_NOT_THROW region. */
4408 gimple_eh_must_not_throw_fndecl (const geh_mnt
*eh_mnt_stmt
)
4410 return eh_mnt_stmt
->fndecl
;
4413 /* Set the function decl to be called by GS to DECL. */
4416 gimple_eh_must_not_throw_set_fndecl (geh_mnt
*eh_mnt_stmt
,
4419 eh_mnt_stmt
->fndecl
= decl
;
4422 /* GIMPLE_EH_ELSE accessors. */
4425 gimple_eh_else_n_body_ptr (geh_else
*eh_else_stmt
)
4427 return &eh_else_stmt
->n_body
;
4431 gimple_eh_else_n_body (const geh_else
*eh_else_stmt
)
4433 return *gimple_eh_else_n_body_ptr (const_cast <geh_else
*> (eh_else_stmt
));
4437 gimple_eh_else_e_body_ptr (geh_else
*eh_else_stmt
)
4439 return &eh_else_stmt
->e_body
;
4443 gimple_eh_else_e_body (const geh_else
*eh_else_stmt
)
4445 return *gimple_eh_else_e_body_ptr (const_cast <geh_else
*> (eh_else_stmt
));
4449 gimple_eh_else_set_n_body (geh_else
*eh_else_stmt
, gimple_seq seq
)
4451 eh_else_stmt
->n_body
= seq
;
4455 gimple_eh_else_set_e_body (geh_else
*eh_else_stmt
, gimple_seq seq
)
4457 eh_else_stmt
->e_body
= seq
;
4460 /* GIMPLE_TRY accessors. */
4462 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
4463 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
4465 inline enum gimple_try_flags
4466 gimple_try_kind (const gimple
*gs
)
4468 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
4469 return (enum gimple_try_flags
) (gs
->subcode
& GIMPLE_TRY_KIND
);
4473 /* Set the kind of try block represented by GIMPLE_TRY GS. */
4476 gimple_try_set_kind (gtry
*gs
, enum gimple_try_flags kind
)
4478 gcc_gimple_checking_assert (kind
== GIMPLE_TRY_CATCH
4479 || kind
== GIMPLE_TRY_FINALLY
);
4480 if (gimple_try_kind (gs
) != kind
)
4481 gs
->subcode
= (unsigned int) kind
;
4485 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4488 gimple_try_catch_is_cleanup (const gimple
*gs
)
4490 gcc_gimple_checking_assert (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
);
4491 return (gs
->subcode
& GIMPLE_TRY_CATCH_IS_CLEANUP
) != 0;
4495 /* Return a pointer to the sequence of statements used as the
4496 body for GIMPLE_TRY GS. */
4499 gimple_try_eval_ptr (gimple
*gs
)
4501 gtry
*try_stmt
= as_a
<gtry
*> (gs
);
4502 return &try_stmt
->eval
;
4506 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
4509 gimple_try_eval (const gimple
*gs
)
4511 return *gimple_try_eval_ptr (const_cast <gimple
*> (gs
));
4515 /* Return a pointer to the sequence of statements used as the cleanup body for
4519 gimple_try_cleanup_ptr (gimple
*gs
)
4521 gtry
*try_stmt
= as_a
<gtry
*> (gs
);
4522 return &try_stmt
->cleanup
;
4526 /* Return the sequence of statements used as the cleanup body for
4530 gimple_try_cleanup (const gimple
*gs
)
4532 return *gimple_try_cleanup_ptr (const_cast <gimple
*> (gs
));
4536 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4539 gimple_try_set_catch_is_cleanup (gtry
*g
, bool catch_is_cleanup
)
4541 gcc_gimple_checking_assert (gimple_try_kind (g
) == GIMPLE_TRY_CATCH
);
4542 if (catch_is_cleanup
)
4543 g
->subcode
|= GIMPLE_TRY_CATCH_IS_CLEANUP
;
4545 g
->subcode
&= ~GIMPLE_TRY_CATCH_IS_CLEANUP
;
4549 /* Set EVAL to be the sequence of statements to use as the body for
4550 GIMPLE_TRY TRY_STMT. */
4553 gimple_try_set_eval (gtry
*try_stmt
, gimple_seq eval
)
4555 try_stmt
->eval
= eval
;
4559 /* Set CLEANUP to be the sequence of statements to use as the cleanup
4560 body for GIMPLE_TRY TRY_STMT. */
4563 gimple_try_set_cleanup (gtry
*try_stmt
, gimple_seq cleanup
)
4565 try_stmt
->cleanup
= cleanup
;
4569 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
4572 gimple_wce_cleanup_ptr (gimple
*gs
)
4574 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
4575 return &wce_stmt
->cleanup
;
4579 /* Return the cleanup sequence for cleanup statement GS. */
4582 gimple_wce_cleanup (gimple
*gs
)
4584 return *gimple_wce_cleanup_ptr (gs
);
4588 /* Set CLEANUP to be the cleanup sequence for GS. */
4591 gimple_wce_set_cleanup (gimple
*gs
, gimple_seq cleanup
)
4593 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
4594 wce_stmt
->cleanup
= cleanup
;
4598 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
4601 gimple_wce_cleanup_eh_only (const gimple
*gs
)
4603 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
4604 return gs
->subcode
!= 0;
4608 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
4611 gimple_wce_set_cleanup_eh_only (gimple
*gs
, bool eh_only_p
)
4613 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
4614 gs
->subcode
= (unsigned int) eh_only_p
;
4618 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
4621 gimple_phi_capacity (const gimple
*gs
)
4623 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4624 return phi_stmt
->capacity
;
4628 /* Return the number of arguments in GIMPLE_PHI GS. This must always
4629 be exactly the number of incoming edges for the basic block holding
4633 gimple_phi_num_args (const gimple
*gs
)
4635 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4636 return phi_stmt
->nargs
;
4640 /* Return the SSA name created by GIMPLE_PHI GS. */
4643 gimple_phi_result (const gphi
*gs
)
4649 gimple_phi_result (const gimple
*gs
)
4651 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4652 return gimple_phi_result (phi_stmt
);
4655 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
4658 gimple_phi_result_ptr (gphi
*gs
)
4664 gimple_phi_result_ptr (gimple
*gs
)
4666 gphi
*phi_stmt
= as_a
<gphi
*> (gs
);
4667 return gimple_phi_result_ptr (phi_stmt
);
4670 /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
4673 gimple_phi_set_result (gphi
*phi
, tree result
)
4675 phi
->result
= result
;
4676 if (result
&& TREE_CODE (result
) == SSA_NAME
)
4677 SSA_NAME_DEF_STMT (result
) = phi
;
4681 /* Return the PHI argument corresponding to incoming edge INDEX for
4684 inline struct phi_arg_d
*
4685 gimple_phi_arg (gphi
*gs
, unsigned index
)
4687 gcc_gimple_checking_assert (index
< gs
->nargs
);
4688 return &(gs
->args
[index
]);
4691 inline const phi_arg_d
*
4692 gimple_phi_arg (const gphi
*gs
, unsigned index
)
4694 gcc_gimple_checking_assert (index
< gs
->nargs
);
4695 return &(gs
->args
[index
]);
4698 inline const phi_arg_d
*
4699 gimple_phi_arg (const gimple
*gs
, unsigned index
)
4701 const gphi
*phi_stmt
= as_a
<const gphi
*> (gs
);
4702 return gimple_phi_arg (phi_stmt
, index
);
4705 inline struct phi_arg_d
*
4706 gimple_phi_arg (gimple
*gs
, unsigned index
)
4708 gphi
*phi_stmt
= as_a
<gphi
*> (gs
);
4709 return gimple_phi_arg (phi_stmt
, index
);
4712 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
4713 for GIMPLE_PHI PHI. */
4716 gimple_phi_set_arg (gphi
*phi
, unsigned index
, struct phi_arg_d
* phiarg
)
4718 gcc_gimple_checking_assert (index
< phi
->nargs
);
4719 phi
->args
[index
] = *phiarg
;
4722 /* Return the PHI nodes for basic block BB, or NULL if there are no
4726 phi_nodes (const_basic_block bb
)
4728 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
4729 return bb
->il
.gimple
.phi_nodes
;
4732 /* Return a pointer to the PHI nodes for basic block BB. */
4735 phi_nodes_ptr (basic_block bb
)
4737 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
4738 return &bb
->il
.gimple
.phi_nodes
;
4741 /* Return the tree operand for argument I of PHI node GS. */
4744 gimple_phi_arg_def (const gphi
*gs
, size_t index
)
4746 return gimple_phi_arg (gs
, index
)->def
;
4750 gimple_phi_arg_def (const gimple
*gs
, size_t index
)
4752 return gimple_phi_arg (gs
, index
)->def
;
4755 /* Return the tree operand for the argument associated with
4756 edge E of PHI node GS. */
4759 gimple_phi_arg_def_from_edge (const gphi
*gs
, const_edge e
)
4761 gcc_checking_assert (e
->dest
== gimple_bb (gs
));
4762 return gimple_phi_arg (gs
, e
->dest_idx
)->def
;
4766 gimple_phi_arg_def_from_edge (const gimple
*gs
, const_edge e
)
4768 gcc_checking_assert (e
->dest
== gimple_bb (gs
));
4769 return gimple_phi_arg (gs
, e
->dest_idx
)->def
;
4772 /* Return a pointer to the tree operand for argument I of phi node PHI. */
4775 gimple_phi_arg_def_ptr (gphi
*phi
, size_t index
)
4777 return &gimple_phi_arg (phi
, index
)->def
;
4780 /* Return the edge associated with argument I of phi node PHI. */
4783 gimple_phi_arg_edge (const gphi
*phi
, size_t i
)
4785 return EDGE_PRED (gimple_bb (phi
), i
);
4788 /* Return the source location of gimple argument I of phi node PHI. */
4791 gimple_phi_arg_location (const gphi
*phi
, size_t i
)
4793 return gimple_phi_arg (phi
, i
)->locus
;
4796 /* Return the source location of the argument on edge E of phi node PHI. */
4799 gimple_phi_arg_location_from_edge (gphi
*phi
, edge e
)
4801 return gimple_phi_arg (phi
, e
->dest_idx
)->locus
;
4804 /* Set the source location of gimple argument I of phi node PHI to LOC. */
4807 gimple_phi_arg_set_location (gphi
*phi
, size_t i
, location_t loc
)
4809 gimple_phi_arg (phi
, i
)->locus
= loc
;
4812 /* Return address of source location of gimple argument I of phi node PHI. */
4815 gimple_phi_arg_location_ptr (gphi
*phi
, size_t i
)
4817 return &gimple_phi_arg (phi
, i
)->locus
;
4820 /* Return TRUE if argument I of phi node PHI has a location record. */
4823 gimple_phi_arg_has_location (const gphi
*phi
, size_t i
)
4825 return gimple_phi_arg_location (phi
, i
) != UNKNOWN_LOCATION
;
4828 /* Return the number of arguments that can be accessed by gimple_arg. */
4831 gimple_num_args (const gimple
*gs
)
4833 if (auto phi
= dyn_cast
<const gphi
*> (gs
))
4834 return gimple_phi_num_args (phi
);
4835 if (auto call
= dyn_cast
<const gcall
*> (gs
))
4836 return gimple_call_num_args (call
);
4837 return gimple_num_ops (as_a
<const gassign
*> (gs
)) - 1;
4840 /* GS must be an assignment, a call, or a PHI.
4841 If it's an assignment, return rhs operand I.
4842 If it's a call, return function argument I.
4843 If it's a PHI, return the value of PHI argument I. */
4846 gimple_arg (const gimple
*gs
, unsigned int i
)
4848 if (auto phi
= dyn_cast
<const gphi
*> (gs
))
4849 return gimple_phi_arg_def (phi
, i
);
4850 if (auto call
= dyn_cast
<const gcall
*> (gs
))
4851 return gimple_call_arg (call
, i
);
4852 return gimple_op (as_a
<const gassign
*> (gs
), i
+ 1);
4855 /* Return a pointer to gimple_arg (GS, I). */
4858 gimple_arg_ptr (gimple
*gs
, unsigned int i
)
4860 if (auto phi
= dyn_cast
<gphi
*> (gs
))
4861 return gimple_phi_arg_def_ptr (phi
, i
);
4862 if (auto call
= dyn_cast
<gcall
*> (gs
))
4863 return gimple_call_arg_ptr (call
, i
);
4864 return gimple_op_ptr (as_a
<gassign
*> (gs
), i
+ 1);
4867 /* Return the region number for GIMPLE_RESX RESX_STMT. */
4870 gimple_resx_region (const gresx
*resx_stmt
)
4872 return resx_stmt
->region
;
4875 /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
4878 gimple_resx_set_region (gresx
*resx_stmt
, int region
)
4880 resx_stmt
->region
= region
;
4883 /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
4886 gimple_eh_dispatch_region (const geh_dispatch
*eh_dispatch_stmt
)
4888 return eh_dispatch_stmt
->region
;
4891 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
4892 EH_DISPATCH_STMT. */
4895 gimple_eh_dispatch_set_region (geh_dispatch
*eh_dispatch_stmt
, int region
)
4897 eh_dispatch_stmt
->region
= region
;
4900 /* Return the number of labels associated with the switch statement GS. */
4903 gimple_switch_num_labels (const gswitch
*gs
)
4906 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4907 num_ops
= gimple_num_ops (gs
);
4908 gcc_gimple_checking_assert (num_ops
> 1);
4913 /* Set NLABELS to be the number of labels for the switch statement GS. */
4916 gimple_switch_set_num_labels (gswitch
*g
, unsigned nlabels
)
4918 GIMPLE_CHECK (g
, GIMPLE_SWITCH
);
4919 gimple_set_num_ops (g
, nlabels
+ 1);
4923 /* Return the index variable used by the switch statement GS. */
4926 gimple_switch_index (const gswitch
*gs
)
4932 /* Return a pointer to the index variable for the switch statement GS. */
4935 gimple_switch_index_ptr (gswitch
*gs
)
4941 /* Set INDEX to be the index variable for switch statement GS. */
4944 gimple_switch_set_index (gswitch
*gs
, tree index
)
4946 gcc_gimple_checking_assert (SSA_VAR_P (index
) || CONSTANT_CLASS_P (index
));
4951 /* Return the label numbered INDEX. The default label is 0, followed by any
4952 labels in a switch statement. */
4955 gimple_switch_label (const gswitch
*gs
, unsigned index
)
4957 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1);
4958 return gs
->op
[index
+ 1];
4961 /* Set the label number INDEX to LABEL. 0 is always the default label. */
4964 gimple_switch_set_label (gswitch
*gs
, unsigned index
, tree label
)
4966 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1
4967 && (label
== NULL_TREE
4968 || TREE_CODE (label
) == CASE_LABEL_EXPR
));
4969 gs
->op
[index
+ 1] = label
;
4972 /* Return the default label for a switch statement. */
4975 gimple_switch_default_label (const gswitch
*gs
)
4977 tree label
= gimple_switch_label (gs
, 0);
4978 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4982 /* Set the default label for a switch statement. */
4985 gimple_switch_set_default_label (gswitch
*gs
, tree label
)
4987 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4988 gimple_switch_set_label (gs
, 0, label
);
4991 /* Return true if GS is a GIMPLE_DEBUG statement. */
4994 is_gimple_debug (const gimple
*gs
)
4996 return gimple_code (gs
) == GIMPLE_DEBUG
;
5000 /* Return the first nondebug statement in GIMPLE sequence S. */
5003 gimple_seq_first_nondebug_stmt (gimple_seq s
)
5005 gimple_seq_node n
= gimple_seq_first (s
);
5006 while (n
&& is_gimple_debug (n
))
5012 /* Return the last nondebug statement in GIMPLE sequence S. */
5015 gimple_seq_last_nondebug_stmt (gimple_seq s
)
5018 for (n
= gimple_seq_last (s
);
5019 n
&& is_gimple_debug (n
);
5027 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
5030 gimple_debug_bind_p (const gimple
*s
)
5032 if (is_gimple_debug (s
))
5033 return s
->subcode
== GIMPLE_DEBUG_BIND
;
5038 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
5041 gimple_debug_bind_get_var (const gimple
*dbg
)
5043 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5044 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5045 return gimple_op (dbg
, 0);
5048 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
5052 gimple_debug_bind_get_value (const gimple
*dbg
)
5054 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5055 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5056 return gimple_op (dbg
, 1);
5059 /* Return a pointer to the value bound to the variable in a
5060 GIMPLE_DEBUG bind statement. */
5063 gimple_debug_bind_get_value_ptr (gimple
*dbg
)
5065 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5066 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5067 return gimple_op_ptr (dbg
, 1);
5070 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
5073 gimple_debug_bind_set_var (gimple
*dbg
, tree var
)
5075 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5076 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5077 gimple_set_op (dbg
, 0, var
);
5080 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
5084 gimple_debug_bind_set_value (gimple
*dbg
, tree value
)
5086 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5087 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5088 gimple_set_op (dbg
, 1, value
);
5091 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
5093 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
5095 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
5099 gimple_debug_bind_reset_value (gimple
*dbg
)
5101 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5102 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5103 gimple_set_op (dbg
, 1, GIMPLE_DEBUG_BIND_NOVALUE
);
5106 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
5110 gimple_debug_bind_has_value_p (gimple
*dbg
)
5112 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5113 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
5114 return gimple_op (dbg
, 1) != GIMPLE_DEBUG_BIND_NOVALUE
;
5117 #undef GIMPLE_DEBUG_BIND_NOVALUE
5119 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
5122 gimple_debug_source_bind_p (const gimple
*s
)
5124 if (is_gimple_debug (s
))
5125 return s
->subcode
== GIMPLE_DEBUG_SOURCE_BIND
;
5130 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
5133 gimple_debug_source_bind_get_var (const gimple
*dbg
)
5135 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5136 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5137 return gimple_op (dbg
, 0);
5140 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
5144 gimple_debug_source_bind_get_value (const gimple
*dbg
)
5146 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5147 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5148 return gimple_op (dbg
, 1);
5151 /* Return a pointer to the value bound to the variable in a
5152 GIMPLE_DEBUG source bind statement. */
5155 gimple_debug_source_bind_get_value_ptr (gimple
*dbg
)
5157 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5158 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5159 return gimple_op_ptr (dbg
, 1);
5162 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
5165 gimple_debug_source_bind_set_var (gimple
*dbg
, tree var
)
5167 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5168 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5169 gimple_set_op (dbg
, 0, var
);
5172 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
5176 gimple_debug_source_bind_set_value (gimple
*dbg
, tree value
)
5178 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
5179 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
5180 gimple_set_op (dbg
, 1, value
);
5183 /* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement. */
5186 gimple_debug_begin_stmt_p (const gimple
*s
)
5188 if (is_gimple_debug (s
))
5189 return s
->subcode
== GIMPLE_DEBUG_BEGIN_STMT
;
5194 /* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement. */
5197 gimple_debug_inline_entry_p (const gimple
*s
)
5199 if (is_gimple_debug (s
))
5200 return s
->subcode
== GIMPLE_DEBUG_INLINE_ENTRY
;
5205 /* Return true if S is a GIMPLE_DEBUG non-binding marker statement. */
5208 gimple_debug_nonbind_marker_p (const gimple
*s
)
5210 if (is_gimple_debug (s
))
5211 return s
->subcode
== GIMPLE_DEBUG_BEGIN_STMT
5212 || s
->subcode
== GIMPLE_DEBUG_INLINE_ENTRY
;
5217 /* Return the line number for EXPR, or return -1 if we have no line
5218 number information for it. */
5220 get_lineno (const gimple
*stmt
)
5227 loc
= gimple_location (stmt
);
5228 if (loc
== UNKNOWN_LOCATION
)
5231 return LOCATION_LINE (loc
);
5234 /* Return a pointer to the body for the OMP statement GS. */
5237 gimple_omp_body_ptr (gimple
*gs
)
5239 return &static_cast <gimple_statement_omp
*> (gs
)->body
;
5242 /* Return the body for the OMP statement GS. */
5245 gimple_omp_body (const gimple
*gs
)
5247 return *gimple_omp_body_ptr (const_cast <gimple
*> (gs
));
5250 /* Set BODY to be the body for the OMP statement GS. */
5253 gimple_omp_set_body (gimple
*gs
, gimple_seq body
)
5255 static_cast <gimple_statement_omp
*> (gs
)->body
= body
;
5259 /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
5262 gimple_omp_critical_name (const gomp_critical
*crit_stmt
)
5264 return crit_stmt
->name
;
5268 /* Return a pointer to the name associated with OMP critical statement
5272 gimple_omp_critical_name_ptr (gomp_critical
*crit_stmt
)
5274 return &crit_stmt
->name
;
5278 /* Set NAME to be the name associated with OMP critical statement
5282 gimple_omp_critical_set_name (gomp_critical
*crit_stmt
, tree name
)
5284 crit_stmt
->name
= name
;
5288 /* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
5291 gimple_omp_critical_clauses (const gomp_critical
*crit_stmt
)
5293 return crit_stmt
->clauses
;
5297 /* Return a pointer to the clauses associated with OMP critical statement
5301 gimple_omp_critical_clauses_ptr (gomp_critical
*crit_stmt
)
5303 return &crit_stmt
->clauses
;
5307 /* Set CLAUSES to be the clauses associated with OMP critical statement
5311 gimple_omp_critical_set_clauses (gomp_critical
*crit_stmt
, tree clauses
)
5313 crit_stmt
->clauses
= clauses
;
5317 /* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
5320 gimple_omp_ordered_clauses (const gomp_ordered
*ord_stmt
)
5322 return ord_stmt
->clauses
;
5326 /* Return a pointer to the clauses associated with OMP ordered statement
5330 gimple_omp_ordered_clauses_ptr (gomp_ordered
*ord_stmt
)
5332 return &ord_stmt
->clauses
;
5336 /* Set CLAUSES to be the clauses associated with OMP ordered statement
5340 gimple_omp_ordered_set_clauses (gomp_ordered
*ord_stmt
, tree clauses
)
5342 ord_stmt
->clauses
= clauses
;
5346 /* Return the clauses associated with OMP_SCAN statement SCAN_STMT. */
5349 gimple_omp_scan_clauses (const gomp_scan
*scan_stmt
)
5351 return scan_stmt
->clauses
;
5355 /* Return a pointer to the clauses associated with OMP scan statement
5359 gimple_omp_scan_clauses_ptr (gomp_scan
*scan_stmt
)
5361 return &scan_stmt
->clauses
;
5365 /* Set CLAUSES to be the clauses associated with OMP scan statement
5369 gimple_omp_scan_set_clauses (gomp_scan
*scan_stmt
, tree clauses
)
5371 scan_stmt
->clauses
= clauses
;
5375 /* Return the clauses associated with OMP_TASKGROUP statement GS. */
5378 gimple_omp_taskgroup_clauses (const gimple
*gs
)
5380 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5382 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5386 /* Return a pointer to the clauses associated with OMP taskgroup statement
5390 gimple_omp_taskgroup_clauses_ptr (gimple
*gs
)
5392 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5393 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5397 /* Set CLAUSES to be the clauses associated with OMP taskgroup statement
5401 gimple_omp_taskgroup_set_clauses (gimple
*gs
, tree clauses
)
5403 GIMPLE_CHECK (gs
, GIMPLE_OMP_TASKGROUP
);
5404 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5409 /* Return the clauses associated with OMP_MASKED statement GS. */
5412 gimple_omp_masked_clauses (const gimple
*gs
)
5414 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5416 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5420 /* Return a pointer to the clauses associated with OMP masked statement
5424 gimple_omp_masked_clauses_ptr (gimple
*gs
)
5426 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5427 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5431 /* Set CLAUSES to be the clauses associated with OMP masked statement
5435 gimple_omp_masked_set_clauses (gimple
*gs
, tree clauses
)
5437 GIMPLE_CHECK (gs
, GIMPLE_OMP_MASKED
);
5438 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5443 /* Return the clauses associated with OMP_SCOPE statement GS. */
5446 gimple_omp_scope_clauses (const gimple
*gs
)
5448 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5450 static_cast <const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5454 /* Return a pointer to the clauses associated with OMP scope statement
5458 gimple_omp_scope_clauses_ptr (gimple
*gs
)
5460 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5461 return &static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5465 /* Set CLAUSES to be the clauses associated with OMP scope statement
5469 gimple_omp_scope_set_clauses (gimple
*gs
, tree clauses
)
5471 GIMPLE_CHECK (gs
, GIMPLE_OMP_SCOPE
);
5472 static_cast <gimple_statement_omp_single_layout
*> (gs
)->clauses
5476 /* Return the clauses associated with OMP_DISPATCH statement GS. */
5479 gimple_omp_dispatch_clauses (const gimple
*gs
)
5481 GIMPLE_CHECK (gs
, GIMPLE_OMP_DISPATCH
);
5482 return static_cast<const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5485 /* Return a pointer to the clauses associated with OMP dispatch statement
5489 gimple_omp_dispatch_clauses_ptr (gimple
*gs
)
5491 GIMPLE_CHECK (gs
, GIMPLE_OMP_DISPATCH
);
5492 return &static_cast<gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5495 /* Set CLAUSES to be the clauses associated with OMP dispatch statement
5499 gimple_omp_dispatch_set_clauses (gimple
*gs
, tree clauses
)
5501 GIMPLE_CHECK (gs
, GIMPLE_OMP_DISPATCH
);
5502 static_cast<gimple_statement_omp_single_layout
*> (gs
)->clauses
= clauses
;
5505 /* Return the clauses associated with OMP_INTEROP statement GS. */
5508 gimple_omp_interop_clauses (const gimple
*gs
)
5510 GIMPLE_CHECK (gs
, GIMPLE_OMP_INTEROP
);
5511 return static_cast<const gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5514 /* Return a pointer to the clauses associated with OMP_INTEROP statement GS. */
5517 gimple_omp_interop_clauses_ptr (gimple
*gs
)
5519 GIMPLE_CHECK (gs
, GIMPLE_OMP_INTEROP
);
5520 return &static_cast<gimple_statement_omp_single_layout
*> (gs
)->clauses
;
5523 /* Set CLAUSES to be the clauses associated with OMP interop statement
5527 gimple_omp_interop_set_clauses (gimple
*gs
, tree clauses
)
5529 GIMPLE_CHECK (gs
, GIMPLE_OMP_INTEROP
);
5530 static_cast<gimple_statement_omp_single_layout
*> (gs
)->clauses
= clauses
;
5533 /* Return the kind of the OMP_FOR statemement G. */
5536 gimple_omp_for_kind (const gimple
*g
)
5538 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5539 return (gimple_omp_subcode (g
) & GF_OMP_FOR_KIND_MASK
);
5543 /* Set the kind of the OMP_FOR statement G. */
5546 gimple_omp_for_set_kind (gomp_for
*g
, int kind
)
5548 g
->subcode
= (g
->subcode
& ~GF_OMP_FOR_KIND_MASK
)
5549 | (kind
& GF_OMP_FOR_KIND_MASK
);
5553 /* Return true if OMP_FOR statement G has the
5554 GF_OMP_FOR_COMBINED flag set. */
5557 gimple_omp_for_combined_p (const gimple
*g
)
5559 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5560 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED
) != 0;
5564 /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
5565 the boolean value of COMBINED_P. */
5568 gimple_omp_for_set_combined_p (gomp_for
*g
, bool combined_p
)
5571 g
->subcode
|= GF_OMP_FOR_COMBINED
;
5573 g
->subcode
&= ~GF_OMP_FOR_COMBINED
;
5577 /* Return true if the OMP_FOR statement G has the
5578 GF_OMP_FOR_COMBINED_INTO flag set. */
5581 gimple_omp_for_combined_into_p (const gimple
*g
)
5583 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
5584 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED_INTO
) != 0;
5588 /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
5589 on the boolean value of COMBINED_P. */
5592 gimple_omp_for_set_combined_into_p (gomp_for
*g
, bool combined_p
)
5595 g
->subcode
|= GF_OMP_FOR_COMBINED_INTO
;
5597 g
->subcode
&= ~GF_OMP_FOR_COMBINED_INTO
;
5601 /* Return the clauses associated with the OMP_FOR statement GS. */
5604 gimple_omp_for_clauses (const gimple
*gs
)
5606 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5607 return omp_for_stmt
->clauses
;
5611 /* Return a pointer to the clauses associated with the OMP_FOR statement
5615 gimple_omp_for_clauses_ptr (gimple
*gs
)
5617 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5618 return &omp_for_stmt
->clauses
;
5622 /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
5626 gimple_omp_for_set_clauses (gimple
*gs
, tree clauses
)
5628 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5629 omp_for_stmt
->clauses
= clauses
;
5633 /* Get the collapse count of the OMP_FOR statement GS. */
5636 gimple_omp_for_collapse (const gimple
*gs
)
5638 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5639 return omp_for_stmt
->collapse
;
5643 /* Return the condition code associated with the OMP_FOR statement GS. */
5645 inline enum tree_code
5646 gimple_omp_for_cond (const gimple
*gs
, size_t i
)
5648 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5649 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5650 return omp_for_stmt
->iter
[i
].cond
;
5654 /* Set COND to be the condition code for the OMP_FOR statement GS. */
5657 gimple_omp_for_set_cond (gimple
*gs
, size_t i
, enum tree_code cond
)
5659 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5660 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond
) == tcc_comparison
5661 && i
< omp_for_stmt
->collapse
);
5662 omp_for_stmt
->iter
[i
].cond
= cond
;
5666 /* Return the index variable for the OMP_FOR statement GS. */
5669 gimple_omp_for_index (const gimple
*gs
, size_t i
)
5671 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5672 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5673 return omp_for_stmt
->iter
[i
].index
;
5677 /* Return a pointer to the index variable for the OMP_FOR statement GS. */
5680 gimple_omp_for_index_ptr (gimple
*gs
, size_t i
)
5682 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5683 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5684 return &omp_for_stmt
->iter
[i
].index
;
5688 /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
5691 gimple_omp_for_set_index (gimple
*gs
, size_t i
, tree index
)
5693 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5694 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5695 omp_for_stmt
->iter
[i
].index
= index
;
5699 /* Return the initial value for the OMP_FOR statement GS. */
5702 gimple_omp_for_initial (const gimple
*gs
, size_t i
)
5704 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5705 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5706 return omp_for_stmt
->iter
[i
].initial
;
5710 /* Return a pointer to the initial value for the OMP_FOR statement GS. */
5713 gimple_omp_for_initial_ptr (gimple
*gs
, size_t i
)
5715 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5716 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5717 return &omp_for_stmt
->iter
[i
].initial
;
5721 /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
5724 gimple_omp_for_set_initial (gimple
*gs
, size_t i
, tree initial
)
5726 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5727 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5728 omp_for_stmt
->iter
[i
].initial
= initial
;
5732 /* Return the final value for the OMP_FOR statement GS. */
5735 gimple_omp_for_final (const gimple
*gs
, size_t i
)
5737 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5738 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5739 return omp_for_stmt
->iter
[i
].final
;
5743 /* Return a pointer to the final value for the OMP_FOR statement GS. */
5746 gimple_omp_for_final_ptr (gimple
*gs
, size_t i
)
5748 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5749 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5750 return &omp_for_stmt
->iter
[i
].final
;
5754 /* Set FINAL to be the final value for the OMP_FOR statement GS. */
5757 gimple_omp_for_set_final (gimple
*gs
, size_t i
, tree final
)
5759 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5760 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5761 omp_for_stmt
->iter
[i
].final
= final
;
5765 /* Return the increment value for the OMP_FOR statement GS. */
5768 gimple_omp_for_incr (const gimple
*gs
, size_t i
)
5770 const gomp_for
*omp_for_stmt
= as_a
<const gomp_for
*> (gs
);
5771 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5772 return omp_for_stmt
->iter
[i
].incr
;
5776 /* Return a pointer to the increment value for the OMP_FOR statement GS. */
5779 gimple_omp_for_incr_ptr (gimple
*gs
, size_t i
)
5781 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5782 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5783 return &omp_for_stmt
->iter
[i
].incr
;
5787 /* Set INCR to be the increment value for the OMP_FOR statement GS. */
5790 gimple_omp_for_set_incr (gimple
*gs
, size_t i
, tree incr
)
5792 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5793 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5794 omp_for_stmt
->iter
[i
].incr
= incr
;
5798 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
5799 statement GS starts. */
5802 gimple_omp_for_pre_body_ptr (gimple
*gs
)
5804 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5805 return &omp_for_stmt
->pre_body
;
5809 /* Return the sequence of statements to execute before the OMP_FOR
5810 statement GS starts. */
5813 gimple_omp_for_pre_body (const gimple
*gs
)
5815 return *gimple_omp_for_pre_body_ptr (const_cast <gimple
*> (gs
));
5819 /* Set PRE_BODY to be the sequence of statements to execute before the
5820 OMP_FOR statement GS starts. */
5823 gimple_omp_for_set_pre_body (gimple
*gs
, gimple_seq pre_body
)
5825 gomp_for
*omp_for_stmt
= as_a
<gomp_for
*> (gs
);
5826 omp_for_stmt
->pre_body
= pre_body
;
5829 /* Return the clauses associated with OMP_PARALLEL GS. */
5832 gimple_omp_parallel_clauses (const gimple
*gs
)
5834 const gomp_parallel
*omp_parallel_stmt
= as_a
<const gomp_parallel
*> (gs
);
5835 return omp_parallel_stmt
->clauses
;
5839 /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
5842 gimple_omp_parallel_clauses_ptr (gomp_parallel
*omp_parallel_stmt
)
5844 return &omp_parallel_stmt
->clauses
;
5848 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
5851 gimple_omp_parallel_set_clauses (gomp_parallel
*omp_parallel_stmt
,
5854 omp_parallel_stmt
->clauses
= clauses
;
5858 /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
5861 gimple_omp_parallel_child_fn (const gomp_parallel
*omp_parallel_stmt
)
5863 return omp_parallel_stmt
->child_fn
;
5866 /* Return a pointer to the child function used to hold the body of
5867 OMP_PARALLEL_STMT. */
5870 gimple_omp_parallel_child_fn_ptr (gomp_parallel
*omp_parallel_stmt
)
5872 return &omp_parallel_stmt
->child_fn
;
5876 /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
5879 gimple_omp_parallel_set_child_fn (gomp_parallel
*omp_parallel_stmt
,
5882 omp_parallel_stmt
->child_fn
= child_fn
;
5886 /* Return the artificial argument used to send variables and values
5887 from the parent to the children threads in OMP_PARALLEL_STMT. */
5890 gimple_omp_parallel_data_arg (const gomp_parallel
*omp_parallel_stmt
)
5892 return omp_parallel_stmt
->data_arg
;
5896 /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
5899 gimple_omp_parallel_data_arg_ptr (gomp_parallel
*omp_parallel_stmt
)
5901 return &omp_parallel_stmt
->data_arg
;
5905 /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
5908 gimple_omp_parallel_set_data_arg (gomp_parallel
*omp_parallel_stmt
,
5911 omp_parallel_stmt
->data_arg
= data_arg
;
5914 /* Return the clauses associated with OMP_TASK GS. */
5917 gimple_omp_task_clauses (const gimple
*gs
)
5919 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
5920 return omp_task_stmt
->clauses
;
5924 /* Return a pointer to the clauses associated with OMP_TASK GS. */
5927 gimple_omp_task_clauses_ptr (gimple
*gs
)
5929 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5930 return &omp_task_stmt
->clauses
;
5934 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5938 gimple_omp_task_set_clauses (gimple
*gs
, tree clauses
)
5940 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
5941 omp_task_stmt
->clauses
= clauses
;
5945 /* Return true if OMP task statement G has the
5946 GF_OMP_TASK_TASKLOOP flag set. */
5949 gimple_omp_task_taskloop_p (const gimple
*g
)
5951 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5952 return (gimple_omp_subcode (g
) & GF_OMP_TASK_TASKLOOP
) != 0;
5956 /* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
5957 value of TASKLOOP_P. */
5960 gimple_omp_task_set_taskloop_p (gimple
*g
, bool taskloop_p
)
5962 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5964 g
->subcode
|= GF_OMP_TASK_TASKLOOP
;
5966 g
->subcode
&= ~GF_OMP_TASK_TASKLOOP
;
5970 /* Return true if OMP task statement G has the
5971 GF_OMP_TASK_TASKWAIT flag set. */
5974 gimple_omp_task_taskwait_p (const gimple
*g
)
5976 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5977 return (gimple_omp_subcode (g
) & GF_OMP_TASK_TASKWAIT
) != 0;
5981 /* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
5982 value of TASKWAIT_P. */
5985 gimple_omp_task_set_taskwait_p (gimple
*g
, bool taskwait_p
)
5987 GIMPLE_CHECK (g
, GIMPLE_OMP_TASK
);
5989 g
->subcode
|= GF_OMP_TASK_TASKWAIT
;
5991 g
->subcode
&= ~GF_OMP_TASK_TASKWAIT
;
5995 /* Return the child function used to hold the body of OMP_TASK GS. */
5998 gimple_omp_task_child_fn (const gimple
*gs
)
6000 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6001 return omp_task_stmt
->child_fn
;
6004 /* Return a pointer to the child function used to hold the body of
6008 gimple_omp_task_child_fn_ptr (gimple
*gs
)
6010 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6011 return &omp_task_stmt
->child_fn
;
6015 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6018 gimple_omp_task_set_child_fn (gimple
*gs
, tree child_fn
)
6020 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6021 omp_task_stmt
->child_fn
= child_fn
;
6025 /* Return the artificial argument used to send variables and values
6026 from the parent to the children threads in OMP_TASK GS. */
6029 gimple_omp_task_data_arg (const gimple
*gs
)
6031 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6032 return omp_task_stmt
->data_arg
;
6036 /* Return a pointer to the data argument for OMP_TASK GS. */
6039 gimple_omp_task_data_arg_ptr (gimple
*gs
)
6041 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6042 return &omp_task_stmt
->data_arg
;
6046 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6049 gimple_omp_task_set_data_arg (gimple
*gs
, tree data_arg
)
6051 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6052 omp_task_stmt
->data_arg
= data_arg
;
6056 /* Return the clauses associated with OMP_TASK GS. */
6059 gimple_omp_taskreg_clauses (const gimple
*gs
)
6061 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
6062 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
6063 return omp_taskreg_stmt
->clauses
;
6067 /* Return a pointer to the clauses associated with OMP_TASK GS. */
6070 gimple_omp_taskreg_clauses_ptr (gimple
*gs
)
6072 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6073 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6074 return &omp_taskreg_stmt
->clauses
;
6078 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
6082 gimple_omp_taskreg_set_clauses (gimple
*gs
, tree clauses
)
6084 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6085 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6086 omp_taskreg_stmt
->clauses
= clauses
;
6090 /* Return the child function used to hold the body of OMP_TASK GS. */
6093 gimple_omp_taskreg_child_fn (const gimple
*gs
)
6095 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
6096 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
6097 return omp_taskreg_stmt
->child_fn
;
6100 /* Return a pointer to the child function used to hold the body of
6104 gimple_omp_taskreg_child_fn_ptr (gimple
*gs
)
6106 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6107 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6108 return &omp_taskreg_stmt
->child_fn
;
6112 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6115 gimple_omp_taskreg_set_child_fn (gimple
*gs
, tree child_fn
)
6117 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6118 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6119 omp_taskreg_stmt
->child_fn
= child_fn
;
6123 /* Return the artificial argument used to send variables and values
6124 from the parent to the children threads in OMP_TASK GS. */
6127 gimple_omp_taskreg_data_arg (const gimple
*gs
)
6129 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
6130 = as_a
<const gimple_statement_omp_taskreg
*> (gs
);
6131 return omp_taskreg_stmt
->data_arg
;
6135 /* Return a pointer to the data argument for OMP_TASK GS. */
6138 gimple_omp_taskreg_data_arg_ptr (gimple
*gs
)
6140 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6141 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6142 return &omp_taskreg_stmt
->data_arg
;
6146 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6149 gimple_omp_taskreg_set_data_arg (gimple
*gs
, tree data_arg
)
6151 gimple_statement_omp_taskreg
*omp_taskreg_stmt
6152 = as_a
<gimple_statement_omp_taskreg
*> (gs
);
6153 omp_taskreg_stmt
->data_arg
= data_arg
;
6157 /* Return the copy function used to hold the body of OMP_TASK GS. */
6160 gimple_omp_task_copy_fn (const gimple
*gs
)
6162 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6163 return omp_task_stmt
->copy_fn
;
6166 /* Return a pointer to the copy function used to hold the body of
6170 gimple_omp_task_copy_fn_ptr (gimple
*gs
)
6172 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6173 return &omp_task_stmt
->copy_fn
;
6177 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
6180 gimple_omp_task_set_copy_fn (gimple
*gs
, tree copy_fn
)
6182 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6183 omp_task_stmt
->copy_fn
= copy_fn
;
6187 /* Return size of the data block in bytes in OMP_TASK GS. */
6190 gimple_omp_task_arg_size (const gimple
*gs
)
6192 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6193 return omp_task_stmt
->arg_size
;
6197 /* Return a pointer to the data block size for OMP_TASK GS. */
6200 gimple_omp_task_arg_size_ptr (gimple
*gs
)
6202 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6203 return &omp_task_stmt
->arg_size
;
6207 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
6210 gimple_omp_task_set_arg_size (gimple
*gs
, tree arg_size
)
6212 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6213 omp_task_stmt
->arg_size
= arg_size
;
6217 /* Return align of the data block in bytes in OMP_TASK GS. */
6220 gimple_omp_task_arg_align (const gimple
*gs
)
6222 const gomp_task
*omp_task_stmt
= as_a
<const gomp_task
*> (gs
);
6223 return omp_task_stmt
->arg_align
;
6227 /* Return a pointer to the data block align for OMP_TASK GS. */
6230 gimple_omp_task_arg_align_ptr (gimple
*gs
)
6232 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6233 return &omp_task_stmt
->arg_align
;
6237 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
6240 gimple_omp_task_set_arg_align (gimple
*gs
, tree arg_align
)
6242 gomp_task
*omp_task_stmt
= as_a
<gomp_task
*> (gs
);
6243 omp_task_stmt
->arg_align
= arg_align
;
6247 /* Return the clauses associated with OMP_SINGLE GS. */
6250 gimple_omp_single_clauses (const gimple
*gs
)
6252 const gomp_single
*omp_single_stmt
= as_a
<const gomp_single
*> (gs
);
6253 return omp_single_stmt
->clauses
;
6257 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
6260 gimple_omp_single_clauses_ptr (gimple
*gs
)
6262 gomp_single
*omp_single_stmt
= as_a
<gomp_single
*> (gs
);
6263 return &omp_single_stmt
->clauses
;
6267 /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
6270 gimple_omp_single_set_clauses (gomp_single
*omp_single_stmt
, tree clauses
)
6272 omp_single_stmt
->clauses
= clauses
;
6276 /* Return the clauses associated with OMP_TARGET GS. */
6279 gimple_omp_target_clauses (const gimple
*gs
)
6281 const gomp_target
*omp_target_stmt
= as_a
<const gomp_target
*> (gs
);
6282 return omp_target_stmt
->clauses
;
6286 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
6289 gimple_omp_target_clauses_ptr (gimple
*gs
)
6291 gomp_target
*omp_target_stmt
= as_a
<gomp_target
*> (gs
);
6292 return &omp_target_stmt
->clauses
;
6296 /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
6299 gimple_omp_target_set_clauses (gomp_target
*omp_target_stmt
,
6302 omp_target_stmt
->clauses
= clauses
;
6306 /* Return the kind of the OMP_TARGET G. */
6309 gimple_omp_target_kind (const gimple
*g
)
6311 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
6312 return (gimple_omp_subcode (g
) & GF_OMP_TARGET_KIND_MASK
);
6316 /* Set the kind of the OMP_TARGET G. */
6319 gimple_omp_target_set_kind (gomp_target
*g
, int kind
)
6321 g
->subcode
= (g
->subcode
& ~GF_OMP_TARGET_KIND_MASK
)
6322 | (kind
& GF_OMP_TARGET_KIND_MASK
);
6326 /* Return the child function used to hold the body of OMP_TARGET_STMT. */
6329 gimple_omp_target_child_fn (const gomp_target
*omp_target_stmt
)
6331 return omp_target_stmt
->child_fn
;
6334 /* Return a pointer to the child function used to hold the body of
6338 gimple_omp_target_child_fn_ptr (gomp_target
*omp_target_stmt
)
6340 return &omp_target_stmt
->child_fn
;
6344 /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
6347 gimple_omp_target_set_child_fn (gomp_target
*omp_target_stmt
,
6350 omp_target_stmt
->child_fn
= child_fn
;
6354 /* Return the artificial argument used to send variables and values
6355 from the parent to the children threads in OMP_TARGET_STMT. */
6358 gimple_omp_target_data_arg (const gomp_target
*omp_target_stmt
)
6360 return omp_target_stmt
->data_arg
;
6364 /* Return a pointer to the data argument for OMP_TARGET GS. */
6367 gimple_omp_target_data_arg_ptr (gomp_target
*omp_target_stmt
)
6369 return &omp_target_stmt
->data_arg
;
6373 /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
6376 gimple_omp_target_set_data_arg (gomp_target
*omp_target_stmt
,
6379 omp_target_stmt
->data_arg
= data_arg
;
6383 /* Return the clauses associated with OMP_TEAMS GS. */
6386 gimple_omp_teams_clauses (const gimple
*gs
)
6388 const gomp_teams
*omp_teams_stmt
= as_a
<const gomp_teams
*> (gs
);
6389 return omp_teams_stmt
->clauses
;
6393 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
6396 gimple_omp_teams_clauses_ptr (gimple
*gs
)
6398 gomp_teams
*omp_teams_stmt
= as_a
<gomp_teams
*> (gs
);
6399 return &omp_teams_stmt
->clauses
;
6403 /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
6406 gimple_omp_teams_set_clauses (gomp_teams
*omp_teams_stmt
, tree clauses
)
6408 omp_teams_stmt
->clauses
= clauses
;
6411 /* Return the child function used to hold the body of OMP_TEAMS_STMT. */
6414 gimple_omp_teams_child_fn (const gomp_teams
*omp_teams_stmt
)
6416 return omp_teams_stmt
->child_fn
;
6419 /* Return a pointer to the child function used to hold the body of
6423 gimple_omp_teams_child_fn_ptr (gomp_teams
*omp_teams_stmt
)
6425 return &omp_teams_stmt
->child_fn
;
6429 /* Set CHILD_FN to be the child function for OMP_TEAMS_STMT. */
6432 gimple_omp_teams_set_child_fn (gomp_teams
*omp_teams_stmt
, tree child_fn
)
6434 omp_teams_stmt
->child_fn
= child_fn
;
6438 /* Return the artificial argument used to send variables and values
6439 from the parent to the children threads in OMP_TEAMS_STMT. */
6442 gimple_omp_teams_data_arg (const gomp_teams
*omp_teams_stmt
)
6444 return omp_teams_stmt
->data_arg
;
6448 /* Return a pointer to the data argument for OMP_TEAMS_STMT. */
6451 gimple_omp_teams_data_arg_ptr (gomp_teams
*omp_teams_stmt
)
6453 return &omp_teams_stmt
->data_arg
;
6457 /* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT. */
6460 gimple_omp_teams_set_data_arg (gomp_teams
*omp_teams_stmt
, tree data_arg
)
6462 omp_teams_stmt
->data_arg
= data_arg
;
6465 /* Return the host flag of an OMP_TEAMS_STMT. */
6468 gimple_omp_teams_host (const gomp_teams
*omp_teams_stmt
)
6470 return (gimple_omp_subcode (omp_teams_stmt
) & GF_OMP_TEAMS_HOST
) != 0;
6473 /* Set host flag of an OMP_TEAMS_STMT to VALUE. */
6476 gimple_omp_teams_set_host (gomp_teams
*omp_teams_stmt
, bool value
)
6479 omp_teams_stmt
->subcode
|= GF_OMP_TEAMS_HOST
;
6481 omp_teams_stmt
->subcode
&= ~GF_OMP_TEAMS_HOST
;
6484 /* Return the clauses associated with OMP_SECTIONS GS. */
6487 gimple_omp_sections_clauses (const gimple
*gs
)
6489 const gomp_sections
*omp_sections_stmt
= as_a
<const gomp_sections
*> (gs
);
6490 return omp_sections_stmt
->clauses
;
6494 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
6497 gimple_omp_sections_clauses_ptr (gimple
*gs
)
6499 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6500 return &omp_sections_stmt
->clauses
;
6504 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
6508 gimple_omp_sections_set_clauses (gimple
*gs
, tree clauses
)
6510 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6511 omp_sections_stmt
->clauses
= clauses
;
6515 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
6519 gimple_omp_sections_control (const gimple
*gs
)
6521 const gomp_sections
*omp_sections_stmt
= as_a
<const gomp_sections
*> (gs
);
6522 return omp_sections_stmt
->control
;
6526 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
6530 gimple_omp_sections_control_ptr (gimple
*gs
)
6532 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6533 return &omp_sections_stmt
->control
;
6537 /* Set CONTROL to be the set of clauses associated with the
6538 GIMPLE_OMP_SECTIONS in GS. */
6541 gimple_omp_sections_set_control (gimple
*gs
, tree control
)
6543 gomp_sections
*omp_sections_stmt
= as_a
<gomp_sections
*> (gs
);
6544 omp_sections_stmt
->control
= control
;
6548 /* Set the value being stored in an atomic store. */
6551 gimple_omp_atomic_store_set_val (gomp_atomic_store
*store_stmt
, tree val
)
6553 store_stmt
->val
= val
;
6557 /* Return the value being stored in an atomic store. */
6560 gimple_omp_atomic_store_val (const gomp_atomic_store
*store_stmt
)
6562 return store_stmt
->val
;
6566 /* Return a pointer to the value being stored in an atomic store. */
6569 gimple_omp_atomic_store_val_ptr (gomp_atomic_store
*store_stmt
)
6571 return &store_stmt
->val
;
6575 /* Set the LHS of an atomic load. */
6578 gimple_omp_atomic_load_set_lhs (gomp_atomic_load
*load_stmt
, tree lhs
)
6580 load_stmt
->lhs
= lhs
;
6584 /* Get the LHS of an atomic load. */
6587 gimple_omp_atomic_load_lhs (const gomp_atomic_load
*load_stmt
)
6589 return load_stmt
->lhs
;
6593 /* Return a pointer to the LHS of an atomic load. */
6596 gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load
*load_stmt
)
6598 return &load_stmt
->lhs
;
6602 /* Set the RHS of an atomic load. */
6605 gimple_omp_atomic_load_set_rhs (gomp_atomic_load
*load_stmt
, tree rhs
)
6607 load_stmt
->rhs
= rhs
;
6611 /* Get the RHS of an atomic load. */
6614 gimple_omp_atomic_load_rhs (const gomp_atomic_load
*load_stmt
)
6616 return load_stmt
->rhs
;
6620 /* Return a pointer to the RHS of an atomic load. */
6623 gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load
*load_stmt
)
6625 return &load_stmt
->rhs
;
6629 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6632 gimple_omp_continue_control_def (const gomp_continue
*cont_stmt
)
6634 return cont_stmt
->control_def
;
6637 /* The same as above, but return the address. */
6640 gimple_omp_continue_control_def_ptr (gomp_continue
*cont_stmt
)
6642 return &cont_stmt
->control_def
;
6645 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6648 gimple_omp_continue_set_control_def (gomp_continue
*cont_stmt
, tree def
)
6650 cont_stmt
->control_def
= def
;
6654 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6657 gimple_omp_continue_control_use (const gomp_continue
*cont_stmt
)
6659 return cont_stmt
->control_use
;
6663 /* The same as above, but return the address. */
6666 gimple_omp_continue_control_use_ptr (gomp_continue
*cont_stmt
)
6668 return &cont_stmt
->control_use
;
6672 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6675 gimple_omp_continue_set_control_use (gomp_continue
*cont_stmt
, tree use
)
6677 cont_stmt
->control_use
= use
;
6680 /* Return the guard associated with the GIMPLE_ASSUME statement GS. */
6683 gimple_assume_guard (const gimple
*gs
)
6685 const gimple_statement_assume
*assume_stmt
6686 = as_a
<const gimple_statement_assume
*> (gs
);
6687 return assume_stmt
->guard
;
6690 /* Set the guard associated with the GIMPLE_ASSUME statement GS. */
6693 gimple_assume_set_guard (gimple
*gs
, tree guard
)
6695 gimple_statement_assume
*assume_stmt
= as_a
<gimple_statement_assume
*> (gs
);
6696 assume_stmt
->guard
= guard
;
6700 gimple_assume_guard_ptr (gimple
*gs
)
6702 gimple_statement_assume
*assume_stmt
= as_a
<gimple_statement_assume
*> (gs
);
6703 return &assume_stmt
->guard
;
6706 /* Return the address of the GIMPLE sequence contained in the GIMPLE_ASSUME
6710 gimple_assume_body_ptr (gimple
*gs
)
6712 gimple_statement_assume
*assume_stmt
= as_a
<gimple_statement_assume
*> (gs
);
6713 return &assume_stmt
->body
;
6716 /* Return the GIMPLE sequence contained in the GIMPLE_ASSUME statement GS. */
6719 gimple_assume_body (const gimple
*gs
)
6721 const gimple_statement_assume
*assume_stmt
6722 = as_a
<const gimple_statement_assume
*> (gs
);
6723 return assume_stmt
->body
;
6726 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
6727 TRANSACTION_STMT. */
6730 gimple_transaction_body_ptr (gtransaction
*transaction_stmt
)
6732 return &transaction_stmt
->body
;
6735 /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
6738 gimple_transaction_body (const gtransaction
*transaction_stmt
)
6740 return transaction_stmt
->body
;
6743 /* Return the label associated with a GIMPLE_TRANSACTION. */
6746 gimple_transaction_label_norm (const gtransaction
*transaction_stmt
)
6748 return transaction_stmt
->label_norm
;
6752 gimple_transaction_label_norm_ptr (gtransaction
*transaction_stmt
)
6754 return &transaction_stmt
->label_norm
;
6758 gimple_transaction_label_uninst (const gtransaction
*transaction_stmt
)
6760 return transaction_stmt
->label_uninst
;
6764 gimple_transaction_label_uninst_ptr (gtransaction
*transaction_stmt
)
6766 return &transaction_stmt
->label_uninst
;
6770 gimple_transaction_label_over (const gtransaction
*transaction_stmt
)
6772 return transaction_stmt
->label_over
;
6776 gimple_transaction_label_over_ptr (gtransaction
*transaction_stmt
)
6778 return &transaction_stmt
->label_over
;
6781 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
6784 gimple_transaction_subcode (const gtransaction
*transaction_stmt
)
6786 return transaction_stmt
->subcode
;
6789 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
6790 TRANSACTION_STMT. */
6793 gimple_transaction_set_body (gtransaction
*transaction_stmt
,
6796 transaction_stmt
->body
= body
;
6799 /* Set the label associated with a GIMPLE_TRANSACTION. */
6802 gimple_transaction_set_label_norm (gtransaction
*transaction_stmt
, tree label
)
6804 transaction_stmt
->label_norm
= label
;
6808 gimple_transaction_set_label_uninst (gtransaction
*transaction_stmt
, tree label
)
6810 transaction_stmt
->label_uninst
= label
;
6814 gimple_transaction_set_label_over (gtransaction
*transaction_stmt
, tree label
)
6816 transaction_stmt
->label_over
= label
;
6819 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
6822 gimple_transaction_set_subcode (gtransaction
*transaction_stmt
,
6823 unsigned int subcode
)
6825 transaction_stmt
->subcode
= subcode
;
6828 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
6831 gimple_return_retval_ptr (greturn
*gs
)
6836 /* Return the return value for GIMPLE_RETURN GS. */
6839 gimple_return_retval (const greturn
*gs
)
6845 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
6848 gimple_return_set_retval (greturn
*gs
, tree retval
)
6854 /* Returns true when the gimple statement STMT is any of the OMP types. */
6856 #define CASE_GIMPLE_OMP \
6857 case GIMPLE_OMP_PARALLEL: \
6858 case GIMPLE_OMP_TASK: \
6859 case GIMPLE_OMP_FOR: \
6860 case GIMPLE_OMP_SECTIONS: \
6861 case GIMPLE_OMP_SECTIONS_SWITCH: \
6862 case GIMPLE_OMP_SINGLE: \
6863 case GIMPLE_OMP_TARGET: \
6864 case GIMPLE_OMP_TEAMS: \
6865 case GIMPLE_OMP_SCOPE: \
6866 case GIMPLE_OMP_DISPATCH: \
6867 case GIMPLE_OMP_INTEROP: \
6868 case GIMPLE_OMP_SECTION: \
6869 case GIMPLE_OMP_STRUCTURED_BLOCK: \
6870 case GIMPLE_OMP_MASTER: \
6871 case GIMPLE_OMP_MASKED: \
6872 case GIMPLE_OMP_TASKGROUP: \
6873 case GIMPLE_OMP_ORDERED: \
6874 case GIMPLE_OMP_CRITICAL: \
6875 case GIMPLE_OMP_SCAN: \
6876 case GIMPLE_OMP_RETURN: \
6877 case GIMPLE_OMP_ATOMIC_LOAD: \
6878 case GIMPLE_OMP_ATOMIC_STORE: \
6879 case GIMPLE_OMP_CONTINUE
6882 is_gimple_omp (const gimple
*stmt
)
6884 switch (gimple_code (stmt
))
6893 /* Return true if the OMP gimple statement STMT is any of the OpenACC types
6897 is_gimple_omp_oacc (const gimple
*stmt
)
6899 gcc_assert (is_gimple_omp (stmt
));
6900 switch (gimple_code (stmt
))
6902 case GIMPLE_OMP_ATOMIC_LOAD
:
6903 case GIMPLE_OMP_ATOMIC_STORE
:
6904 case GIMPLE_OMP_CONTINUE
:
6905 case GIMPLE_OMP_RETURN
:
6906 /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
6910 case GIMPLE_OMP_FOR
:
6911 switch (gimple_omp_for_kind (stmt
))
6913 case GF_OMP_FOR_KIND_OACC_LOOP
:
6918 case GIMPLE_OMP_TARGET
:
6919 switch (gimple_omp_target_kind (stmt
))
6921 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
6922 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
6923 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
6924 case GF_OMP_TARGET_KIND_OACC_DATA
:
6925 case GF_OMP_TARGET_KIND_OACC_UPDATE
:
6926 case GF_OMP_TARGET_KIND_OACC_ENTER_DATA
:
6927 case GF_OMP_TARGET_KIND_OACC_EXIT_DATA
:
6928 case GF_OMP_TARGET_KIND_OACC_DECLARE
:
6929 case GF_OMP_TARGET_KIND_OACC_HOST_DATA
:
6930 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
6931 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
6932 case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS
:
6943 /* Return true if the OMP gimple statement STMT is offloaded. */
6946 is_gimple_omp_offloaded (const gimple
*stmt
)
6948 gcc_assert (is_gimple_omp (stmt
));
6949 switch (gimple_code (stmt
))
6951 case GIMPLE_OMP_TARGET
:
6952 switch (gimple_omp_target_kind (stmt
))
6954 case GF_OMP_TARGET_KIND_REGION
:
6955 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
6956 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
6957 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
6958 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
6959 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
6970 /* Returns TRUE if statement G is a GIMPLE_NOP. */
6973 gimple_nop_p (const gimple
*g
)
6975 return gimple_code (g
) == GIMPLE_NOP
;
6979 /* Return true if GS is a GIMPLE_RESX. */
6982 is_gimple_resx (const gimple
*gs
)
6984 return gimple_code (gs
) == GIMPLE_RESX
;
6988 /* Enum and arrays used for allocation stats. Keep in sync with
6989 gimple.cc:gimple_alloc_kind_names. */
6990 enum gimple_alloc_kind
6992 gimple_alloc_kind_assign
, /* Assignments. */
6993 gimple_alloc_kind_phi
, /* PHI nodes. */
6994 gimple_alloc_kind_cond
, /* Conditionals. */
6995 gimple_alloc_kind_rest
, /* Everything else. */
6996 gimple_alloc_kind_all
6999 extern uint64_t gimple_alloc_counts
[];
7000 extern uint64_t gimple_alloc_sizes
[];
7002 /* Return the allocation kind for a given stmt CODE. */
7003 inline enum gimple_alloc_kind
7004 gimple_alloc_kind (enum gimple_code code
)
7009 return gimple_alloc_kind_assign
;
7011 return gimple_alloc_kind_phi
;
7013 return gimple_alloc_kind_cond
;
7015 return gimple_alloc_kind_rest
;
7019 /* Return true if a location should not be emitted for this statement
7020 by annotate_all_with_location. */
7023 gimple_do_not_emit_location_p (gimple
*g
)
7025 return gimple_plf (g
, GF_PLF_1
);
7028 /* Mark statement G so a location will not be emitted by
7029 annotate_one_with_location. */
7032 gimple_set_do_not_emit_location (gimple
*g
)
7034 /* The PLF flags are initialized to 0 when a new tuple is created,
7035 so no need to initialize it anywhere. */
7036 gimple_set_plf (g
, GF_PLF_1
, true);
7039 #endif /* GCC_GIMPLE_H */