1 /* Gimple IR definitions.
3 Copyright (C) 2007-2014 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 typedef gimple gimple_seq_node
;
27 /* For each block, the PHI nodes that need to be rewritten are stored into
29 typedef vec
<gimple
> gimple_vec
;
32 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
35 LAST_AND_UNUSED_GIMPLE_CODE
38 extern const char *const gimple_code_name
[];
39 extern const unsigned char gimple_rhs_class_table
[];
41 /* Error out if a gimple tuple is addressed incorrectly. */
42 #if defined ENABLE_GIMPLE_CHECKING
43 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
44 extern void gimple_check_failed (const_gimple
, const char *, int, \
45 const char *, enum gimple_code
, \
46 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); \
55 #else /* not ENABLE_GIMPLE_CHECKING */
56 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
57 #define GIMPLE_CHECK(GS, CODE) (void)0
60 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
61 get_gimple_rhs_class. */
64 GIMPLE_INVALID_RHS
, /* The expression cannot be used on the RHS. */
65 GIMPLE_TERNARY_RHS
, /* The expression is a ternary operation. */
66 GIMPLE_BINARY_RHS
, /* The expression is a binary operation. */
67 GIMPLE_UNARY_RHS
, /* The expression is a unary operation. */
68 GIMPLE_SINGLE_RHS
/* The expression is a single object (an SSA
69 name, a _DECL, a _REF, etc. */
72 /* Specific flags for individual GIMPLE statements. These flags are
73 always stored in gimple_statement_base.subcode and they may only be
74 defined for statement codes that do not use subcodes.
76 Values for the masks can overlap as long as the overlapping values
77 are never used in the same statement class.
79 The maximum mask value that can be defined is 1 << 15 (i.e., each
80 statement code can hold up to 16 bitflags).
82 Keep this list sorted. */
84 GF_ASM_INPUT
= 1 << 0,
85 GF_ASM_VOLATILE
= 1 << 1,
86 GF_CALL_FROM_THUNK
= 1 << 0,
87 GF_CALL_RETURN_SLOT_OPT
= 1 << 1,
88 GF_CALL_TAILCALL
= 1 << 2,
89 GF_CALL_VA_ARG_PACK
= 1 << 3,
90 GF_CALL_NOTHROW
= 1 << 4,
91 GF_CALL_ALLOCA_FOR_VAR
= 1 << 5,
92 GF_CALL_INTERNAL
= 1 << 6,
93 GF_CALL_CTRL_ALTERING
= 1 << 7,
94 GF_CALL_WITH_BOUNDS
= 1 << 8,
95 GF_OMP_PARALLEL_COMBINED
= 1 << 0,
96 GF_OMP_FOR_KIND_MASK
= 7 << 0,
97 GF_OMP_FOR_KIND_FOR
= 0,
98 GF_OMP_FOR_KIND_DISTRIBUTE
= 1,
99 GF_OMP_FOR_KIND_CILKFOR
= 2,
100 /* Flag for SIMD variants of OMP_FOR kinds. */
101 GF_OMP_FOR_SIMD
= 1 << 2,
102 GF_OMP_FOR_KIND_SIMD
= GF_OMP_FOR_SIMD
| 0,
103 GF_OMP_FOR_KIND_CILKSIMD
= GF_OMP_FOR_SIMD
| 1,
104 GF_OMP_FOR_COMBINED
= 1 << 3,
105 GF_OMP_FOR_COMBINED_INTO
= 1 << 4,
106 GF_OMP_TARGET_KIND_MASK
= (1 << 2) - 1,
107 GF_OMP_TARGET_KIND_REGION
= 0,
108 GF_OMP_TARGET_KIND_DATA
= 1,
109 GF_OMP_TARGET_KIND_UPDATE
= 2,
111 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
112 a thread synchronization via some sort of barrier. The exact barrier
113 that would otherwise be emitted is dependent on the OMP statement with
114 which this return is associated. */
115 GF_OMP_RETURN_NOWAIT
= 1 << 0,
117 GF_OMP_SECTION_LAST
= 1 << 0,
118 GF_OMP_ATOMIC_NEED_VALUE
= 1 << 0,
119 GF_OMP_ATOMIC_SEQ_CST
= 1 << 1,
120 GF_PREDICT_TAKEN
= 1 << 15
123 /* Currently, there are only two types of gimple debug stmt. Others are
124 envisioned, for example, to enable the generation of is_stmt notes
125 in line number information, to mark sequence points, etc. This
126 subcode is to be used to tell them apart. */
127 enum gimple_debug_subcode
{
128 GIMPLE_DEBUG_BIND
= 0,
129 GIMPLE_DEBUG_SOURCE_BIND
= 1
132 /* Masks for selecting a pass local flag (PLF) to work on. These
133 masks are used by gimple_set_plf and gimple_plf. */
139 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
140 are for 64 bit hosts. */
142 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
143 chain_next ("%h.next"), variable_size
))
144 gimple_statement_base
147 Main identifying code for a tuple. */
148 ENUM_BITFIELD(gimple_code
) code
: 8;
150 /* Nonzero if a warning should not be emitted on this tuple. */
151 unsigned int no_warning
: 1;
153 /* Nonzero if this tuple has been visited. Passes are responsible
154 for clearing this bit before using it. */
155 unsigned int visited
: 1;
157 /* Nonzero if this tuple represents a non-temporal move. */
158 unsigned int nontemporal_move
: 1;
160 /* Pass local flags. These flags are free for any pass to use as
161 they see fit. Passes should not assume that these flags contain
162 any useful value when the pass starts. Any initial state that
163 the pass requires should be set on entry to the pass. See
164 gimple_set_plf and gimple_plf for usage. */
165 unsigned int plf
: 2;
167 /* Nonzero if this statement has been modified and needs to have its
168 operands rescanned. */
169 unsigned modified
: 1;
171 /* Nonzero if this statement contains volatile operands. */
172 unsigned has_volatile_ops
: 1;
174 /* Padding to get subcode to 16 bit alignment. */
177 /* The SUBCODE field can be used for tuple-specific flags for tuples
178 that do not require subcodes. Note that SUBCODE should be at
179 least as wide as tree codes, as several tuples store tree codes
181 unsigned int subcode
: 16;
183 /* UID of this statement. This is used by passes that want to
184 assign IDs to statements. It must be assigned and used by each
185 pass. By default it should be assumed to contain garbage. */
189 Locus information for debug info. */
192 /* Number of operands in this tuple. */
196 Basic block holding this statement. */
200 Linked lists of gimple statements. The next pointers form
201 a NULL terminated list, the prev pointers are a cyclic list.
202 A gimple statement is hence also a double-ended list of
203 statements, with the pointer itself being the first element,
204 and the prev pointer being the last. */
206 gimple
GTY((skip
)) prev
;
210 /* Base structure for tuples with operands. */
212 /* This gimple subclass has no tag value. */
214 gimple_statement_with_ops_base
: public gimple_statement_base
216 /* [ WORD 1-6 ] : base class */
219 SSA operand vectors. NOTE: It should be possible to
220 amalgamate these vectors with the operand vector OP. However,
221 the SSA operand vectors are organized differently and contain
222 more information (like immediate use chaining). */
223 struct use_optype_d
GTY((skip (""))) *use_ops
;
227 /* Statements that take register operands. */
229 struct GTY((tag("GSS_WITH_OPS")))
230 gimple_statement_with_ops
: public gimple_statement_with_ops_base
232 /* [ WORD 1-7 ] : base class */
235 Operand vector. NOTE! This must always be the last field
236 of this structure. In particular, this means that this
237 structure cannot be embedded inside another one. */
238 tree
GTY((length ("%h.num_ops"))) op
[1];
242 /* Base for statements that take both memory and register operands. */
244 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
245 gimple_statement_with_memory_ops_base
: public gimple_statement_with_ops_base
247 /* [ WORD 1-7 ] : base class */
250 Virtual operands for this statement. The GC will pick them
251 up via the ssa_names array. */
252 tree
GTY((skip (""))) vdef
;
253 tree
GTY((skip (""))) vuse
;
257 /* Statements that take both memory and register operands. */
259 struct GTY((tag("GSS_WITH_MEM_OPS")))
260 gimple_statement_with_memory_ops
:
261 public gimple_statement_with_memory_ops_base
263 /* [ WORD 1-9 ] : base class */
266 Operand vector. NOTE! This must always be the last field
267 of this structure. In particular, this means that this
268 structure cannot be embedded inside another one. */
269 tree
GTY((length ("%h.num_ops"))) op
[1];
273 /* Call statements that take both memory and register operands. */
275 struct GTY((tag("GSS_CALL")))
276 gimple_statement_call
: public gimple_statement_with_memory_ops_base
278 /* [ WORD 1-9 ] : base class */
281 struct pt_solution call_used
;
282 struct pt_solution call_clobbered
;
285 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
286 tree
GTY ((tag ("0"))) fntype
;
287 enum internal_fn
GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn
;
291 Operand vector. NOTE! This must always be the last field
292 of this structure. In particular, this means that this
293 structure cannot be embedded inside another one. */
294 tree
GTY((length ("%h.num_ops"))) op
[1];
298 /* OpenMP statements (#pragma omp). */
300 struct GTY((tag("GSS_OMP")))
301 gimple_statement_omp
: public gimple_statement_base
303 /* [ WORD 1-6 ] : base class */
312 struct GTY((tag("GSS_BIND")))
313 gimple_statement_bind
: public gimple_statement_base
315 /* [ WORD 1-6 ] : base class */
318 Variables declared in this scope. */
322 This is different than the BLOCK field in gimple_statement_base,
323 which is analogous to TREE_BLOCK (i.e., the lexical block holding
324 this statement). This field is the equivalent of BIND_EXPR_BLOCK
325 in tree land (i.e., the lexical scope defined by this bind). See
336 struct GTY((tag("GSS_CATCH")))
337 gimple_statement_catch
: public gimple_statement_base
339 /* [ WORD 1-6 ] : base class */
349 /* GIMPLE_EH_FILTER */
351 struct GTY((tag("GSS_EH_FILTER")))
352 gimple_statement_eh_filter
: public gimple_statement_base
354 /* [ WORD 1-6 ] : base class */
367 struct GTY((tag("GSS_EH_ELSE")))
368 gimple_statement_eh_else
: public gimple_statement_base
370 /* [ WORD 1-6 ] : base class */
373 gimple_seq n_body
, e_body
;
376 /* GIMPLE_EH_MUST_NOT_THROW */
378 struct GTY((tag("GSS_EH_MNT")))
379 gimple_statement_eh_mnt
: public gimple_statement_base
381 /* [ WORD 1-6 ] : base class */
383 /* [ WORD 7 ] Abort function decl. */
389 struct GTY((tag("GSS_PHI")))
390 gimple_statement_phi
: public gimple_statement_base
392 /* [ WORD 1-6 ] : base class */
402 struct phi_arg_d
GTY ((length ("%h.nargs"))) args
[1];
406 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
408 struct GTY((tag("GSS_EH_CTRL")))
409 gimple_statement_eh_ctrl
: public gimple_statement_base
411 /* [ WORD 1-6 ] : base class */
414 Exception region number. */
418 struct GTY((tag("GSS_EH_CTRL")))
419 gimple_statement_resx
: public gimple_statement_eh_ctrl
421 /* No extra fields; adds invariant:
422 stmt->code == GIMPLE_RESX. */
425 struct GTY((tag("GSS_EH_CTRL")))
426 gimple_statement_eh_dispatch
: public gimple_statement_eh_ctrl
428 /* No extra fields; adds invariant:
429 stmt->code == GIMPLE_EH_DISPATH. */
435 struct GTY((tag("GSS_TRY")))
436 gimple_statement_try
: public gimple_statement_base
438 /* [ WORD 1-6 ] : base class */
441 Expression to evaluate. */
445 Cleanup expression. */
449 /* Kind of GIMPLE_TRY statements. */
450 enum gimple_try_flags
453 GIMPLE_TRY_CATCH
= 1 << 0,
456 GIMPLE_TRY_FINALLY
= 1 << 1,
457 GIMPLE_TRY_KIND
= GIMPLE_TRY_CATCH
| GIMPLE_TRY_FINALLY
,
459 /* Analogous to TRY_CATCH_IS_CLEANUP. */
460 GIMPLE_TRY_CATCH_IS_CLEANUP
= 1 << 2
463 /* GIMPLE_WITH_CLEANUP_EXPR */
465 struct GTY((tag("GSS_WCE")))
466 gimple_statement_wce
: public gimple_statement_base
468 /* [ WORD 1-6 ] : base class */
470 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
471 executed if an exception is thrown, not on normal exit of its
472 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
476 Cleanup expression. */
483 struct GTY((tag("GSS_ASM")))
484 gimple_statement_asm
: public gimple_statement_with_memory_ops_base
486 /* [ WORD 1-9 ] : base class */
489 __asm__ statement. */
493 Number of inputs, outputs, clobbers, labels. */
500 Operand vector. NOTE! This must always be the last field
501 of this structure. In particular, this means that this
502 structure cannot be embedded inside another one. */
503 tree
GTY((length ("%h.num_ops"))) op
[1];
506 /* GIMPLE_OMP_CRITICAL */
508 struct GTY((tag("GSS_OMP_CRITICAL")))
509 gimple_statement_omp_critical
: public gimple_statement_omp
511 /* [ WORD 1-7 ] : base class */
514 Critical section name. */
519 struct GTY(()) gimple_omp_for_iter
{
520 /* Condition code. */
523 /* Index variable. */
538 struct GTY((tag("GSS_OMP_FOR")))
539 gimple_statement_omp_for
: public gimple_statement_omp
541 /* [ WORD 1-7 ] : base class */
547 Number of elements in iter array. */
551 struct gimple_omp_for_iter
* GTY((length ("%h.collapse"))) iter
;
554 Pre-body evaluated before the loop body begins. */
559 /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET */
560 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
561 gimple_statement_omp_parallel_layout
: public gimple_statement_omp
563 /* [ WORD 1-7 ] : base class */
570 Child function holding the body of the parallel region. */
574 Shared data argument. */
578 /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
579 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
580 gimple_statement_omp_taskreg
: public gimple_statement_omp_parallel_layout
582 /* No extra fields; adds invariant:
583 stmt->code == GIMPLE_OMP_PARALLEL
584 || stmt->code == GIMPLE_OMP_TASK. */
588 /* GIMPLE_OMP_PARALLEL */
589 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
590 gimple_statement_omp_parallel
: public gimple_statement_omp_taskreg
592 /* No extra fields; adds invariant:
593 stmt->code == GIMPLE_OMP_PARALLEL. */
596 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
597 gimple_statement_omp_target
: public gimple_statement_omp_parallel_layout
599 /* No extra fields; adds invariant:
600 stmt->code == GIMPLE_OMP_TARGET. */
603 /* GIMPLE_OMP_TASK */
605 struct GTY((tag("GSS_OMP_TASK")))
606 gimple_statement_omp_task
: public gimple_statement_omp_taskreg
608 /* [ WORD 1-10 ] : base class */
611 Child function holding firstprivate initialization if needed. */
615 Size and alignment in bytes of the argument data block. */
621 /* GIMPLE_OMP_SECTION */
622 /* Uses struct gimple_statement_omp. */
625 /* GIMPLE_OMP_SECTIONS */
627 struct GTY((tag("GSS_OMP_SECTIONS")))
628 gimple_statement_omp_sections
: public gimple_statement_omp
630 /* [ WORD 1-7 ] : base class */
636 The control variable used for deciding which of the sections to
641 /* GIMPLE_OMP_CONTINUE.
643 Note: This does not inherit from gimple_statement_omp, because we
644 do not need the body field. */
646 struct GTY((tag("GSS_OMP_CONTINUE")))
647 gimple_statement_omp_continue
: public gimple_statement_base
649 /* [ WORD 1-6 ] : base class */
658 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
660 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
661 gimple_statement_omp_single_layout
: public gimple_statement_omp
663 /* [ WORD 1-7 ] : base class */
669 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
670 gimple_statement_omp_single
: public gimple_statement_omp_single_layout
672 /* No extra fields; adds invariant:
673 stmt->code == GIMPLE_OMP_SINGLE. */
676 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
677 gimple_statement_omp_teams
: public gimple_statement_omp_single_layout
679 /* No extra fields; adds invariant:
680 stmt->code == GIMPLE_OMP_TEAMS. */
684 /* GIMPLE_OMP_ATOMIC_LOAD.
685 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
686 contains a sequence, which we don't need here. */
688 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
689 gimple_statement_omp_atomic_load
: public gimple_statement_base
691 /* [ WORD 1-6 ] : base class */
697 /* GIMPLE_OMP_ATOMIC_STORE.
698 See note on GIMPLE_OMP_ATOMIC_LOAD. */
700 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
701 gimple_statement_omp_atomic_store_layout
: public gimple_statement_base
703 /* [ WORD 1-6 ] : base class */
709 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
710 gimple_statement_omp_atomic_store
:
711 public gimple_statement_omp_atomic_store_layout
713 /* No extra fields; adds invariant:
714 stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
717 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
718 gimple_statement_omp_return
:
719 public gimple_statement_omp_atomic_store_layout
721 /* No extra fields; adds invariant:
722 stmt->code == GIMPLE_OMP_RETURN. */
725 /* GIMPLE_TRANSACTION. */
727 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
729 /* The __transaction_atomic was declared [[outer]] or it is
730 __transaction_relaxed. */
731 #define GTMA_IS_OUTER (1u << 0)
732 #define GTMA_IS_RELAXED (1u << 1)
733 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
735 /* The transaction is seen to not have an abort. */
736 #define GTMA_HAVE_ABORT (1u << 2)
737 /* The transaction is seen to have loads or stores. */
738 #define GTMA_HAVE_LOAD (1u << 3)
739 #define GTMA_HAVE_STORE (1u << 4)
740 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
741 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
742 /* The transaction WILL enter serial irrevocable mode.
743 An irrevocable block post-dominates the entire transaction, such
744 that all invocations of the transaction will go serial-irrevocable.
745 In such case, we don't bother instrumenting the transaction, and
746 tell the runtime that it should begin the transaction in
747 serial-irrevocable mode. */
748 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
749 /* The transaction contains no instrumentation code whatsover, most
750 likely because it is guaranteed to go irrevocable upon entry. */
751 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
753 struct GTY((tag("GSS_TRANSACTION")))
754 gimple_statement_transaction
: public gimple_statement_with_memory_ops_base
756 /* [ WORD 1-9 ] : base class */
765 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
766 enum gimple_statement_structure_enum
{
767 #include "gsstruct.def"
775 is_a_helper
<gimple_statement_asm
*>::test (gimple gs
)
777 return gs
->code
== GIMPLE_ASM
;
783 is_a_helper
<gimple_statement_bind
*>::test (gimple gs
)
785 return gs
->code
== GIMPLE_BIND
;
791 is_a_helper
<gimple_statement_call
*>::test (gimple gs
)
793 return gs
->code
== GIMPLE_CALL
;
799 is_a_helper
<gimple_statement_catch
*>::test (gimple gs
)
801 return gs
->code
== GIMPLE_CATCH
;
807 is_a_helper
<gimple_statement_resx
*>::test (gimple gs
)
809 return gs
->code
== GIMPLE_RESX
;
815 is_a_helper
<gimple_statement_eh_dispatch
*>::test (gimple gs
)
817 return gs
->code
== GIMPLE_EH_DISPATCH
;
823 is_a_helper
<gimple_statement_eh_else
*>::test (gimple gs
)
825 return gs
->code
== GIMPLE_EH_ELSE
;
831 is_a_helper
<gimple_statement_eh_filter
*>::test (gimple gs
)
833 return gs
->code
== GIMPLE_EH_FILTER
;
839 is_a_helper
<gimple_statement_eh_mnt
*>::test (gimple gs
)
841 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
847 is_a_helper
<gimple_statement_omp_atomic_load
*>::test (gimple gs
)
849 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
855 is_a_helper
<gimple_statement_omp_atomic_store
*>::test (gimple gs
)
857 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
863 is_a_helper
<gimple_statement_omp_return
*>::test (gimple gs
)
865 return gs
->code
== GIMPLE_OMP_RETURN
;
871 is_a_helper
<gimple_statement_omp_continue
*>::test (gimple gs
)
873 return gs
->code
== GIMPLE_OMP_CONTINUE
;
879 is_a_helper
<gimple_statement_omp_critical
*>::test (gimple gs
)
881 return gs
->code
== GIMPLE_OMP_CRITICAL
;
887 is_a_helper
<gimple_statement_omp_for
*>::test (gimple gs
)
889 return gs
->code
== GIMPLE_OMP_FOR
;
895 is_a_helper
<gimple_statement_omp_taskreg
*>::test (gimple gs
)
897 return gs
->code
== GIMPLE_OMP_PARALLEL
|| gs
->code
== GIMPLE_OMP_TASK
;
903 is_a_helper
<gimple_statement_omp_parallel
*>::test (gimple gs
)
905 return gs
->code
== GIMPLE_OMP_PARALLEL
;
911 is_a_helper
<gimple_statement_omp_target
*>::test (gimple gs
)
913 return gs
->code
== GIMPLE_OMP_TARGET
;
919 is_a_helper
<gimple_statement_omp_sections
*>::test (gimple gs
)
921 return gs
->code
== GIMPLE_OMP_SECTIONS
;
927 is_a_helper
<gimple_statement_omp_single
*>::test (gimple gs
)
929 return gs
->code
== GIMPLE_OMP_SINGLE
;
935 is_a_helper
<gimple_statement_omp_teams
*>::test (gimple gs
)
937 return gs
->code
== GIMPLE_OMP_TEAMS
;
943 is_a_helper
<gimple_statement_omp_task
*>::test (gimple gs
)
945 return gs
->code
== GIMPLE_OMP_TASK
;
951 is_a_helper
<gimple_statement_phi
*>::test (gimple gs
)
953 return gs
->code
== GIMPLE_PHI
;
959 is_a_helper
<gimple_statement_transaction
*>::test (gimple gs
)
961 return gs
->code
== GIMPLE_TRANSACTION
;
967 is_a_helper
<gimple_statement_try
*>::test (gimple gs
)
969 return gs
->code
== GIMPLE_TRY
;
975 is_a_helper
<gimple_statement_wce
*>::test (gimple gs
)
977 return gs
->code
== GIMPLE_WITH_CLEANUP_EXPR
;
983 is_a_helper
<const gimple_statement_asm
*>::test (const_gimple gs
)
985 return gs
->code
== GIMPLE_ASM
;
991 is_a_helper
<const gimple_statement_bind
*>::test (const_gimple gs
)
993 return gs
->code
== GIMPLE_BIND
;
999 is_a_helper
<const gimple_statement_call
*>::test (const_gimple gs
)
1001 return gs
->code
== GIMPLE_CALL
;
1007 is_a_helper
<const gimple_statement_catch
*>::test (const_gimple gs
)
1009 return gs
->code
== GIMPLE_CATCH
;
1015 is_a_helper
<const gimple_statement_resx
*>::test (const_gimple gs
)
1017 return gs
->code
== GIMPLE_RESX
;
1023 is_a_helper
<const gimple_statement_eh_dispatch
*>::test (const_gimple gs
)
1025 return gs
->code
== GIMPLE_EH_DISPATCH
;
1031 is_a_helper
<const gimple_statement_eh_filter
*>::test (const_gimple gs
)
1033 return gs
->code
== GIMPLE_EH_FILTER
;
1039 is_a_helper
<const gimple_statement_omp_atomic_load
*>::test (const_gimple gs
)
1041 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1047 is_a_helper
<const gimple_statement_omp_atomic_store
*>::test (const_gimple gs
)
1049 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1055 is_a_helper
<const gimple_statement_omp_return
*>::test (const_gimple gs
)
1057 return gs
->code
== GIMPLE_OMP_RETURN
;
1063 is_a_helper
<const gimple_statement_omp_continue
*>::test (const_gimple gs
)
1065 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1071 is_a_helper
<const gimple_statement_omp_critical
*>::test (const_gimple gs
)
1073 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1079 is_a_helper
<const gimple_statement_omp_for
*>::test (const_gimple gs
)
1081 return gs
->code
== GIMPLE_OMP_FOR
;
1087 is_a_helper
<const gimple_statement_omp_taskreg
*>::test (const_gimple gs
)
1089 return gs
->code
== GIMPLE_OMP_PARALLEL
|| gs
->code
== GIMPLE_OMP_TASK
;
1095 is_a_helper
<const gimple_statement_omp_parallel
*>::test (const_gimple gs
)
1097 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1103 is_a_helper
<const gimple_statement_omp_target
*>::test (const_gimple gs
)
1105 return gs
->code
== GIMPLE_OMP_TARGET
;
1111 is_a_helper
<const gimple_statement_omp_sections
*>::test (const_gimple gs
)
1113 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1119 is_a_helper
<const gimple_statement_omp_single
*>::test (const_gimple gs
)
1121 return gs
->code
== GIMPLE_OMP_SINGLE
;
1127 is_a_helper
<const gimple_statement_omp_teams
*>::test (const_gimple gs
)
1129 return gs
->code
== GIMPLE_OMP_TEAMS
;
1135 is_a_helper
<const gimple_statement_omp_task
*>::test (const_gimple gs
)
1137 return gs
->code
== GIMPLE_OMP_TASK
;
1143 is_a_helper
<const gimple_statement_phi
*>::test (const_gimple gs
)
1145 return gs
->code
== GIMPLE_PHI
;
1151 is_a_helper
<const gimple_statement_transaction
*>::test (const_gimple gs
)
1153 return gs
->code
== GIMPLE_TRANSACTION
;
1156 /* Offset in bytes to the location of the operand vector.
1157 Zero if there is no operand vector for this tuple structure. */
1158 extern size_t const gimple_ops_offset_
[];
1160 /* Map GIMPLE codes to GSS codes. */
1161 extern enum gimple_statement_structure_enum
const gss_for_code_
[];
1163 /* This variable holds the currently expanded gimple statement for purposes
1164 of comminucating the profile info to the builtin expanders. */
1165 extern gimple currently_expanding_gimple_stmt
;
1167 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
1168 gimple
gimple_alloc_stat (enum gimple_code
, unsigned MEM_STAT_DECL
);
1169 gimple
gimple_build_return (tree
);
1170 void gimple_call_reset_alias_info (gimple
);
1171 gimple
gimple_build_call_vec (tree
, vec
<tree
> );
1172 gimple
gimple_build_call (tree
, unsigned, ...);
1173 gimple
gimple_build_call_valist (tree
, unsigned, va_list);
1174 gimple
gimple_build_call_internal (enum internal_fn
, unsigned, ...);
1175 gimple
gimple_build_call_internal_vec (enum internal_fn
, vec
<tree
> );
1176 gimple
gimple_build_call_from_tree (tree
);
1177 gimple
gimple_build_assign_stat (tree
, tree MEM_STAT_DECL
);
1178 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
1179 gimple
gimple_build_assign_with_ops (enum tree_code
, tree
,
1180 tree
, tree
, tree CXX_MEM_STAT_INFO
);
1181 gimple
gimple_build_assign_with_ops (enum tree_code
, tree
,
1182 tree
, tree CXX_MEM_STAT_INFO
);
1183 gimple
gimple_build_cond (enum tree_code
, tree
, tree
, tree
, tree
);
1184 gimple
gimple_build_cond_from_tree (tree
, tree
, tree
);
1185 void gimple_cond_set_condition_from_tree (gimple
, tree
);
1186 gimple
gimple_build_label (tree label
);
1187 gimple
gimple_build_goto (tree dest
);
1188 gimple
gimple_build_nop (void);
1189 gimple
gimple_build_bind (tree
, gimple_seq
, tree
);
1190 gimple
gimple_build_asm_vec (const char *, vec
<tree
, va_gc
> *,
1191 vec
<tree
, va_gc
> *, vec
<tree
, va_gc
> *,
1192 vec
<tree
, va_gc
> *);
1193 gimple
gimple_build_catch (tree
, gimple_seq
);
1194 gimple
gimple_build_eh_filter (tree
, gimple_seq
);
1195 gimple
gimple_build_eh_must_not_throw (tree
);
1196 gimple
gimple_build_eh_else (gimple_seq
, gimple_seq
);
1197 gimple_statement_try
*gimple_build_try (gimple_seq
, gimple_seq
,
1198 enum gimple_try_flags
);
1199 gimple
gimple_build_wce (gimple_seq
);
1200 gimple
gimple_build_resx (int);
1201 gimple
gimple_build_switch_nlabels (unsigned, tree
, tree
);
1202 gimple
gimple_build_switch (tree
, tree
, vec
<tree
> );
1203 gimple
gimple_build_eh_dispatch (int);
1204 gimple
gimple_build_debug_bind_stat (tree
, tree
, gimple MEM_STAT_DECL
);
1205 #define gimple_build_debug_bind(var,val,stmt) \
1206 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1207 gimple
gimple_build_debug_source_bind_stat (tree
, tree
, gimple MEM_STAT_DECL
);
1208 #define gimple_build_debug_source_bind(var,val,stmt) \
1209 gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1210 gimple
gimple_build_omp_critical (gimple_seq
, tree
);
1211 gimple
gimple_build_omp_for (gimple_seq
, int, tree
, size_t, gimple_seq
);
1212 gimple
gimple_build_omp_parallel (gimple_seq
, tree
, tree
, tree
);
1213 gimple
gimple_build_omp_task (gimple_seq
, tree
, tree
, tree
, tree
, tree
, tree
);
1214 gimple
gimple_build_omp_section (gimple_seq
);
1215 gimple
gimple_build_omp_master (gimple_seq
);
1216 gimple
gimple_build_omp_taskgroup (gimple_seq
);
1217 gimple
gimple_build_omp_continue (tree
, tree
);
1218 gimple
gimple_build_omp_ordered (gimple_seq
);
1219 gimple
gimple_build_omp_return (bool);
1220 gimple
gimple_build_omp_sections (gimple_seq
, tree
);
1221 gimple
gimple_build_omp_sections_switch (void);
1222 gimple
gimple_build_omp_single (gimple_seq
, tree
);
1223 gimple
gimple_build_omp_target (gimple_seq
, int, tree
);
1224 gimple
gimple_build_omp_teams (gimple_seq
, tree
);
1225 gimple
gimple_build_omp_atomic_load (tree
, tree
);
1226 gimple
gimple_build_omp_atomic_store (tree
);
1227 gimple
gimple_build_transaction (gimple_seq
, tree
);
1228 gimple
gimple_build_predict (enum br_predictor
, enum prediction
);
1229 extern void gimple_seq_add_stmt (gimple_seq
*, gimple
);
1230 extern void gimple_seq_add_stmt_without_update (gimple_seq
*, gimple
);
1231 void gimple_seq_add_seq (gimple_seq
*, gimple_seq
);
1232 void gimple_seq_add_seq_without_update (gimple_seq
*, gimple_seq
);
1233 extern void annotate_all_with_location_after (gimple_seq
, gimple_stmt_iterator
,
1235 extern void annotate_all_with_location (gimple_seq
, location_t
);
1236 bool empty_body_p (gimple_seq
);
1237 gimple_seq
gimple_seq_copy (gimple_seq
);
1238 bool gimple_call_same_target_p (const_gimple
, const_gimple
);
1239 int gimple_call_flags (const_gimple
);
1240 int gimple_call_arg_flags (const_gimple
, unsigned);
1241 int gimple_call_return_flags (const_gimple
);
1242 bool gimple_assign_copy_p (gimple
);
1243 bool gimple_assign_ssa_name_copy_p (gimple
);
1244 bool gimple_assign_unary_nop_p (gimple
);
1245 void gimple_set_bb (gimple
, basic_block
);
1246 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator
*, tree
);
1247 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator
*, enum tree_code
,
1249 tree
gimple_get_lhs (const_gimple
);
1250 void gimple_set_lhs (gimple
, tree
);
1251 gimple
gimple_copy (gimple
);
1252 bool gimple_has_side_effects (const_gimple
);
1253 bool gimple_could_trap_p_1 (gimple
, bool, bool);
1254 bool gimple_could_trap_p (gimple
);
1255 bool gimple_assign_rhs_could_trap_p (gimple
);
1256 extern void dump_gimple_statistics (void);
1257 unsigned get_gimple_rhs_num_ops (enum tree_code
);
1258 extern tree
canonicalize_cond_expr_cond (tree
);
1259 gimple
gimple_call_copy_skip_args (gimple
, bitmap
);
1260 extern bool gimple_compare_field_offset (tree
, tree
);
1261 extern tree
gimple_unsigned_type (tree
);
1262 extern tree
gimple_signed_type (tree
);
1263 extern alias_set_type
gimple_get_alias_set (tree
);
1264 extern bool gimple_ior_addresses_taken (bitmap
, gimple
);
1265 extern bool gimple_builtin_call_types_compatible_p (const_gimple
, tree
);
1266 extern bool gimple_call_builtin_p (const_gimple
);
1267 extern bool gimple_call_builtin_p (const_gimple
, enum built_in_class
);
1268 extern bool gimple_call_builtin_p (const_gimple
, enum built_in_function
);
1269 extern bool gimple_asm_clobbers_memory_p (const_gimple
);
1270 extern void dump_decl_set (FILE *, bitmap
);
1271 extern bool nonfreeing_call_p (gimple
);
1272 extern bool infer_nonnull_range (gimple
, tree
, bool, bool);
1273 extern void sort_case_labels (vec
<tree
>);
1274 extern void preprocess_case_label_vec_for_gimple (vec
<tree
>, tree
, tree
*);
1275 extern void gimple_seq_set_location (gimple_seq
, location_t
);
1276 extern void gimple_seq_discard (gimple_seq
);
1278 /* Formal (expression) temporary table handling: multiple occurrences of
1279 the same scalar expression are evaluated into the same temporary. */
1281 typedef struct gimple_temp_hash_elt
1284 tree temp
; /* Value */
1287 /* Get the number of the next statement uid to be allocated. */
1288 static inline unsigned int
1289 gimple_stmt_max_uid (struct function
*fn
)
1291 return fn
->last_stmt_uid
;
1294 /* Set the number of the next statement uid to be allocated. */
1296 set_gimple_stmt_max_uid (struct function
*fn
, unsigned int maxid
)
1298 fn
->last_stmt_uid
= maxid
;
1301 /* Set the number of the next statement uid to be allocated. */
1302 static inline unsigned int
1303 inc_gimple_stmt_max_uid (struct function
*fn
)
1305 return fn
->last_stmt_uid
++;
1308 /* Return the first node in GIMPLE sequence S. */
1310 static inline gimple_seq_node
1311 gimple_seq_first (gimple_seq s
)
1317 /* Return the first statement in GIMPLE sequence S. */
1319 static inline gimple
1320 gimple_seq_first_stmt (gimple_seq s
)
1322 gimple_seq_node n
= gimple_seq_first (s
);
1327 /* Return the last node in GIMPLE sequence S. */
1329 static inline gimple_seq_node
1330 gimple_seq_last (gimple_seq s
)
1332 return s
? s
->prev
: NULL
;
1336 /* Return the last statement in GIMPLE sequence S. */
1338 static inline gimple
1339 gimple_seq_last_stmt (gimple_seq s
)
1341 gimple_seq_node n
= gimple_seq_last (s
);
1346 /* Set the last node in GIMPLE sequence *PS to LAST. */
1349 gimple_seq_set_last (gimple_seq
*ps
, gimple_seq_node last
)
1355 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1358 gimple_seq_set_first (gimple_seq
*ps
, gimple_seq_node first
)
1364 /* Return true if GIMPLE sequence S is empty. */
1367 gimple_seq_empty_p (gimple_seq s
)
1372 /* Allocate a new sequence and initialize its first element with STMT. */
1374 static inline gimple_seq
1375 gimple_seq_alloc_with_stmt (gimple stmt
)
1377 gimple_seq seq
= NULL
;
1378 gimple_seq_add_stmt (&seq
, stmt
);
1383 /* Returns the sequence of statements in BB. */
1385 static inline gimple_seq
1386 bb_seq (const_basic_block bb
)
1388 return (!(bb
->flags
& BB_RTL
)) ? bb
->il
.gimple
.seq
: NULL
;
1391 static inline gimple_seq
*
1392 bb_seq_addr (basic_block bb
)
1394 return (!(bb
->flags
& BB_RTL
)) ? &bb
->il
.gimple
.seq
: NULL
;
1397 /* Sets the sequence of statements in BB to SEQ. */
1400 set_bb_seq (basic_block bb
, gimple_seq seq
)
1402 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
1403 bb
->il
.gimple
.seq
= seq
;
1407 /* Return the code for GIMPLE statement G. */
1409 static inline enum gimple_code
1410 gimple_code (const_gimple g
)
1416 /* Return the GSS code used by a GIMPLE code. */
1418 static inline enum gimple_statement_structure_enum
1419 gss_for_code (enum gimple_code code
)
1421 gcc_gimple_checking_assert ((unsigned int)code
< LAST_AND_UNUSED_GIMPLE_CODE
);
1422 return gss_for_code_
[code
];
1426 /* Return which GSS code is used by GS. */
1428 static inline enum gimple_statement_structure_enum
1429 gimple_statement_structure (gimple gs
)
1431 return gss_for_code (gimple_code (gs
));
1435 /* Return true if statement G has sub-statements. This is only true for
1436 High GIMPLE statements. */
1439 gimple_has_substatements (gimple g
)
1441 switch (gimple_code (g
))
1445 case GIMPLE_EH_FILTER
:
1446 case GIMPLE_EH_ELSE
:
1448 case GIMPLE_OMP_FOR
:
1449 case GIMPLE_OMP_MASTER
:
1450 case GIMPLE_OMP_TASKGROUP
:
1451 case GIMPLE_OMP_ORDERED
:
1452 case GIMPLE_OMP_SECTION
:
1453 case GIMPLE_OMP_PARALLEL
:
1454 case GIMPLE_OMP_TASK
:
1455 case GIMPLE_OMP_SECTIONS
:
1456 case GIMPLE_OMP_SINGLE
:
1457 case GIMPLE_OMP_TARGET
:
1458 case GIMPLE_OMP_TEAMS
:
1459 case GIMPLE_OMP_CRITICAL
:
1460 case GIMPLE_WITH_CLEANUP_EXPR
:
1461 case GIMPLE_TRANSACTION
:
1470 /* Return the basic block holding statement G. */
1472 static inline basic_block
1473 gimple_bb (const_gimple g
)
1479 /* Return the lexical scope block holding statement G. */
1482 gimple_block (const_gimple g
)
1484 return LOCATION_BLOCK (g
->location
);
1488 /* Set BLOCK to be the lexical scope block holding statement G. */
1491 gimple_set_block (gimple g
, tree block
)
1495 COMBINE_LOCATION_DATA (line_table
, g
->location
, block
);
1497 g
->location
= LOCATION_LOCUS (g
->location
);
1501 /* Return location information for statement G. */
1503 static inline location_t
1504 gimple_location (const_gimple g
)
1509 /* Return location information for statement G if g is not NULL.
1510 Otherwise, UNKNOWN_LOCATION is returned. */
1512 static inline location_t
1513 gimple_location_safe (const_gimple g
)
1515 return g
? gimple_location (g
) : UNKNOWN_LOCATION
;
1518 /* Return pointer to location information for statement G. */
1520 static inline const location_t
*
1521 gimple_location_ptr (const_gimple g
)
1523 return &g
->location
;
1527 /* Set location information for statement G. */
1530 gimple_set_location (gimple g
, location_t location
)
1532 g
->location
= location
;
1536 /* Return true if G contains location information. */
1539 gimple_has_location (const_gimple g
)
1541 return LOCATION_LOCUS (gimple_location (g
)) != UNKNOWN_LOCATION
;
1545 /* Return the file name of the location of STMT. */
1547 static inline const char *
1548 gimple_filename (const_gimple stmt
)
1550 return LOCATION_FILE (gimple_location (stmt
));
1554 /* Return the line number of the location of STMT. */
1557 gimple_lineno (const_gimple stmt
)
1559 return LOCATION_LINE (gimple_location (stmt
));
1563 /* Determine whether SEQ is a singleton. */
1566 gimple_seq_singleton_p (gimple_seq seq
)
1568 return ((gimple_seq_first (seq
) != NULL
)
1569 && (gimple_seq_first (seq
) == gimple_seq_last (seq
)));
1572 /* Return true if no warnings should be emitted for statement STMT. */
1575 gimple_no_warning_p (const_gimple stmt
)
1577 return stmt
->no_warning
;
1580 /* Set the no_warning flag of STMT to NO_WARNING. */
1583 gimple_set_no_warning (gimple stmt
, bool no_warning
)
1585 stmt
->no_warning
= (unsigned) no_warning
;
1588 /* Set the visited status on statement STMT to VISITED_P.
1590 Please note that this 'visited' property of the gimple statement is
1591 supposed to be undefined at pass boundaries. This means that a
1592 given pass should not assume it contains any useful value when the
1593 pass starts and thus can set it to any value it sees fit.
1595 You can learn more about the visited property of the gimple
1596 statement by reading the comments of the 'visited' data member of
1597 struct gimple statement_base.
1601 gimple_set_visited (gimple stmt
, bool visited_p
)
1603 stmt
->visited
= (unsigned) visited_p
;
1607 /* Return the visited status for statement STMT.
1609 Please note that this 'visited' property of the gimple statement is
1610 supposed to be undefined at pass boundaries. This means that a
1611 given pass should not assume it contains any useful value when the
1612 pass starts and thus can set it to any value it sees fit.
1614 You can learn more about the visited property of the gimple
1615 statement by reading the comments of the 'visited' data member of
1616 struct gimple statement_base. */
1619 gimple_visited_p (gimple stmt
)
1621 return stmt
->visited
;
1625 /* Set pass local flag PLF on statement STMT to VAL_P.
1627 Please note that this PLF property of the gimple statement is
1628 supposed to be undefined at pass boundaries. This means that a
1629 given pass should not assume it contains any useful value when the
1630 pass starts and thus can set it to any value it sees fit.
1632 You can learn more about the PLF property by reading the comment of
1633 the 'plf' data member of struct gimple_statement_structure. */
1636 gimple_set_plf (gimple stmt
, enum plf_mask plf
, bool val_p
)
1639 stmt
->plf
|= (unsigned int) plf
;
1641 stmt
->plf
&= ~((unsigned int) plf
);
1645 /* Return the value of pass local flag PLF on statement STMT.
1647 Please note that this 'plf' property of the gimple statement is
1648 supposed to be undefined at pass boundaries. This means that a
1649 given pass should not assume it contains any useful value when the
1650 pass starts and thus can set it to any value it sees fit.
1652 You can learn more about the plf property by reading the comment of
1653 the 'plf' data member of struct gimple_statement_structure. */
1655 static inline unsigned int
1656 gimple_plf (gimple stmt
, enum plf_mask plf
)
1658 return stmt
->plf
& ((unsigned int) plf
);
1662 /* Set the UID of statement.
1664 Please note that this UID property is supposed to be undefined at
1665 pass boundaries. This means that a given pass should not assume it
1666 contains any useful value when the pass starts and thus can set it
1667 to any value it sees fit. */
1670 gimple_set_uid (gimple g
, unsigned uid
)
1676 /* Return the UID of statement.
1678 Please note that this UID property is supposed to be undefined at
1679 pass boundaries. This means that a given pass should not assume it
1680 contains any useful value when the pass starts and thus can set it
1681 to any value it sees fit. */
1683 static inline unsigned
1684 gimple_uid (const_gimple g
)
1690 /* Make statement G a singleton sequence. */
1693 gimple_init_singleton (gimple g
)
1700 /* Return true if GIMPLE statement G has register or memory operands. */
1703 gimple_has_ops (const_gimple g
)
1705 return gimple_code (g
) >= GIMPLE_COND
&& gimple_code (g
) <= GIMPLE_RETURN
;
1711 is_a_helper
<const gimple_statement_with_ops
*>::test (const_gimple gs
)
1713 return gimple_has_ops (gs
);
1719 is_a_helper
<gimple_statement_with_ops
*>::test (gimple gs
)
1721 return gimple_has_ops (gs
);
1724 /* Return true if GIMPLE statement G has memory operands. */
1727 gimple_has_mem_ops (const_gimple g
)
1729 return gimple_code (g
) >= GIMPLE_ASSIGN
&& gimple_code (g
) <= GIMPLE_RETURN
;
1735 is_a_helper
<const gimple_statement_with_memory_ops
*>::test (const_gimple gs
)
1737 return gimple_has_mem_ops (gs
);
1743 is_a_helper
<gimple_statement_with_memory_ops
*>::test (gimple gs
)
1745 return gimple_has_mem_ops (gs
);
1748 /* Return the set of USE operands for statement G. */
1750 static inline struct use_optype_d
*
1751 gimple_use_ops (const_gimple g
)
1753 const gimple_statement_with_ops
*ops_stmt
=
1754 dyn_cast
<const gimple_statement_with_ops
*> (g
);
1757 return ops_stmt
->use_ops
;
1761 /* Set USE to be the set of USE operands for statement G. */
1764 gimple_set_use_ops (gimple g
, struct use_optype_d
*use
)
1766 gimple_statement_with_ops
*ops_stmt
=
1767 as_a
<gimple_statement_with_ops
*> (g
);
1768 ops_stmt
->use_ops
= use
;
1772 /* Return the single VUSE operand of the statement G. */
1775 gimple_vuse (const_gimple g
)
1777 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
1778 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
1781 return mem_ops_stmt
->vuse
;
1784 /* Return the single VDEF operand of the statement G. */
1787 gimple_vdef (const_gimple g
)
1789 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
1790 dyn_cast
<const gimple_statement_with_memory_ops
*> (g
);
1793 return mem_ops_stmt
->vdef
;
1796 /* Return the single VUSE operand of the statement G. */
1798 static inline tree
*
1799 gimple_vuse_ptr (gimple g
)
1801 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1802 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
1805 return &mem_ops_stmt
->vuse
;
1808 /* Return the single VDEF operand of the statement G. */
1810 static inline tree
*
1811 gimple_vdef_ptr (gimple g
)
1813 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1814 dyn_cast
<gimple_statement_with_memory_ops
*> (g
);
1817 return &mem_ops_stmt
->vdef
;
1820 /* Set the single VUSE operand of the statement G. */
1823 gimple_set_vuse (gimple g
, tree vuse
)
1825 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1826 as_a
<gimple_statement_with_memory_ops
*> (g
);
1827 mem_ops_stmt
->vuse
= vuse
;
1830 /* Set the single VDEF operand of the statement G. */
1833 gimple_set_vdef (gimple g
, tree vdef
)
1835 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1836 as_a
<gimple_statement_with_memory_ops
*> (g
);
1837 mem_ops_stmt
->vdef
= vdef
;
1841 /* Return true if statement G has operands and the modified field has
1845 gimple_modified_p (const_gimple g
)
1847 return (gimple_has_ops (g
)) ? (bool) g
->modified
: false;
1851 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1852 a MODIFIED field. */
1855 gimple_set_modified (gimple s
, bool modifiedp
)
1857 if (gimple_has_ops (s
))
1858 s
->modified
= (unsigned) modifiedp
;
1862 /* Return the tree code for the expression computed by STMT. This is
1863 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1864 GIMPLE_CALL, return CALL_EXPR as the expression code for
1865 consistency. This is useful when the caller needs to deal with the
1866 three kinds of computation that GIMPLE supports. */
1868 static inline enum tree_code
1869 gimple_expr_code (const_gimple stmt
)
1871 enum gimple_code code
= gimple_code (stmt
);
1872 if (code
== GIMPLE_ASSIGN
|| code
== GIMPLE_COND
)
1873 return (enum tree_code
) stmt
->subcode
;
1876 gcc_gimple_checking_assert (code
== GIMPLE_CALL
);
1882 /* Return true if statement STMT contains volatile operands. */
1885 gimple_has_volatile_ops (const_gimple stmt
)
1887 if (gimple_has_mem_ops (stmt
))
1888 return stmt
->has_volatile_ops
;
1894 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1897 gimple_set_has_volatile_ops (gimple stmt
, bool volatilep
)
1899 if (gimple_has_mem_ops (stmt
))
1900 stmt
->has_volatile_ops
= (unsigned) volatilep
;
1903 /* Return true if STMT is in a transaction. */
1906 gimple_in_transaction (gimple stmt
)
1908 return bb_in_transaction (gimple_bb (stmt
));
1911 /* Return true if statement STMT may access memory. */
1914 gimple_references_memory_p (gimple stmt
)
1916 return gimple_has_mem_ops (stmt
) && gimple_vuse (stmt
);
1920 /* Return the subcode for OMP statement S. */
1922 static inline unsigned
1923 gimple_omp_subcode (const_gimple s
)
1925 gcc_gimple_checking_assert (gimple_code (s
) >= GIMPLE_OMP_ATOMIC_LOAD
1926 && gimple_code (s
) <= GIMPLE_OMP_TEAMS
);
1930 /* Set the subcode for OMP statement S to SUBCODE. */
1933 gimple_omp_set_subcode (gimple s
, unsigned int subcode
)
1935 /* We only have 16 bits for the subcode. Assert that we are not
1937 gcc_gimple_checking_assert (subcode
< (1 << 16));
1938 s
->subcode
= subcode
;
1941 /* Set the nowait flag on OMP_RETURN statement S. */
1944 gimple_omp_return_set_nowait (gimple s
)
1946 GIMPLE_CHECK (s
, GIMPLE_OMP_RETURN
);
1947 s
->subcode
|= GF_OMP_RETURN_NOWAIT
;
1951 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1955 gimple_omp_return_nowait_p (const_gimple g
)
1957 GIMPLE_CHECK (g
, GIMPLE_OMP_RETURN
);
1958 return (gimple_omp_subcode (g
) & GF_OMP_RETURN_NOWAIT
) != 0;
1962 /* Set the LHS of OMP return. */
1965 gimple_omp_return_set_lhs (gimple g
, tree lhs
)
1967 gimple_statement_omp_return
*omp_return_stmt
=
1968 as_a
<gimple_statement_omp_return
*> (g
);
1969 omp_return_stmt
->val
= lhs
;
1973 /* Get the LHS of OMP return. */
1976 gimple_omp_return_lhs (const_gimple g
)
1978 const gimple_statement_omp_return
*omp_return_stmt
=
1979 as_a
<const gimple_statement_omp_return
*> (g
);
1980 return omp_return_stmt
->val
;
1984 /* Return a pointer to the LHS of OMP return. */
1986 static inline tree
*
1987 gimple_omp_return_lhs_ptr (gimple g
)
1989 gimple_statement_omp_return
*omp_return_stmt
=
1990 as_a
<gimple_statement_omp_return
*> (g
);
1991 return &omp_return_stmt
->val
;
1995 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1999 gimple_omp_section_last_p (const_gimple g
)
2001 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2002 return (gimple_omp_subcode (g
) & GF_OMP_SECTION_LAST
) != 0;
2006 /* Set the GF_OMP_SECTION_LAST flag on G. */
2009 gimple_omp_section_set_last (gimple g
)
2011 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
2012 g
->subcode
|= GF_OMP_SECTION_LAST
;
2016 /* Return true if OMP parallel statement G has the
2017 GF_OMP_PARALLEL_COMBINED flag set. */
2020 gimple_omp_parallel_combined_p (const_gimple g
)
2022 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2023 return (gimple_omp_subcode (g
) & GF_OMP_PARALLEL_COMBINED
) != 0;
2027 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2028 value of COMBINED_P. */
2031 gimple_omp_parallel_set_combined_p (gimple g
, bool combined_p
)
2033 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
2035 g
->subcode
|= GF_OMP_PARALLEL_COMBINED
;
2037 g
->subcode
&= ~GF_OMP_PARALLEL_COMBINED
;
2041 /* Return true if OMP atomic load/store statement G has the
2042 GF_OMP_ATOMIC_NEED_VALUE flag set. */
2045 gimple_omp_atomic_need_value_p (const_gimple g
)
2047 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2048 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2049 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_NEED_VALUE
) != 0;
2053 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2056 gimple_omp_atomic_set_need_value (gimple g
)
2058 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2059 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2060 g
->subcode
|= GF_OMP_ATOMIC_NEED_VALUE
;
2064 /* Return true if OMP atomic load/store statement G has the
2065 GF_OMP_ATOMIC_SEQ_CST flag set. */
2068 gimple_omp_atomic_seq_cst_p (const_gimple g
)
2070 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2071 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2072 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_SEQ_CST
) != 0;
2076 /* Set the GF_OMP_ATOMIC_SEQ_CST flag on G. */
2079 gimple_omp_atomic_set_seq_cst (gimple g
)
2081 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2082 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2083 g
->subcode
|= GF_OMP_ATOMIC_SEQ_CST
;
2087 /* Return the number of operands for statement GS. */
2089 static inline unsigned
2090 gimple_num_ops (const_gimple gs
)
2096 /* Set the number of operands for statement GS. */
2099 gimple_set_num_ops (gimple gs
, unsigned num_ops
)
2101 gs
->num_ops
= num_ops
;
2105 /* Return the array of operands for statement GS. */
2107 static inline tree
*
2108 gimple_ops (gimple gs
)
2112 /* All the tuples have their operand vector at the very bottom
2113 of the structure. Note that those structures that do not
2114 have an operand vector have a zero offset. */
2115 off
= gimple_ops_offset_
[gimple_statement_structure (gs
)];
2116 gcc_gimple_checking_assert (off
!= 0);
2118 return (tree
*) ((char *) gs
+ off
);
2122 /* Return operand I for statement GS. */
2125 gimple_op (const_gimple gs
, unsigned i
)
2127 if (gimple_has_ops (gs
))
2129 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2130 return gimple_ops (CONST_CAST_GIMPLE (gs
))[i
];
2136 /* Return a pointer to operand I for statement GS. */
2138 static inline tree
*
2139 gimple_op_ptr (const_gimple gs
, unsigned i
)
2141 if (gimple_has_ops (gs
))
2143 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2144 return gimple_ops (CONST_CAST_GIMPLE (gs
)) + i
;
2150 /* Set operand I of statement GS to OP. */
2153 gimple_set_op (gimple gs
, unsigned i
, tree op
)
2155 gcc_gimple_checking_assert (gimple_has_ops (gs
) && i
< gimple_num_ops (gs
));
2157 /* Note. It may be tempting to assert that OP matches
2158 is_gimple_operand, but that would be wrong. Different tuples
2159 accept slightly different sets of tree operands. Each caller
2160 should perform its own validation. */
2161 gimple_ops (gs
)[i
] = op
;
2164 /* Return true if GS is a GIMPLE_ASSIGN. */
2167 is_gimple_assign (const_gimple gs
)
2169 return gimple_code (gs
) == GIMPLE_ASSIGN
;
2172 /* Determine if expression CODE is one of the valid expressions that can
2173 be used on the RHS of GIMPLE assignments. */
2175 static inline enum gimple_rhs_class
2176 get_gimple_rhs_class (enum tree_code code
)
2178 return (enum gimple_rhs_class
) gimple_rhs_class_table
[(int) code
];
2181 /* Return the LHS of assignment statement GS. */
2184 gimple_assign_lhs (const_gimple gs
)
2186 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2187 return gimple_op (gs
, 0);
2191 /* Return a pointer to the LHS of assignment statement GS. */
2193 static inline tree
*
2194 gimple_assign_lhs_ptr (const_gimple gs
)
2196 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2197 return gimple_op_ptr (gs
, 0);
2201 /* Set LHS to be the LHS operand of assignment statement GS. */
2204 gimple_assign_set_lhs (gimple gs
, tree lhs
)
2206 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2207 gimple_set_op (gs
, 0, lhs
);
2209 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2210 SSA_NAME_DEF_STMT (lhs
) = gs
;
2214 /* Return the first operand on the RHS of assignment statement GS. */
2217 gimple_assign_rhs1 (const_gimple gs
)
2219 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2220 return gimple_op (gs
, 1);
2224 /* Return a pointer to the first operand on the RHS of assignment
2227 static inline tree
*
2228 gimple_assign_rhs1_ptr (const_gimple gs
)
2230 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2231 return gimple_op_ptr (gs
, 1);
2234 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2237 gimple_assign_set_rhs1 (gimple gs
, tree rhs
)
2239 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2241 gimple_set_op (gs
, 1, rhs
);
2245 /* Return the second operand on the RHS of assignment statement GS.
2246 If GS does not have two operands, NULL is returned instead. */
2249 gimple_assign_rhs2 (const_gimple gs
)
2251 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2253 if (gimple_num_ops (gs
) >= 3)
2254 return gimple_op (gs
, 2);
2260 /* Return a pointer to the second operand on the RHS of assignment
2263 static inline tree
*
2264 gimple_assign_rhs2_ptr (const_gimple gs
)
2266 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2267 return gimple_op_ptr (gs
, 2);
2271 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2274 gimple_assign_set_rhs2 (gimple gs
, tree rhs
)
2276 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2278 gimple_set_op (gs
, 2, rhs
);
2281 /* Return the third operand on the RHS of assignment statement GS.
2282 If GS does not have two operands, NULL is returned instead. */
2285 gimple_assign_rhs3 (const_gimple gs
)
2287 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2289 if (gimple_num_ops (gs
) >= 4)
2290 return gimple_op (gs
, 3);
2295 /* Return a pointer to the third operand on the RHS of assignment
2298 static inline tree
*
2299 gimple_assign_rhs3_ptr (const_gimple gs
)
2301 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2302 return gimple_op_ptr (gs
, 3);
2306 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2309 gimple_assign_set_rhs3 (gimple gs
, tree rhs
)
2311 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2313 gimple_set_op (gs
, 3, rhs
);
2316 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
2317 to see only a maximum of two operands. */
2320 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2323 gimple_assign_set_rhs_with_ops_1 (gsi
, code
, op1
, op2
, NULL
);
2326 /* Returns true if GS is a nontemporal move. */
2329 gimple_assign_nontemporal_move_p (const_gimple gs
)
2331 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2332 return gs
->nontemporal_move
;
2335 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2338 gimple_assign_set_nontemporal_move (gimple gs
, bool nontemporal
)
2340 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2341 gs
->nontemporal_move
= nontemporal
;
2345 /* Return the code of the expression computed on the rhs of assignment
2346 statement GS. In case that the RHS is a single object, returns the
2347 tree code of the object. */
2349 static inline enum tree_code
2350 gimple_assign_rhs_code (const_gimple gs
)
2352 enum tree_code code
;
2353 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2355 code
= (enum tree_code
) gs
->subcode
;
2356 /* While we initially set subcode to the TREE_CODE of the rhs for
2357 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2358 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2359 if (get_gimple_rhs_class (code
) == GIMPLE_SINGLE_RHS
)
2360 code
= TREE_CODE (gimple_assign_rhs1 (gs
));
2366 /* Set CODE to be the code for the expression computed on the RHS of
2370 gimple_assign_set_rhs_code (gimple s
, enum tree_code code
)
2372 GIMPLE_CHECK (s
, GIMPLE_ASSIGN
);
2377 /* Return the gimple rhs class of the code of the expression computed on
2378 the rhs of assignment statement GS.
2379 This will never return GIMPLE_INVALID_RHS. */
2381 static inline enum gimple_rhs_class
2382 gimple_assign_rhs_class (const_gimple gs
)
2384 return get_gimple_rhs_class (gimple_assign_rhs_code (gs
));
2387 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2388 there is no operator associated with the assignment itself.
2389 Unlike gimple_assign_copy_p, this predicate returns true for
2390 any RHS operand, including those that perform an operation
2391 and do not have the semantics of a copy, such as COND_EXPR. */
2394 gimple_assign_single_p (const_gimple gs
)
2396 return (is_gimple_assign (gs
)
2397 && gimple_assign_rhs_class (gs
) == GIMPLE_SINGLE_RHS
);
2400 /* Return true if GS performs a store to its lhs. */
2403 gimple_store_p (const_gimple gs
)
2405 tree lhs
= gimple_get_lhs (gs
);
2406 return lhs
&& !is_gimple_reg (lhs
);
2409 /* Return true if GS is an assignment that loads from its rhs1. */
2412 gimple_assign_load_p (const_gimple gs
)
2415 if (!gimple_assign_single_p (gs
))
2417 rhs
= gimple_assign_rhs1 (gs
);
2418 if (TREE_CODE (rhs
) == WITH_SIZE_EXPR
)
2420 rhs
= get_base_address (rhs
);
2421 return (DECL_P (rhs
)
2422 || TREE_CODE (rhs
) == MEM_REF
|| TREE_CODE (rhs
) == TARGET_MEM_REF
);
2426 /* Return true if S is a type-cast assignment. */
2429 gimple_assign_cast_p (const_gimple s
)
2431 if (is_gimple_assign (s
))
2433 enum tree_code sc
= gimple_assign_rhs_code (s
);
2434 return CONVERT_EXPR_CODE_P (sc
)
2435 || sc
== VIEW_CONVERT_EXPR
2436 || sc
== FIX_TRUNC_EXPR
;
2442 /* Return true if S is a clobber statement. */
2445 gimple_clobber_p (const_gimple s
)
2447 return gimple_assign_single_p (s
)
2448 && TREE_CLOBBER_P (gimple_assign_rhs1 (s
));
2451 /* Return true if GS is a GIMPLE_CALL. */
2454 is_gimple_call (const_gimple gs
)
2456 return gimple_code (gs
) == GIMPLE_CALL
;
2459 /* Return the LHS of call statement GS. */
2462 gimple_call_lhs (const_gimple gs
)
2464 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2465 return gimple_op (gs
, 0);
2469 /* Return a pointer to the LHS of call statement GS. */
2471 static inline tree
*
2472 gimple_call_lhs_ptr (const_gimple gs
)
2474 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2475 return gimple_op_ptr (gs
, 0);
2479 /* Set LHS to be the LHS operand of call statement GS. */
2482 gimple_call_set_lhs (gimple gs
, tree lhs
)
2484 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2485 gimple_set_op (gs
, 0, lhs
);
2486 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2487 SSA_NAME_DEF_STMT (lhs
) = gs
;
2491 /* Return true if call GS calls an internal-only function, as enumerated
2495 gimple_call_internal_p (const_gimple gs
)
2497 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2498 return (gs
->subcode
& GF_CALL_INTERNAL
) != 0;
2502 /* Return true if call GS is marked as instrumented by
2503 Pointer Bounds Checker. */
2506 gimple_call_with_bounds_p (const_gimple gs
)
2508 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2509 return (gs
->subcode
& GF_CALL_WITH_BOUNDS
) != 0;
2513 /* If INSTRUMENTED_P is true, marm statement GS as instrumented by
2514 Pointer Bounds Checker. */
2517 gimple_call_set_with_bounds (gimple gs
, bool with_bounds
)
2519 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2521 gs
->subcode
|= GF_CALL_WITH_BOUNDS
;
2523 gs
->subcode
&= ~GF_CALL_WITH_BOUNDS
;
2527 /* Return the target of internal call GS. */
2529 static inline enum internal_fn
2530 gimple_call_internal_fn (const_gimple gs
)
2532 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
2533 return static_cast <const gimple_statement_call
*> (gs
)->u
.internal_fn
;
2536 /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
2537 that could alter control flow. */
2540 gimple_call_set_ctrl_altering (gimple s
, bool ctrl_altering_p
)
2542 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2543 if (ctrl_altering_p
)
2544 s
->subcode
|= GF_CALL_CTRL_ALTERING
;
2546 s
->subcode
&= ~GF_CALL_CTRL_ALTERING
;
2549 /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
2550 flag is set. Such call could not be a stmt in the middle of a bb. */
2553 gimple_call_ctrl_altering_p (const_gimple gs
)
2555 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2556 return (gs
->subcode
& GF_CALL_CTRL_ALTERING
) != 0;
2560 /* Return the function type of the function called by GS. */
2563 gimple_call_fntype (const_gimple gs
)
2565 const gimple_statement_call
*call_stmt
=
2566 as_a
<const gimple_statement_call
*> (gs
);
2567 if (gimple_call_internal_p (gs
))
2569 return call_stmt
->u
.fntype
;
2572 /* Set the type of the function called by GS to FNTYPE. */
2575 gimple_call_set_fntype (gimple gs
, tree fntype
)
2577 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
*> (gs
);
2578 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2579 call_stmt
->u
.fntype
= fntype
;
2583 /* Return the tree node representing the function called by call
2587 gimple_call_fn (const_gimple gs
)
2589 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2590 return gimple_op (gs
, 1);
2593 /* Return a pointer to the tree node representing the function called by call
2596 static inline tree
*
2597 gimple_call_fn_ptr (const_gimple gs
)
2599 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2600 return gimple_op_ptr (gs
, 1);
2604 /* Set FN to be the function called by call statement GS. */
2607 gimple_call_set_fn (gimple gs
, tree fn
)
2609 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2610 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2611 gimple_set_op (gs
, 1, fn
);
2615 /* Set FNDECL to be the function called by call statement GS. */
2618 gimple_call_set_fndecl (gimple gs
, tree decl
)
2620 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2621 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2622 gimple_set_op (gs
, 1, build_fold_addr_expr_loc (gimple_location (gs
), decl
));
2626 /* Set internal function FN to be the function called by call statement GS. */
2629 gimple_call_set_internal_fn (gimple gs
, enum internal_fn fn
)
2631 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
*> (gs
);
2632 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
2633 call_stmt
->u
.internal_fn
= fn
;
2637 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2638 Otherwise return NULL. This function is analogous to
2639 get_callee_fndecl in tree land. */
2642 gimple_call_fndecl (const_gimple gs
)
2644 return gimple_call_addr_fndecl (gimple_call_fn (gs
));
2648 /* Return the type returned by call statement GS. */
2651 gimple_call_return_type (const_gimple gs
)
2653 tree type
= gimple_call_fntype (gs
);
2655 if (type
== NULL_TREE
)
2656 return TREE_TYPE (gimple_call_lhs (gs
));
2658 /* The type returned by a function is the type of its
2660 return TREE_TYPE (type
);
2664 /* Return the static chain for call statement GS. */
2667 gimple_call_chain (const_gimple gs
)
2669 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2670 return gimple_op (gs
, 2);
2674 /* Return a pointer to the static chain for call statement GS. */
2676 static inline tree
*
2677 gimple_call_chain_ptr (const_gimple gs
)
2679 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2680 return gimple_op_ptr (gs
, 2);
2683 /* Set CHAIN to be the static chain for call statement GS. */
2686 gimple_call_set_chain (gimple gs
, tree chain
)
2688 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2690 gimple_set_op (gs
, 2, chain
);
2694 /* Return the number of arguments used by call statement GS. */
2696 static inline unsigned
2697 gimple_call_num_args (const_gimple gs
)
2700 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2701 num_ops
= gimple_num_ops (gs
);
2706 /* Return the argument at position INDEX for call statement GS. */
2709 gimple_call_arg (const_gimple gs
, unsigned index
)
2711 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2712 return gimple_op (gs
, index
+ 3);
2716 /* Return a pointer to the argument at position INDEX for call
2719 static inline tree
*
2720 gimple_call_arg_ptr (const_gimple gs
, unsigned index
)
2722 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2723 return gimple_op_ptr (gs
, index
+ 3);
2727 /* Set ARG to be the argument at position INDEX for call statement GS. */
2730 gimple_call_set_arg (gimple gs
, unsigned index
, tree arg
)
2732 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2733 gimple_set_op (gs
, index
+ 3, arg
);
2737 /* If TAIL_P is true, mark call statement S as being a tail call
2738 (i.e., a call just before the exit of a function). These calls are
2739 candidate for tail call optimization. */
2742 gimple_call_set_tail (gimple s
, bool tail_p
)
2744 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2746 s
->subcode
|= GF_CALL_TAILCALL
;
2748 s
->subcode
&= ~GF_CALL_TAILCALL
;
2752 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2755 gimple_call_tail_p (gimple s
)
2757 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2758 return (s
->subcode
& GF_CALL_TAILCALL
) != 0;
2762 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2763 slot optimization. This transformation uses the target of the call
2764 expansion as the return slot for calls that return in memory. */
2767 gimple_call_set_return_slot_opt (gimple s
, bool return_slot_opt_p
)
2769 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2770 if (return_slot_opt_p
)
2771 s
->subcode
|= GF_CALL_RETURN_SLOT_OPT
;
2773 s
->subcode
&= ~GF_CALL_RETURN_SLOT_OPT
;
2777 /* Return true if S is marked for return slot optimization. */
2780 gimple_call_return_slot_opt_p (gimple s
)
2782 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2783 return (s
->subcode
& GF_CALL_RETURN_SLOT_OPT
) != 0;
2787 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2788 thunk to the thunked-to function. */
2791 gimple_call_set_from_thunk (gimple s
, bool from_thunk_p
)
2793 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2795 s
->subcode
|= GF_CALL_FROM_THUNK
;
2797 s
->subcode
&= ~GF_CALL_FROM_THUNK
;
2801 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2804 gimple_call_from_thunk_p (gimple s
)
2806 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2807 return (s
->subcode
& GF_CALL_FROM_THUNK
) != 0;
2811 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2812 argument pack in its argument list. */
2815 gimple_call_set_va_arg_pack (gimple s
, bool pass_arg_pack_p
)
2817 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2818 if (pass_arg_pack_p
)
2819 s
->subcode
|= GF_CALL_VA_ARG_PACK
;
2821 s
->subcode
&= ~GF_CALL_VA_ARG_PACK
;
2825 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2826 argument pack in its argument list. */
2829 gimple_call_va_arg_pack_p (gimple s
)
2831 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2832 return (s
->subcode
& GF_CALL_VA_ARG_PACK
) != 0;
2836 /* Return true if S is a noreturn call. */
2839 gimple_call_noreturn_p (gimple s
)
2841 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2842 return (gimple_call_flags (s
) & ECF_NORETURN
) != 0;
2846 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2847 even if the called function can throw in other cases. */
2850 gimple_call_set_nothrow (gimple s
, bool nothrow_p
)
2852 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2854 s
->subcode
|= GF_CALL_NOTHROW
;
2856 s
->subcode
&= ~GF_CALL_NOTHROW
;
2859 /* Return true if S is a nothrow call. */
2862 gimple_call_nothrow_p (gimple s
)
2864 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2865 return (gimple_call_flags (s
) & ECF_NOTHROW
) != 0;
2868 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2869 is known to be emitted for VLA objects. Those are wrapped by
2870 stack_save/stack_restore calls and hence can't lead to unbounded
2871 stack growth even when they occur in loops. */
2874 gimple_call_set_alloca_for_var (gimple s
, bool for_var
)
2876 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2878 s
->subcode
|= GF_CALL_ALLOCA_FOR_VAR
;
2880 s
->subcode
&= ~GF_CALL_ALLOCA_FOR_VAR
;
2883 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2886 gimple_call_alloca_for_var_p (gimple s
)
2888 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2889 return (s
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
2892 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2895 gimple_call_copy_flags (gimple dest_call
, gimple orig_call
)
2897 GIMPLE_CHECK (dest_call
, GIMPLE_CALL
);
2898 GIMPLE_CHECK (orig_call
, GIMPLE_CALL
);
2899 dest_call
->subcode
= orig_call
->subcode
;
2903 /* Return a pointer to the points-to solution for the set of call-used
2904 variables of the call CALL. */
2906 static inline struct pt_solution
*
2907 gimple_call_use_set (gimple call
)
2909 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
*> (call
);
2910 return &call_stmt
->call_used
;
2914 /* Return a pointer to the points-to solution for the set of call-used
2915 variables of the call CALL. */
2917 static inline struct pt_solution
*
2918 gimple_call_clobber_set (gimple call
)
2920 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
*> (call
);
2921 return &call_stmt
->call_clobbered
;
2925 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2929 gimple_has_lhs (gimple stmt
)
2931 return (is_gimple_assign (stmt
)
2932 || (is_gimple_call (stmt
)
2933 && gimple_call_lhs (stmt
) != NULL_TREE
));
2937 /* Return the code of the predicate computed by conditional statement GS. */
2939 static inline enum tree_code
2940 gimple_cond_code (const_gimple gs
)
2942 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2943 return (enum tree_code
) gs
->subcode
;
2947 /* Set CODE to be the predicate code for the conditional statement GS. */
2950 gimple_cond_set_code (gimple gs
, enum tree_code code
)
2952 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2957 /* Return the LHS of the predicate computed by conditional statement GS. */
2960 gimple_cond_lhs (const_gimple gs
)
2962 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2963 return gimple_op (gs
, 0);
2966 /* Return the pointer to the LHS of the predicate computed by conditional
2969 static inline tree
*
2970 gimple_cond_lhs_ptr (const_gimple gs
)
2972 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2973 return gimple_op_ptr (gs
, 0);
2976 /* Set LHS to be the LHS operand of the predicate computed by
2977 conditional statement GS. */
2980 gimple_cond_set_lhs (gimple gs
, tree lhs
)
2982 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2983 gimple_set_op (gs
, 0, lhs
);
2987 /* Return the RHS operand of the predicate computed by conditional GS. */
2990 gimple_cond_rhs (const_gimple gs
)
2992 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2993 return gimple_op (gs
, 1);
2996 /* Return the pointer to the RHS operand of the predicate computed by
2999 static inline tree
*
3000 gimple_cond_rhs_ptr (const_gimple gs
)
3002 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3003 return gimple_op_ptr (gs
, 1);
3007 /* Set RHS to be the RHS operand of the predicate computed by
3008 conditional statement GS. */
3011 gimple_cond_set_rhs (gimple gs
, tree rhs
)
3013 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3014 gimple_set_op (gs
, 1, rhs
);
3018 /* Return the label used by conditional statement GS when its
3019 predicate evaluates to true. */
3022 gimple_cond_true_label (const_gimple gs
)
3024 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3025 return gimple_op (gs
, 2);
3029 /* Set LABEL to be the label used by conditional statement GS when its
3030 predicate evaluates to true. */
3033 gimple_cond_set_true_label (gimple gs
, tree label
)
3035 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3036 gimple_set_op (gs
, 2, label
);
3040 /* Set LABEL to be the label used by conditional statement GS when its
3041 predicate evaluates to false. */
3044 gimple_cond_set_false_label (gimple gs
, tree label
)
3046 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3047 gimple_set_op (gs
, 3, label
);
3051 /* Return the label used by conditional statement GS when its
3052 predicate evaluates to false. */
3055 gimple_cond_false_label (const_gimple gs
)
3057 GIMPLE_CHECK (gs
, GIMPLE_COND
);
3058 return gimple_op (gs
, 3);
3062 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
3065 gimple_cond_make_false (gimple gs
)
3067 gimple_cond_set_lhs (gs
, boolean_true_node
);
3068 gimple_cond_set_rhs (gs
, boolean_false_node
);
3069 gs
->subcode
= EQ_EXPR
;
3073 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
3076 gimple_cond_make_true (gimple gs
)
3078 gimple_cond_set_lhs (gs
, boolean_true_node
);
3079 gimple_cond_set_rhs (gs
, boolean_true_node
);
3080 gs
->subcode
= EQ_EXPR
;
3083 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
3084 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3087 gimple_cond_true_p (const_gimple gs
)
3089 tree lhs
= gimple_cond_lhs (gs
);
3090 tree rhs
= gimple_cond_rhs (gs
);
3091 enum tree_code code
= gimple_cond_code (gs
);
3093 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3096 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3099 if (code
== NE_EXPR
&& lhs
!= rhs
)
3102 if (code
== EQ_EXPR
&& lhs
== rhs
)
3108 /* Check if conditional statement GS is of the form 'if (1 != 1)',
3109 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3112 gimple_cond_false_p (const_gimple gs
)
3114 tree lhs
= gimple_cond_lhs (gs
);
3115 tree rhs
= gimple_cond_rhs (gs
);
3116 enum tree_code code
= gimple_cond_code (gs
);
3118 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3121 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3124 if (code
== NE_EXPR
&& lhs
== rhs
)
3127 if (code
== EQ_EXPR
&& lhs
!= rhs
)
3133 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3136 gimple_cond_set_condition (gimple stmt
, enum tree_code code
, tree lhs
, tree rhs
)
3138 gimple_cond_set_code (stmt
, code
);
3139 gimple_cond_set_lhs (stmt
, lhs
);
3140 gimple_cond_set_rhs (stmt
, rhs
);
3143 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3146 gimple_label_label (const_gimple gs
)
3148 GIMPLE_CHECK (gs
, GIMPLE_LABEL
);
3149 return gimple_op (gs
, 0);
3153 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3157 gimple_label_set_label (gimple gs
, tree label
)
3159 GIMPLE_CHECK (gs
, GIMPLE_LABEL
);
3160 gimple_set_op (gs
, 0, label
);
3164 /* Return the destination of the unconditional jump GS. */
3167 gimple_goto_dest (const_gimple gs
)
3169 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3170 return gimple_op (gs
, 0);
3174 /* Set DEST to be the destination of the unconditonal jump GS. */
3177 gimple_goto_set_dest (gimple gs
, tree dest
)
3179 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3180 gimple_set_op (gs
, 0, dest
);
3184 /* Return the variables declared in the GIMPLE_BIND statement GS. */
3187 gimple_bind_vars (const_gimple gs
)
3189 const gimple_statement_bind
*bind_stmt
=
3190 as_a
<const gimple_statement_bind
*> (gs
);
3191 return bind_stmt
->vars
;
3195 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
3199 gimple_bind_set_vars (gimple gs
, tree vars
)
3201 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3202 bind_stmt
->vars
= vars
;
3206 /* Append VARS to the set of variables declared in the GIMPLE_BIND
3210 gimple_bind_append_vars (gimple gs
, tree vars
)
3212 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3213 bind_stmt
->vars
= chainon (bind_stmt
->vars
, vars
);
3217 static inline gimple_seq
*
3218 gimple_bind_body_ptr (gimple gs
)
3220 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3221 return &bind_stmt
->body
;
3224 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
3226 static inline gimple_seq
3227 gimple_bind_body (gimple gs
)
3229 return *gimple_bind_body_ptr (gs
);
3233 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
3237 gimple_bind_set_body (gimple gs
, gimple_seq seq
)
3239 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3240 bind_stmt
->body
= seq
;
3244 /* Append a statement to the end of a GIMPLE_BIND's body. */
3247 gimple_bind_add_stmt (gimple gs
, gimple stmt
)
3249 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3250 gimple_seq_add_stmt (&bind_stmt
->body
, stmt
);
3254 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
3257 gimple_bind_add_seq (gimple gs
, gimple_seq seq
)
3259 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3260 gimple_seq_add_seq (&bind_stmt
->body
, seq
);
3264 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
3265 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
3268 gimple_bind_block (const_gimple gs
)
3270 const gimple_statement_bind
*bind_stmt
=
3271 as_a
<const gimple_statement_bind
*> (gs
);
3272 return bind_stmt
->block
;
3276 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
3280 gimple_bind_set_block (gimple gs
, tree block
)
3282 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
*> (gs
);
3283 gcc_gimple_checking_assert (block
== NULL_TREE
3284 || TREE_CODE (block
) == BLOCK
);
3285 bind_stmt
->block
= block
;
3289 /* Return the number of input operands for GIMPLE_ASM GS. */
3291 static inline unsigned
3292 gimple_asm_ninputs (const_gimple gs
)
3294 const gimple_statement_asm
*asm_stmt
=
3295 as_a
<const gimple_statement_asm
*> (gs
);
3296 return asm_stmt
->ni
;
3300 /* Return the number of output operands for GIMPLE_ASM GS. */
3302 static inline unsigned
3303 gimple_asm_noutputs (const_gimple gs
)
3305 const gimple_statement_asm
*asm_stmt
=
3306 as_a
<const gimple_statement_asm
*> (gs
);
3307 return asm_stmt
->no
;
3311 /* Return the number of clobber operands for GIMPLE_ASM GS. */
3313 static inline unsigned
3314 gimple_asm_nclobbers (const_gimple gs
)
3316 const gimple_statement_asm
*asm_stmt
=
3317 as_a
<const gimple_statement_asm
*> (gs
);
3318 return asm_stmt
->nc
;
3321 /* Return the number of label operands for GIMPLE_ASM GS. */
3323 static inline unsigned
3324 gimple_asm_nlabels (const_gimple gs
)
3326 const gimple_statement_asm
*asm_stmt
=
3327 as_a
<const gimple_statement_asm
*> (gs
);
3328 return asm_stmt
->nl
;
3331 /* Return input operand INDEX of GIMPLE_ASM GS. */
3334 gimple_asm_input_op (const_gimple gs
, unsigned index
)
3336 const gimple_statement_asm
*asm_stmt
=
3337 as_a
<const gimple_statement_asm
*> (gs
);
3338 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
3339 return gimple_op (gs
, index
+ asm_stmt
->no
);
3342 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
3344 static inline tree
*
3345 gimple_asm_input_op_ptr (const_gimple gs
, unsigned index
)
3347 const gimple_statement_asm
*asm_stmt
=
3348 as_a
<const gimple_statement_asm
*> (gs
);
3349 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
3350 return gimple_op_ptr (gs
, index
+ asm_stmt
->no
);
3354 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
3357 gimple_asm_set_input_op (gimple gs
, unsigned index
, tree in_op
)
3359 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
*> (gs
);
3360 gcc_gimple_checking_assert (index
< asm_stmt
->ni
3361 && TREE_CODE (in_op
) == TREE_LIST
);
3362 gimple_set_op (gs
, index
+ asm_stmt
->no
, in_op
);
3366 /* Return output operand INDEX of GIMPLE_ASM GS. */
3369 gimple_asm_output_op (const_gimple gs
, unsigned index
)
3371 const gimple_statement_asm
*asm_stmt
=
3372 as_a
<const gimple_statement_asm
*> (gs
);
3373 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
3374 return gimple_op (gs
, index
);
3377 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
3379 static inline tree
*
3380 gimple_asm_output_op_ptr (const_gimple gs
, unsigned index
)
3382 const gimple_statement_asm
*asm_stmt
=
3383 as_a
<const gimple_statement_asm
*> (gs
);
3384 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
3385 return gimple_op_ptr (gs
, index
);
3389 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
3392 gimple_asm_set_output_op (gimple gs
, unsigned index
, tree out_op
)
3394 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
*> (gs
);
3395 gcc_gimple_checking_assert (index
< asm_stmt
->no
3396 && TREE_CODE (out_op
) == TREE_LIST
);
3397 gimple_set_op (gs
, index
, out_op
);
3401 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3404 gimple_asm_clobber_op (const_gimple gs
, unsigned index
)
3406 const gimple_statement_asm
*asm_stmt
=
3407 as_a
<const gimple_statement_asm
*> (gs
);
3408 gcc_gimple_checking_assert (index
< asm_stmt
->nc
);
3409 return gimple_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->no
);
3413 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3416 gimple_asm_set_clobber_op (gimple gs
, unsigned index
, tree clobber_op
)
3418 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
*> (gs
);
3419 gcc_gimple_checking_assert (index
< asm_stmt
->nc
3420 && TREE_CODE (clobber_op
) == TREE_LIST
);
3421 gimple_set_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->no
, clobber_op
);
3424 /* Return label operand INDEX of GIMPLE_ASM GS. */
3427 gimple_asm_label_op (const_gimple gs
, unsigned index
)
3429 const gimple_statement_asm
*asm_stmt
=
3430 as_a
<const gimple_statement_asm
*> (gs
);
3431 gcc_gimple_checking_assert (index
< asm_stmt
->nl
);
3432 return gimple_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->nc
);
3435 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3438 gimple_asm_set_label_op (gimple gs
, unsigned index
, tree label_op
)
3440 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
*> (gs
);
3441 gcc_gimple_checking_assert (index
< asm_stmt
->nl
3442 && TREE_CODE (label_op
) == TREE_LIST
);
3443 gimple_set_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->nc
, label_op
);
3446 /* Return the string representing the assembly instruction in
3449 static inline const char *
3450 gimple_asm_string (const_gimple gs
)
3452 const gimple_statement_asm
*asm_stmt
=
3453 as_a
<const gimple_statement_asm
*> (gs
);
3454 return asm_stmt
->string
;
3458 /* Return true if GS is an asm statement marked volatile. */
3461 gimple_asm_volatile_p (const_gimple gs
)
3463 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3464 return (gs
->subcode
& GF_ASM_VOLATILE
) != 0;
3468 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3471 gimple_asm_set_volatile (gimple gs
, bool volatile_p
)
3473 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3475 gs
->subcode
|= GF_ASM_VOLATILE
;
3477 gs
->subcode
&= ~GF_ASM_VOLATILE
;
3481 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3484 gimple_asm_set_input (gimple gs
, bool input_p
)
3486 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3488 gs
->subcode
|= GF_ASM_INPUT
;
3490 gs
->subcode
&= ~GF_ASM_INPUT
;
3494 /* Return true if asm GS is an ASM_INPUT. */
3497 gimple_asm_input_p (const_gimple gs
)
3499 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3500 return (gs
->subcode
& GF_ASM_INPUT
) != 0;
3504 /* Return the types handled by GIMPLE_CATCH statement GS. */
3507 gimple_catch_types (const_gimple gs
)
3509 const gimple_statement_catch
*catch_stmt
=
3510 as_a
<const gimple_statement_catch
*> (gs
);
3511 return catch_stmt
->types
;
3515 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3517 static inline tree
*
3518 gimple_catch_types_ptr (gimple gs
)
3520 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
*> (gs
);
3521 return &catch_stmt
->types
;
3525 /* Return a pointer to the GIMPLE sequence representing the body of
3526 the handler of GIMPLE_CATCH statement GS. */
3528 static inline gimple_seq
*
3529 gimple_catch_handler_ptr (gimple gs
)
3531 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
*> (gs
);
3532 return &catch_stmt
->handler
;
3536 /* Return the GIMPLE sequence representing the body of the handler of
3537 GIMPLE_CATCH statement GS. */
3539 static inline gimple_seq
3540 gimple_catch_handler (gimple gs
)
3542 return *gimple_catch_handler_ptr (gs
);
3546 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3549 gimple_catch_set_types (gimple gs
, tree t
)
3551 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
*> (gs
);
3552 catch_stmt
->types
= t
;
3556 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3559 gimple_catch_set_handler (gimple gs
, gimple_seq handler
)
3561 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
*> (gs
);
3562 catch_stmt
->handler
= handler
;
3566 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3569 gimple_eh_filter_types (const_gimple gs
)
3571 const gimple_statement_eh_filter
*eh_filter_stmt
=
3572 as_a
<const gimple_statement_eh_filter
*> (gs
);
3573 return eh_filter_stmt
->types
;
3577 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3580 static inline tree
*
3581 gimple_eh_filter_types_ptr (gimple gs
)
3583 gimple_statement_eh_filter
*eh_filter_stmt
=
3584 as_a
<gimple_statement_eh_filter
*> (gs
);
3585 return &eh_filter_stmt
->types
;
3589 /* Return a pointer to the sequence of statement to execute when
3590 GIMPLE_EH_FILTER statement fails. */
3592 static inline gimple_seq
*
3593 gimple_eh_filter_failure_ptr (gimple gs
)
3595 gimple_statement_eh_filter
*eh_filter_stmt
=
3596 as_a
<gimple_statement_eh_filter
*> (gs
);
3597 return &eh_filter_stmt
->failure
;
3601 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3604 static inline gimple_seq
3605 gimple_eh_filter_failure (gimple gs
)
3607 return *gimple_eh_filter_failure_ptr (gs
);
3611 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3614 gimple_eh_filter_set_types (gimple gs
, tree types
)
3616 gimple_statement_eh_filter
*eh_filter_stmt
=
3617 as_a
<gimple_statement_eh_filter
*> (gs
);
3618 eh_filter_stmt
->types
= types
;
3622 /* Set FAILURE to be the sequence of statements to execute on failure
3623 for GIMPLE_EH_FILTER GS. */
3626 gimple_eh_filter_set_failure (gimple gs
, gimple_seq failure
)
3628 gimple_statement_eh_filter
*eh_filter_stmt
=
3629 as_a
<gimple_statement_eh_filter
*> (gs
);
3630 eh_filter_stmt
->failure
= failure
;
3633 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3636 gimple_eh_must_not_throw_fndecl (gimple gs
)
3638 gimple_statement_eh_mnt
*eh_mnt_stmt
= as_a
<gimple_statement_eh_mnt
*> (gs
);
3639 return eh_mnt_stmt
->fndecl
;
3642 /* Set the function decl to be called by GS to DECL. */
3645 gimple_eh_must_not_throw_set_fndecl (gimple gs
, tree decl
)
3647 gimple_statement_eh_mnt
*eh_mnt_stmt
= as_a
<gimple_statement_eh_mnt
*> (gs
);
3648 eh_mnt_stmt
->fndecl
= decl
;
3651 /* GIMPLE_EH_ELSE accessors. */
3653 static inline gimple_seq
*
3654 gimple_eh_else_n_body_ptr (gimple gs
)
3656 gimple_statement_eh_else
*eh_else_stmt
=
3657 as_a
<gimple_statement_eh_else
*> (gs
);
3658 return &eh_else_stmt
->n_body
;
3661 static inline gimple_seq
3662 gimple_eh_else_n_body (gimple gs
)
3664 return *gimple_eh_else_n_body_ptr (gs
);
3667 static inline gimple_seq
*
3668 gimple_eh_else_e_body_ptr (gimple gs
)
3670 gimple_statement_eh_else
*eh_else_stmt
=
3671 as_a
<gimple_statement_eh_else
*> (gs
);
3672 return &eh_else_stmt
->e_body
;
3675 static inline gimple_seq
3676 gimple_eh_else_e_body (gimple gs
)
3678 return *gimple_eh_else_e_body_ptr (gs
);
3682 gimple_eh_else_set_n_body (gimple gs
, gimple_seq seq
)
3684 gimple_statement_eh_else
*eh_else_stmt
=
3685 as_a
<gimple_statement_eh_else
*> (gs
);
3686 eh_else_stmt
->n_body
= seq
;
3690 gimple_eh_else_set_e_body (gimple gs
, gimple_seq seq
)
3692 gimple_statement_eh_else
*eh_else_stmt
=
3693 as_a
<gimple_statement_eh_else
*> (gs
);
3694 eh_else_stmt
->e_body
= seq
;
3697 /* GIMPLE_TRY accessors. */
3699 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3700 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3702 static inline enum gimple_try_flags
3703 gimple_try_kind (const_gimple gs
)
3705 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
3706 return (enum gimple_try_flags
) (gs
->subcode
& GIMPLE_TRY_KIND
);
3710 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3713 gimple_try_set_kind (gimple gs
, enum gimple_try_flags kind
)
3715 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
3716 gcc_gimple_checking_assert (kind
== GIMPLE_TRY_CATCH
3717 || kind
== GIMPLE_TRY_FINALLY
);
3718 if (gimple_try_kind (gs
) != kind
)
3719 gs
->subcode
= (unsigned int) kind
;
3723 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3726 gimple_try_catch_is_cleanup (const_gimple gs
)
3728 gcc_gimple_checking_assert (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
);
3729 return (gs
->subcode
& GIMPLE_TRY_CATCH_IS_CLEANUP
) != 0;
3733 /* Return a pointer to the sequence of statements used as the
3734 body for GIMPLE_TRY GS. */
3736 static inline gimple_seq
*
3737 gimple_try_eval_ptr (gimple gs
)
3739 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
*> (gs
);
3740 return &try_stmt
->eval
;
3744 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3746 static inline gimple_seq
3747 gimple_try_eval (gimple gs
)
3749 return *gimple_try_eval_ptr (gs
);
3753 /* Return a pointer to the sequence of statements used as the cleanup body for
3756 static inline gimple_seq
*
3757 gimple_try_cleanup_ptr (gimple gs
)
3759 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
*> (gs
);
3760 return &try_stmt
->cleanup
;
3764 /* Return the sequence of statements used as the cleanup body for
3767 static inline gimple_seq
3768 gimple_try_cleanup (gimple gs
)
3770 return *gimple_try_cleanup_ptr (gs
);
3774 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3777 gimple_try_set_catch_is_cleanup (gimple g
, bool catch_is_cleanup
)
3779 gcc_gimple_checking_assert (gimple_try_kind (g
) == GIMPLE_TRY_CATCH
);
3780 if (catch_is_cleanup
)
3781 g
->subcode
|= GIMPLE_TRY_CATCH_IS_CLEANUP
;
3783 g
->subcode
&= ~GIMPLE_TRY_CATCH_IS_CLEANUP
;
3787 /* Set EVAL to be the sequence of statements to use as the body for
3791 gimple_try_set_eval (gimple gs
, gimple_seq eval
)
3793 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
*> (gs
);
3794 try_stmt
->eval
= eval
;
3798 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3799 body for GIMPLE_TRY GS. */
3802 gimple_try_set_cleanup (gimple gs
, gimple_seq cleanup
)
3804 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
*> (gs
);
3805 try_stmt
->cleanup
= cleanup
;
3809 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3811 static inline gimple_seq
*
3812 gimple_wce_cleanup_ptr (gimple gs
)
3814 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
3815 return &wce_stmt
->cleanup
;
3819 /* Return the cleanup sequence for cleanup statement GS. */
3821 static inline gimple_seq
3822 gimple_wce_cleanup (gimple gs
)
3824 return *gimple_wce_cleanup_ptr (gs
);
3828 /* Set CLEANUP to be the cleanup sequence for GS. */
3831 gimple_wce_set_cleanup (gimple gs
, gimple_seq cleanup
)
3833 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
*> (gs
);
3834 wce_stmt
->cleanup
= cleanup
;
3838 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3841 gimple_wce_cleanup_eh_only (const_gimple gs
)
3843 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
3844 return gs
->subcode
!= 0;
3848 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3851 gimple_wce_set_cleanup_eh_only (gimple gs
, bool eh_only_p
)
3853 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
3854 gs
->subcode
= (unsigned int) eh_only_p
;
3858 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3860 static inline unsigned
3861 gimple_phi_capacity (const_gimple gs
)
3863 const gimple_statement_phi
*phi_stmt
=
3864 as_a
<const gimple_statement_phi
*> (gs
);
3865 return phi_stmt
->capacity
;
3869 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3870 be exactly the number of incoming edges for the basic block holding
3873 static inline unsigned
3874 gimple_phi_num_args (const_gimple gs
)
3876 const gimple_statement_phi
*phi_stmt
=
3877 as_a
<const gimple_statement_phi
*> (gs
);
3878 return phi_stmt
->nargs
;
3882 /* Return the SSA name created by GIMPLE_PHI GS. */
3885 gimple_phi_result (const_gimple gs
)
3887 const gimple_statement_phi
*phi_stmt
=
3888 as_a
<const gimple_statement_phi
*> (gs
);
3889 return phi_stmt
->result
;
3892 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3894 static inline tree
*
3895 gimple_phi_result_ptr (gimple gs
)
3897 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
*> (gs
);
3898 return &phi_stmt
->result
;
3901 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3904 gimple_phi_set_result (gimple gs
, tree result
)
3906 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
*> (gs
);
3907 phi_stmt
->result
= result
;
3908 if (result
&& TREE_CODE (result
) == SSA_NAME
)
3909 SSA_NAME_DEF_STMT (result
) = gs
;
3913 /* Return the PHI argument corresponding to incoming edge INDEX for
3916 static inline struct phi_arg_d
*
3917 gimple_phi_arg (gimple gs
, unsigned index
)
3919 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
*> (gs
);
3920 gcc_gimple_checking_assert (index
<= phi_stmt
->capacity
);
3921 return &(phi_stmt
->args
[index
]);
3924 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3925 for GIMPLE_PHI GS. */
3928 gimple_phi_set_arg (gimple gs
, unsigned index
, struct phi_arg_d
* phiarg
)
3930 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
*> (gs
);
3931 gcc_gimple_checking_assert (index
<= phi_stmt
->nargs
);
3932 phi_stmt
->args
[index
] = *phiarg
;
3935 /* Return the PHI nodes for basic block BB, or NULL if there are no
3938 static inline gimple_seq
3939 phi_nodes (const_basic_block bb
)
3941 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
3942 return bb
->il
.gimple
.phi_nodes
;
3945 /* Return a pointer to the PHI nodes for basic block BB. */
3947 static inline gimple_seq
*
3948 phi_nodes_ptr (basic_block bb
)
3950 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
3951 return &bb
->il
.gimple
.phi_nodes
;
3954 /* Return the tree operand for argument I of PHI node GS. */
3957 gimple_phi_arg_def (gimple gs
, size_t index
)
3959 return gimple_phi_arg (gs
, index
)->def
;
3963 /* Return a pointer to the tree operand for argument I of PHI node GS. */
3965 static inline tree
*
3966 gimple_phi_arg_def_ptr (gimple gs
, size_t index
)
3968 return &gimple_phi_arg (gs
, index
)->def
;
3971 /* Return the edge associated with argument I of phi node GS. */
3974 gimple_phi_arg_edge (gimple gs
, size_t i
)
3976 return EDGE_PRED (gimple_bb (gs
), i
);
3979 /* Return the source location of gimple argument I of phi node GS. */
3981 static inline source_location
3982 gimple_phi_arg_location (gimple gs
, size_t i
)
3984 return gimple_phi_arg (gs
, i
)->locus
;
3987 /* Return the source location of the argument on edge E of phi node GS. */
3989 static inline source_location
3990 gimple_phi_arg_location_from_edge (gimple gs
, edge e
)
3992 return gimple_phi_arg (gs
, e
->dest_idx
)->locus
;
3995 /* Set the source location of gimple argument I of phi node GS to LOC. */
3998 gimple_phi_arg_set_location (gimple gs
, size_t i
, source_location loc
)
4000 gimple_phi_arg (gs
, i
)->locus
= loc
;
4003 /* Return TRUE if argument I of phi node GS has a location record. */
4006 gimple_phi_arg_has_location (gimple gs
, size_t i
)
4008 return gimple_phi_arg_location (gs
, i
) != UNKNOWN_LOCATION
;
4012 /* Return the region number for GIMPLE_RESX GS. */
4015 gimple_resx_region (const_gimple gs
)
4017 const gimple_statement_resx
*resx_stmt
=
4018 as_a
<const gimple_statement_resx
*> (gs
);
4019 return resx_stmt
->region
;
4022 /* Set REGION to be the region number for GIMPLE_RESX GS. */
4025 gimple_resx_set_region (gimple gs
, int region
)
4027 gimple_statement_resx
*resx_stmt
= as_a
<gimple_statement_resx
*> (gs
);
4028 resx_stmt
->region
= region
;
4031 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
4034 gimple_eh_dispatch_region (const_gimple gs
)
4036 const gimple_statement_eh_dispatch
*eh_dispatch_stmt
=
4037 as_a
<const gimple_statement_eh_dispatch
*> (gs
);
4038 return eh_dispatch_stmt
->region
;
4041 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
4044 gimple_eh_dispatch_set_region (gimple gs
, int region
)
4046 gimple_statement_eh_dispatch
*eh_dispatch_stmt
=
4047 as_a
<gimple_statement_eh_dispatch
*> (gs
);
4048 eh_dispatch_stmt
->region
= region
;
4051 /* Return the number of labels associated with the switch statement GS. */
4053 static inline unsigned
4054 gimple_switch_num_labels (const_gimple gs
)
4057 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4058 num_ops
= gimple_num_ops (gs
);
4059 gcc_gimple_checking_assert (num_ops
> 1);
4064 /* Set NLABELS to be the number of labels for the switch statement GS. */
4067 gimple_switch_set_num_labels (gimple g
, unsigned nlabels
)
4069 GIMPLE_CHECK (g
, GIMPLE_SWITCH
);
4070 gimple_set_num_ops (g
, nlabels
+ 1);
4074 /* Return the index variable used by the switch statement GS. */
4077 gimple_switch_index (const_gimple gs
)
4079 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4080 return gimple_op (gs
, 0);
4084 /* Return a pointer to the index variable for the switch statement GS. */
4086 static inline tree
*
4087 gimple_switch_index_ptr (const_gimple gs
)
4089 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4090 return gimple_op_ptr (gs
, 0);
4094 /* Set INDEX to be the index variable for switch statement GS. */
4097 gimple_switch_set_index (gimple gs
, tree index
)
4099 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4100 gcc_gimple_checking_assert (SSA_VAR_P (index
) || CONSTANT_CLASS_P (index
));
4101 gimple_set_op (gs
, 0, index
);
4105 /* Return the label numbered INDEX. The default label is 0, followed by any
4106 labels in a switch statement. */
4109 gimple_switch_label (const_gimple gs
, unsigned index
)
4111 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4112 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1);
4113 return gimple_op (gs
, index
+ 1);
4116 /* Set the label number INDEX to LABEL. 0 is always the default label. */
4119 gimple_switch_set_label (gimple gs
, unsigned index
, tree label
)
4121 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4122 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1
4123 && (label
== NULL_TREE
4124 || TREE_CODE (label
) == CASE_LABEL_EXPR
));
4125 gimple_set_op (gs
, index
+ 1, label
);
4128 /* Return the default label for a switch statement. */
4131 gimple_switch_default_label (const_gimple gs
)
4133 tree label
= gimple_switch_label (gs
, 0);
4134 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4138 /* Set the default label for a switch statement. */
4141 gimple_switch_set_default_label (gimple gs
, tree label
)
4143 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4144 gimple_switch_set_label (gs
, 0, label
);
4147 /* Return true if GS is a GIMPLE_DEBUG statement. */
4150 is_gimple_debug (const_gimple gs
)
4152 return gimple_code (gs
) == GIMPLE_DEBUG
;
4155 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
4158 gimple_debug_bind_p (const_gimple s
)
4160 if (is_gimple_debug (s
))
4161 return s
->subcode
== GIMPLE_DEBUG_BIND
;
4166 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
4169 gimple_debug_bind_get_var (gimple dbg
)
4171 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4172 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4173 return gimple_op (dbg
, 0);
4176 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
4180 gimple_debug_bind_get_value (gimple dbg
)
4182 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4183 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4184 return gimple_op (dbg
, 1);
4187 /* Return a pointer to the value bound to the variable in a
4188 GIMPLE_DEBUG bind statement. */
4190 static inline tree
*
4191 gimple_debug_bind_get_value_ptr (gimple dbg
)
4193 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4194 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4195 return gimple_op_ptr (dbg
, 1);
4198 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
4201 gimple_debug_bind_set_var (gimple dbg
, tree var
)
4203 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4204 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4205 gimple_set_op (dbg
, 0, var
);
4208 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
4212 gimple_debug_bind_set_value (gimple dbg
, tree value
)
4214 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4215 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4216 gimple_set_op (dbg
, 1, value
);
4219 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
4221 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
4223 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
4227 gimple_debug_bind_reset_value (gimple dbg
)
4229 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4230 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4231 gimple_set_op (dbg
, 1, GIMPLE_DEBUG_BIND_NOVALUE
);
4234 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
4238 gimple_debug_bind_has_value_p (gimple dbg
)
4240 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4241 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4242 return gimple_op (dbg
, 1) != GIMPLE_DEBUG_BIND_NOVALUE
;
4245 #undef GIMPLE_DEBUG_BIND_NOVALUE
4247 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
4250 gimple_debug_source_bind_p (const_gimple s
)
4252 if (is_gimple_debug (s
))
4253 return s
->subcode
== GIMPLE_DEBUG_SOURCE_BIND
;
4258 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
4261 gimple_debug_source_bind_get_var (gimple dbg
)
4263 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4264 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4265 return gimple_op (dbg
, 0);
4268 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
4272 gimple_debug_source_bind_get_value (gimple dbg
)
4274 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4275 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4276 return gimple_op (dbg
, 1);
4279 /* Return a pointer to the value bound to the variable in a
4280 GIMPLE_DEBUG source bind statement. */
4282 static inline tree
*
4283 gimple_debug_source_bind_get_value_ptr (gimple dbg
)
4285 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4286 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4287 return gimple_op_ptr (dbg
, 1);
4290 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
4293 gimple_debug_source_bind_set_var (gimple dbg
, tree var
)
4295 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4296 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4297 gimple_set_op (dbg
, 0, var
);
4300 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
4304 gimple_debug_source_bind_set_value (gimple dbg
, tree value
)
4306 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4307 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4308 gimple_set_op (dbg
, 1, value
);
4311 /* Return the line number for EXPR, or return -1 if we have no line
4312 number information for it. */
4314 get_lineno (const_gimple stmt
)
4321 loc
= gimple_location (stmt
);
4322 if (loc
== UNKNOWN_LOCATION
)
4325 return LOCATION_LINE (loc
);
4328 /* Return a pointer to the body for the OMP statement GS. */
4330 static inline gimple_seq
*
4331 gimple_omp_body_ptr (gimple gs
)
4333 return &static_cast <gimple_statement_omp
*> (gs
)->body
;
4336 /* Return the body for the OMP statement GS. */
4338 static inline gimple_seq
4339 gimple_omp_body (gimple gs
)
4341 return *gimple_omp_body_ptr (gs
);
4344 /* Set BODY to be the body for the OMP statement GS. */
4347 gimple_omp_set_body (gimple gs
, gimple_seq body
)
4349 static_cast <gimple_statement_omp
*> (gs
)->body
= body
;
4353 /* Return the name associated with OMP_CRITICAL statement GS. */
4356 gimple_omp_critical_name (const_gimple gs
)
4358 const gimple_statement_omp_critical
*omp_critical_stmt
=
4359 as_a
<const gimple_statement_omp_critical
*> (gs
);
4360 return omp_critical_stmt
->name
;
4364 /* Return a pointer to the name associated with OMP critical statement GS. */
4366 static inline tree
*
4367 gimple_omp_critical_name_ptr (gimple gs
)
4369 gimple_statement_omp_critical
*omp_critical_stmt
=
4370 as_a
<gimple_statement_omp_critical
*> (gs
);
4371 return &omp_critical_stmt
->name
;
4375 /* Set NAME to be the name associated with OMP critical statement GS. */
4378 gimple_omp_critical_set_name (gimple gs
, tree name
)
4380 gimple_statement_omp_critical
*omp_critical_stmt
=
4381 as_a
<gimple_statement_omp_critical
*> (gs
);
4382 omp_critical_stmt
->name
= name
;
4386 /* Return the kind of OMP for statemement. */
4389 gimple_omp_for_kind (const_gimple g
)
4391 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4392 return (gimple_omp_subcode (g
) & GF_OMP_FOR_KIND_MASK
);
4396 /* Set the OMP for kind. */
4399 gimple_omp_for_set_kind (gimple g
, int kind
)
4401 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4402 g
->subcode
= (g
->subcode
& ~GF_OMP_FOR_KIND_MASK
)
4403 | (kind
& GF_OMP_FOR_KIND_MASK
);
4407 /* Return true if OMP for statement G has the
4408 GF_OMP_FOR_COMBINED flag set. */
4411 gimple_omp_for_combined_p (const_gimple g
)
4413 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4414 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED
) != 0;
4418 /* Set the GF_OMP_FOR_COMBINED field in G depending on the boolean
4419 value of COMBINED_P. */
4422 gimple_omp_for_set_combined_p (gimple g
, bool combined_p
)
4424 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4426 g
->subcode
|= GF_OMP_FOR_COMBINED
;
4428 g
->subcode
&= ~GF_OMP_FOR_COMBINED
;
4432 /* Return true if OMP for statement G has the
4433 GF_OMP_FOR_COMBINED_INTO flag set. */
4436 gimple_omp_for_combined_into_p (const_gimple g
)
4438 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4439 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED_INTO
) != 0;
4443 /* Set the GF_OMP_FOR_COMBINED_INTO field in G depending on the boolean
4444 value of COMBINED_P. */
4447 gimple_omp_for_set_combined_into_p (gimple g
, bool combined_p
)
4449 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4451 g
->subcode
|= GF_OMP_FOR_COMBINED_INTO
;
4453 g
->subcode
&= ~GF_OMP_FOR_COMBINED_INTO
;
4457 /* Return the clauses associated with OMP_FOR GS. */
4460 gimple_omp_for_clauses (const_gimple gs
)
4462 const gimple_statement_omp_for
*omp_for_stmt
=
4463 as_a
<const gimple_statement_omp_for
*> (gs
);
4464 return omp_for_stmt
->clauses
;
4468 /* Return a pointer to the OMP_FOR GS. */
4470 static inline tree
*
4471 gimple_omp_for_clauses_ptr (gimple gs
)
4473 gimple_statement_omp_for
*omp_for_stmt
=
4474 as_a
<gimple_statement_omp_for
*> (gs
);
4475 return &omp_for_stmt
->clauses
;
4479 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
4482 gimple_omp_for_set_clauses (gimple gs
, tree clauses
)
4484 gimple_statement_omp_for
*omp_for_stmt
=
4485 as_a
<gimple_statement_omp_for
*> (gs
);
4486 omp_for_stmt
->clauses
= clauses
;
4490 /* Get the collapse count of OMP_FOR GS. */
4492 static inline size_t
4493 gimple_omp_for_collapse (gimple gs
)
4495 gimple_statement_omp_for
*omp_for_stmt
=
4496 as_a
<gimple_statement_omp_for
*> (gs
);
4497 return omp_for_stmt
->collapse
;
4501 /* Return the index variable for OMP_FOR GS. */
4504 gimple_omp_for_index (const_gimple gs
, size_t i
)
4506 const gimple_statement_omp_for
*omp_for_stmt
=
4507 as_a
<const gimple_statement_omp_for
*> (gs
);
4508 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4509 return omp_for_stmt
->iter
[i
].index
;
4513 /* Return a pointer to the index variable for OMP_FOR GS. */
4515 static inline tree
*
4516 gimple_omp_for_index_ptr (gimple gs
, size_t i
)
4518 gimple_statement_omp_for
*omp_for_stmt
=
4519 as_a
<gimple_statement_omp_for
*> (gs
);
4520 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4521 return &omp_for_stmt
->iter
[i
].index
;
4525 /* Set INDEX to be the index variable for OMP_FOR GS. */
4528 gimple_omp_for_set_index (gimple gs
, size_t i
, tree index
)
4530 gimple_statement_omp_for
*omp_for_stmt
=
4531 as_a
<gimple_statement_omp_for
*> (gs
);
4532 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4533 omp_for_stmt
->iter
[i
].index
= index
;
4537 /* Return the initial value for OMP_FOR GS. */
4540 gimple_omp_for_initial (const_gimple gs
, size_t i
)
4542 const gimple_statement_omp_for
*omp_for_stmt
=
4543 as_a
<const gimple_statement_omp_for
*> (gs
);
4544 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4545 return omp_for_stmt
->iter
[i
].initial
;
4549 /* Return a pointer to the initial value for OMP_FOR GS. */
4551 static inline tree
*
4552 gimple_omp_for_initial_ptr (gimple gs
, size_t i
)
4554 gimple_statement_omp_for
*omp_for_stmt
=
4555 as_a
<gimple_statement_omp_for
*> (gs
);
4556 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4557 return &omp_for_stmt
->iter
[i
].initial
;
4561 /* Set INITIAL to be the initial value for OMP_FOR GS. */
4564 gimple_omp_for_set_initial (gimple gs
, size_t i
, tree initial
)
4566 gimple_statement_omp_for
*omp_for_stmt
=
4567 as_a
<gimple_statement_omp_for
*> (gs
);
4568 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4569 omp_for_stmt
->iter
[i
].initial
= initial
;
4573 /* Return the final value for OMP_FOR GS. */
4576 gimple_omp_for_final (const_gimple gs
, size_t i
)
4578 const gimple_statement_omp_for
*omp_for_stmt
=
4579 as_a
<const gimple_statement_omp_for
*> (gs
);
4580 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4581 return omp_for_stmt
->iter
[i
].final
;
4585 /* Return a pointer to the final value for OMP_FOR GS. */
4587 static inline tree
*
4588 gimple_omp_for_final_ptr (gimple gs
, size_t i
)
4590 gimple_statement_omp_for
*omp_for_stmt
=
4591 as_a
<gimple_statement_omp_for
*> (gs
);
4592 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4593 return &omp_for_stmt
->iter
[i
].final
;
4597 /* Set FINAL to be the final value for OMP_FOR GS. */
4600 gimple_omp_for_set_final (gimple gs
, size_t i
, tree final
)
4602 gimple_statement_omp_for
*omp_for_stmt
=
4603 as_a
<gimple_statement_omp_for
*> (gs
);
4604 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4605 omp_for_stmt
->iter
[i
].final
= final
;
4609 /* Return the increment value for OMP_FOR GS. */
4612 gimple_omp_for_incr (const_gimple gs
, size_t i
)
4614 const gimple_statement_omp_for
*omp_for_stmt
=
4615 as_a
<const gimple_statement_omp_for
*> (gs
);
4616 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4617 return omp_for_stmt
->iter
[i
].incr
;
4621 /* Return a pointer to the increment value for OMP_FOR GS. */
4623 static inline tree
*
4624 gimple_omp_for_incr_ptr (gimple gs
, size_t i
)
4626 gimple_statement_omp_for
*omp_for_stmt
=
4627 as_a
<gimple_statement_omp_for
*> (gs
);
4628 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4629 return &omp_for_stmt
->iter
[i
].incr
;
4633 /* Set INCR to be the increment value for OMP_FOR GS. */
4636 gimple_omp_for_set_incr (gimple gs
, size_t i
, tree incr
)
4638 gimple_statement_omp_for
*omp_for_stmt
=
4639 as_a
<gimple_statement_omp_for
*> (gs
);
4640 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4641 omp_for_stmt
->iter
[i
].incr
= incr
;
4645 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4646 statement GS starts. */
4648 static inline gimple_seq
*
4649 gimple_omp_for_pre_body_ptr (gimple gs
)
4651 gimple_statement_omp_for
*omp_for_stmt
=
4652 as_a
<gimple_statement_omp_for
*> (gs
);
4653 return &omp_for_stmt
->pre_body
;
4657 /* Return the sequence of statements to execute before the OMP_FOR
4658 statement GS starts. */
4660 static inline gimple_seq
4661 gimple_omp_for_pre_body (gimple gs
)
4663 return *gimple_omp_for_pre_body_ptr (gs
);
4667 /* Set PRE_BODY to be the sequence of statements to execute before the
4668 OMP_FOR statement GS starts. */
4671 gimple_omp_for_set_pre_body (gimple gs
, gimple_seq pre_body
)
4673 gimple_statement_omp_for
*omp_for_stmt
=
4674 as_a
<gimple_statement_omp_for
*> (gs
);
4675 omp_for_stmt
->pre_body
= pre_body
;
4679 /* Return the clauses associated with OMP_PARALLEL GS. */
4682 gimple_omp_parallel_clauses (const_gimple gs
)
4684 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4685 as_a
<const gimple_statement_omp_parallel
*> (gs
);
4686 return omp_parallel_stmt
->clauses
;
4690 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4692 static inline tree
*
4693 gimple_omp_parallel_clauses_ptr (gimple gs
)
4695 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4696 as_a
<gimple_statement_omp_parallel
*> (gs
);
4697 return &omp_parallel_stmt
->clauses
;
4701 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4705 gimple_omp_parallel_set_clauses (gimple gs
, tree clauses
)
4707 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4708 as_a
<gimple_statement_omp_parallel
*> (gs
);
4709 omp_parallel_stmt
->clauses
= clauses
;
4713 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4716 gimple_omp_parallel_child_fn (const_gimple gs
)
4718 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4719 as_a
<const gimple_statement_omp_parallel
*> (gs
);
4720 return omp_parallel_stmt
->child_fn
;
4723 /* Return a pointer to the child function used to hold the body of
4726 static inline tree
*
4727 gimple_omp_parallel_child_fn_ptr (gimple gs
)
4729 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4730 as_a
<gimple_statement_omp_parallel
*> (gs
);
4731 return &omp_parallel_stmt
->child_fn
;
4735 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4738 gimple_omp_parallel_set_child_fn (gimple gs
, tree child_fn
)
4740 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4741 as_a
<gimple_statement_omp_parallel
*> (gs
);
4742 omp_parallel_stmt
->child_fn
= child_fn
;
4746 /* Return the artificial argument used to send variables and values
4747 from the parent to the children threads in OMP_PARALLEL GS. */
4750 gimple_omp_parallel_data_arg (const_gimple gs
)
4752 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4753 as_a
<const gimple_statement_omp_parallel
*> (gs
);
4754 return omp_parallel_stmt
->data_arg
;
4758 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4760 static inline tree
*
4761 gimple_omp_parallel_data_arg_ptr (gimple gs
)
4763 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4764 as_a
<gimple_statement_omp_parallel
*> (gs
);
4765 return &omp_parallel_stmt
->data_arg
;
4769 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4772 gimple_omp_parallel_set_data_arg (gimple gs
, tree data_arg
)
4774 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4775 as_a
<gimple_statement_omp_parallel
*> (gs
);
4776 omp_parallel_stmt
->data_arg
= data_arg
;
4780 /* Return the clauses associated with OMP_TASK GS. */
4783 gimple_omp_task_clauses (const_gimple gs
)
4785 const gimple_statement_omp_task
*omp_task_stmt
=
4786 as_a
<const gimple_statement_omp_task
*> (gs
);
4787 return omp_task_stmt
->clauses
;
4791 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4793 static inline tree
*
4794 gimple_omp_task_clauses_ptr (gimple gs
)
4796 gimple_statement_omp_task
*omp_task_stmt
=
4797 as_a
<gimple_statement_omp_task
*> (gs
);
4798 return &omp_task_stmt
->clauses
;
4802 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4806 gimple_omp_task_set_clauses (gimple gs
, tree clauses
)
4808 gimple_statement_omp_task
*omp_task_stmt
=
4809 as_a
<gimple_statement_omp_task
*> (gs
);
4810 omp_task_stmt
->clauses
= clauses
;
4814 /* Return the child function used to hold the body of OMP_TASK GS. */
4817 gimple_omp_task_child_fn (const_gimple gs
)
4819 const gimple_statement_omp_task
*omp_task_stmt
=
4820 as_a
<const gimple_statement_omp_task
*> (gs
);
4821 return omp_task_stmt
->child_fn
;
4824 /* Return a pointer to the child function used to hold the body of
4827 static inline tree
*
4828 gimple_omp_task_child_fn_ptr (gimple gs
)
4830 gimple_statement_omp_task
*omp_task_stmt
=
4831 as_a
<gimple_statement_omp_task
*> (gs
);
4832 return &omp_task_stmt
->child_fn
;
4836 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4839 gimple_omp_task_set_child_fn (gimple gs
, tree child_fn
)
4841 gimple_statement_omp_task
*omp_task_stmt
=
4842 as_a
<gimple_statement_omp_task
*> (gs
);
4843 omp_task_stmt
->child_fn
= child_fn
;
4847 /* Return the artificial argument used to send variables and values
4848 from the parent to the children threads in OMP_TASK GS. */
4851 gimple_omp_task_data_arg (const_gimple gs
)
4853 const gimple_statement_omp_task
*omp_task_stmt
=
4854 as_a
<const gimple_statement_omp_task
*> (gs
);
4855 return omp_task_stmt
->data_arg
;
4859 /* Return a pointer to the data argument for OMP_TASK GS. */
4861 static inline tree
*
4862 gimple_omp_task_data_arg_ptr (gimple gs
)
4864 gimple_statement_omp_task
*omp_task_stmt
=
4865 as_a
<gimple_statement_omp_task
*> (gs
);
4866 return &omp_task_stmt
->data_arg
;
4870 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4873 gimple_omp_task_set_data_arg (gimple gs
, tree data_arg
)
4875 gimple_statement_omp_task
*omp_task_stmt
=
4876 as_a
<gimple_statement_omp_task
*> (gs
);
4877 omp_task_stmt
->data_arg
= data_arg
;
4881 /* Return the clauses associated with OMP_TASK GS. */
4884 gimple_omp_taskreg_clauses (const_gimple gs
)
4886 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4887 as_a
<const gimple_statement_omp_taskreg
*> (gs
);
4888 return omp_taskreg_stmt
->clauses
;
4892 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4894 static inline tree
*
4895 gimple_omp_taskreg_clauses_ptr (gimple gs
)
4897 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4898 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4899 return &omp_taskreg_stmt
->clauses
;
4903 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4907 gimple_omp_taskreg_set_clauses (gimple gs
, tree clauses
)
4909 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4910 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4911 omp_taskreg_stmt
->clauses
= clauses
;
4915 /* Return the child function used to hold the body of OMP_TASK GS. */
4918 gimple_omp_taskreg_child_fn (const_gimple gs
)
4920 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4921 as_a
<const gimple_statement_omp_taskreg
*> (gs
);
4922 return omp_taskreg_stmt
->child_fn
;
4925 /* Return a pointer to the child function used to hold the body of
4928 static inline tree
*
4929 gimple_omp_taskreg_child_fn_ptr (gimple gs
)
4931 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4932 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4933 return &omp_taskreg_stmt
->child_fn
;
4937 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4940 gimple_omp_taskreg_set_child_fn (gimple gs
, tree child_fn
)
4942 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4943 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4944 omp_taskreg_stmt
->child_fn
= child_fn
;
4948 /* Return the artificial argument used to send variables and values
4949 from the parent to the children threads in OMP_TASK GS. */
4952 gimple_omp_taskreg_data_arg (const_gimple gs
)
4954 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4955 as_a
<const gimple_statement_omp_taskreg
*> (gs
);
4956 return omp_taskreg_stmt
->data_arg
;
4960 /* Return a pointer to the data argument for OMP_TASK GS. */
4962 static inline tree
*
4963 gimple_omp_taskreg_data_arg_ptr (gimple gs
)
4965 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4966 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4967 return &omp_taskreg_stmt
->data_arg
;
4971 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4974 gimple_omp_taskreg_set_data_arg (gimple gs
, tree data_arg
)
4976 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4977 as_a
<gimple_statement_omp_taskreg
*> (gs
);
4978 omp_taskreg_stmt
->data_arg
= data_arg
;
4982 /* Return the copy function used to hold the body of OMP_TASK GS. */
4985 gimple_omp_task_copy_fn (const_gimple gs
)
4987 const gimple_statement_omp_task
*omp_task_stmt
=
4988 as_a
<const gimple_statement_omp_task
*> (gs
);
4989 return omp_task_stmt
->copy_fn
;
4992 /* Return a pointer to the copy function used to hold the body of
4995 static inline tree
*
4996 gimple_omp_task_copy_fn_ptr (gimple gs
)
4998 gimple_statement_omp_task
*omp_task_stmt
=
4999 as_a
<gimple_statement_omp_task
*> (gs
);
5000 return &omp_task_stmt
->copy_fn
;
5004 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
5007 gimple_omp_task_set_copy_fn (gimple gs
, tree copy_fn
)
5009 gimple_statement_omp_task
*omp_task_stmt
=
5010 as_a
<gimple_statement_omp_task
*> (gs
);
5011 omp_task_stmt
->copy_fn
= copy_fn
;
5015 /* Return size of the data block in bytes in OMP_TASK GS. */
5018 gimple_omp_task_arg_size (const_gimple gs
)
5020 const gimple_statement_omp_task
*omp_task_stmt
=
5021 as_a
<const gimple_statement_omp_task
*> (gs
);
5022 return omp_task_stmt
->arg_size
;
5026 /* Return a pointer to the data block size for OMP_TASK GS. */
5028 static inline tree
*
5029 gimple_omp_task_arg_size_ptr (gimple gs
)
5031 gimple_statement_omp_task
*omp_task_stmt
=
5032 as_a
<gimple_statement_omp_task
*> (gs
);
5033 return &omp_task_stmt
->arg_size
;
5037 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
5040 gimple_omp_task_set_arg_size (gimple gs
, tree arg_size
)
5042 gimple_statement_omp_task
*omp_task_stmt
=
5043 as_a
<gimple_statement_omp_task
*> (gs
);
5044 omp_task_stmt
->arg_size
= arg_size
;
5048 /* Return align of the data block in bytes in OMP_TASK GS. */
5051 gimple_omp_task_arg_align (const_gimple gs
)
5053 const gimple_statement_omp_task
*omp_task_stmt
=
5054 as_a
<const gimple_statement_omp_task
*> (gs
);
5055 return omp_task_stmt
->arg_align
;
5059 /* Return a pointer to the data block align for OMP_TASK GS. */
5061 static inline tree
*
5062 gimple_omp_task_arg_align_ptr (gimple gs
)
5064 gimple_statement_omp_task
*omp_task_stmt
=
5065 as_a
<gimple_statement_omp_task
*> (gs
);
5066 return &omp_task_stmt
->arg_align
;
5070 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
5073 gimple_omp_task_set_arg_align (gimple gs
, tree arg_align
)
5075 gimple_statement_omp_task
*omp_task_stmt
=
5076 as_a
<gimple_statement_omp_task
*> (gs
);
5077 omp_task_stmt
->arg_align
= arg_align
;
5081 /* Return the clauses associated with OMP_SINGLE GS. */
5084 gimple_omp_single_clauses (const_gimple gs
)
5086 const gimple_statement_omp_single
*omp_single_stmt
=
5087 as_a
<const gimple_statement_omp_single
*> (gs
);
5088 return omp_single_stmt
->clauses
;
5092 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
5094 static inline tree
*
5095 gimple_omp_single_clauses_ptr (gimple gs
)
5097 gimple_statement_omp_single
*omp_single_stmt
=
5098 as_a
<gimple_statement_omp_single
*> (gs
);
5099 return &omp_single_stmt
->clauses
;
5103 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
5106 gimple_omp_single_set_clauses (gimple gs
, tree clauses
)
5108 gimple_statement_omp_single
*omp_single_stmt
=
5109 as_a
<gimple_statement_omp_single
*> (gs
);
5110 omp_single_stmt
->clauses
= clauses
;
5114 /* Return the clauses associated with OMP_TARGET GS. */
5117 gimple_omp_target_clauses (const_gimple gs
)
5119 const gimple_statement_omp_target
*omp_target_stmt
=
5120 as_a
<const gimple_statement_omp_target
*> (gs
);
5121 return omp_target_stmt
->clauses
;
5125 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
5127 static inline tree
*
5128 gimple_omp_target_clauses_ptr (gimple gs
)
5130 gimple_statement_omp_target
*omp_target_stmt
=
5131 as_a
<gimple_statement_omp_target
*> (gs
);
5132 return &omp_target_stmt
->clauses
;
5136 /* Set CLAUSES to be the clauses associated with OMP_TARGET GS. */
5139 gimple_omp_target_set_clauses (gimple gs
, tree clauses
)
5141 gimple_statement_omp_target
*omp_target_stmt
=
5142 as_a
<gimple_statement_omp_target
*> (gs
);
5143 omp_target_stmt
->clauses
= clauses
;
5147 /* Return the kind of OMP target statemement. */
5150 gimple_omp_target_kind (const_gimple g
)
5152 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
5153 return (gimple_omp_subcode (g
) & GF_OMP_TARGET_KIND_MASK
);
5157 /* Set the OMP target kind. */
5160 gimple_omp_target_set_kind (gimple g
, int kind
)
5162 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
5163 g
->subcode
= (g
->subcode
& ~GF_OMP_TARGET_KIND_MASK
)
5164 | (kind
& GF_OMP_TARGET_KIND_MASK
);
5168 /* Return the child function used to hold the body of OMP_TARGET GS. */
5171 gimple_omp_target_child_fn (const_gimple gs
)
5173 const gimple_statement_omp_target
*omp_target_stmt
=
5174 as_a
<const gimple_statement_omp_target
*> (gs
);
5175 return omp_target_stmt
->child_fn
;
5178 /* Return a pointer to the child function used to hold the body of
5181 static inline tree
*
5182 gimple_omp_target_child_fn_ptr (gimple gs
)
5184 gimple_statement_omp_target
*omp_target_stmt
=
5185 as_a
<gimple_statement_omp_target
*> (gs
);
5186 return &omp_target_stmt
->child_fn
;
5190 /* Set CHILD_FN to be the child function for OMP_TARGET GS. */
5193 gimple_omp_target_set_child_fn (gimple gs
, tree child_fn
)
5195 gimple_statement_omp_target
*omp_target_stmt
=
5196 as_a
<gimple_statement_omp_target
*> (gs
);
5197 omp_target_stmt
->child_fn
= child_fn
;
5201 /* Return the artificial argument used to send variables and values
5202 from the parent to the children threads in OMP_TARGET GS. */
5205 gimple_omp_target_data_arg (const_gimple gs
)
5207 const gimple_statement_omp_target
*omp_target_stmt
=
5208 as_a
<const gimple_statement_omp_target
*> (gs
);
5209 return omp_target_stmt
->data_arg
;
5213 /* Return a pointer to the data argument for OMP_TARGET GS. */
5215 static inline tree
*
5216 gimple_omp_target_data_arg_ptr (gimple gs
)
5218 gimple_statement_omp_target
*omp_target_stmt
=
5219 as_a
<gimple_statement_omp_target
*> (gs
);
5220 return &omp_target_stmt
->data_arg
;
5224 /* Set DATA_ARG to be the data argument for OMP_TARGET GS. */
5227 gimple_omp_target_set_data_arg (gimple gs
, tree data_arg
)
5229 gimple_statement_omp_target
*omp_target_stmt
=
5230 as_a
<gimple_statement_omp_target
*> (gs
);
5231 omp_target_stmt
->data_arg
= data_arg
;
5235 /* Return the clauses associated with OMP_TEAMS GS. */
5238 gimple_omp_teams_clauses (const_gimple gs
)
5240 const gimple_statement_omp_teams
*omp_teams_stmt
=
5241 as_a
<const gimple_statement_omp_teams
*> (gs
);
5242 return omp_teams_stmt
->clauses
;
5246 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
5248 static inline tree
*
5249 gimple_omp_teams_clauses_ptr (gimple gs
)
5251 gimple_statement_omp_teams
*omp_teams_stmt
=
5252 as_a
<gimple_statement_omp_teams
*> (gs
);
5253 return &omp_teams_stmt
->clauses
;
5257 /* Set CLAUSES to be the clauses associated with OMP_TEAMS GS. */
5260 gimple_omp_teams_set_clauses (gimple gs
, tree clauses
)
5262 gimple_statement_omp_teams
*omp_teams_stmt
=
5263 as_a
<gimple_statement_omp_teams
*> (gs
);
5264 omp_teams_stmt
->clauses
= clauses
;
5268 /* Return the clauses associated with OMP_SECTIONS GS. */
5271 gimple_omp_sections_clauses (const_gimple gs
)
5273 const gimple_statement_omp_sections
*omp_sections_stmt
=
5274 as_a
<const gimple_statement_omp_sections
*> (gs
);
5275 return omp_sections_stmt
->clauses
;
5279 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
5281 static inline tree
*
5282 gimple_omp_sections_clauses_ptr (gimple gs
)
5284 gimple_statement_omp_sections
*omp_sections_stmt
=
5285 as_a
<gimple_statement_omp_sections
*> (gs
);
5286 return &omp_sections_stmt
->clauses
;
5290 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
5294 gimple_omp_sections_set_clauses (gimple gs
, tree clauses
)
5296 gimple_statement_omp_sections
*omp_sections_stmt
=
5297 as_a
<gimple_statement_omp_sections
*> (gs
);
5298 omp_sections_stmt
->clauses
= clauses
;
5302 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
5306 gimple_omp_sections_control (const_gimple gs
)
5308 const gimple_statement_omp_sections
*omp_sections_stmt
=
5309 as_a
<const gimple_statement_omp_sections
*> (gs
);
5310 return omp_sections_stmt
->control
;
5314 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
5317 static inline tree
*
5318 gimple_omp_sections_control_ptr (gimple gs
)
5320 gimple_statement_omp_sections
*omp_sections_stmt
=
5321 as_a
<gimple_statement_omp_sections
*> (gs
);
5322 return &omp_sections_stmt
->control
;
5326 /* Set CONTROL to be the set of clauses associated with the
5327 GIMPLE_OMP_SECTIONS in GS. */
5330 gimple_omp_sections_set_control (gimple gs
, tree control
)
5332 gimple_statement_omp_sections
*omp_sections_stmt
=
5333 as_a
<gimple_statement_omp_sections
*> (gs
);
5334 omp_sections_stmt
->control
= control
;
5338 /* Set COND to be the condition code for OMP_FOR GS. */
5341 gimple_omp_for_set_cond (gimple gs
, size_t i
, enum tree_code cond
)
5343 gimple_statement_omp_for
*omp_for_stmt
=
5344 as_a
<gimple_statement_omp_for
*> (gs
);
5345 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond
) == tcc_comparison
5346 && i
< omp_for_stmt
->collapse
);
5347 omp_for_stmt
->iter
[i
].cond
= cond
;
5351 /* Return the condition code associated with OMP_FOR GS. */
5353 static inline enum tree_code
5354 gimple_omp_for_cond (const_gimple gs
, size_t i
)
5356 const gimple_statement_omp_for
*omp_for_stmt
=
5357 as_a
<const gimple_statement_omp_for
*> (gs
);
5358 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5359 return omp_for_stmt
->iter
[i
].cond
;
5363 /* Set the value being stored in an atomic store. */
5366 gimple_omp_atomic_store_set_val (gimple g
, tree val
)
5368 gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5369 as_a
<gimple_statement_omp_atomic_store
*> (g
);
5370 omp_atomic_store_stmt
->val
= val
;
5374 /* Return the value being stored in an atomic store. */
5377 gimple_omp_atomic_store_val (const_gimple g
)
5379 const gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5380 as_a
<const gimple_statement_omp_atomic_store
*> (g
);
5381 return omp_atomic_store_stmt
->val
;
5385 /* Return a pointer to the value being stored in an atomic store. */
5387 static inline tree
*
5388 gimple_omp_atomic_store_val_ptr (gimple g
)
5390 gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5391 as_a
<gimple_statement_omp_atomic_store
*> (g
);
5392 return &omp_atomic_store_stmt
->val
;
5396 /* Set the LHS of an atomic load. */
5399 gimple_omp_atomic_load_set_lhs (gimple g
, tree lhs
)
5401 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5402 as_a
<gimple_statement_omp_atomic_load
*> (g
);
5403 omp_atomic_load_stmt
->lhs
= lhs
;
5407 /* Get the LHS of an atomic load. */
5410 gimple_omp_atomic_load_lhs (const_gimple g
)
5412 const gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5413 as_a
<const gimple_statement_omp_atomic_load
*> (g
);
5414 return omp_atomic_load_stmt
->lhs
;
5418 /* Return a pointer to the LHS of an atomic load. */
5420 static inline tree
*
5421 gimple_omp_atomic_load_lhs_ptr (gimple g
)
5423 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5424 as_a
<gimple_statement_omp_atomic_load
*> (g
);
5425 return &omp_atomic_load_stmt
->lhs
;
5429 /* Set the RHS of an atomic load. */
5432 gimple_omp_atomic_load_set_rhs (gimple g
, tree rhs
)
5434 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5435 as_a
<gimple_statement_omp_atomic_load
*> (g
);
5436 omp_atomic_load_stmt
->rhs
= rhs
;
5440 /* Get the RHS of an atomic load. */
5443 gimple_omp_atomic_load_rhs (const_gimple g
)
5445 const gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5446 as_a
<const gimple_statement_omp_atomic_load
*> (g
);
5447 return omp_atomic_load_stmt
->rhs
;
5451 /* Return a pointer to the RHS of an atomic load. */
5453 static inline tree
*
5454 gimple_omp_atomic_load_rhs_ptr (gimple g
)
5456 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5457 as_a
<gimple_statement_omp_atomic_load
*> (g
);
5458 return &omp_atomic_load_stmt
->rhs
;
5462 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5465 gimple_omp_continue_control_def (const_gimple g
)
5467 const gimple_statement_omp_continue
*omp_continue_stmt
=
5468 as_a
<const gimple_statement_omp_continue
*> (g
);
5469 return omp_continue_stmt
->control_def
;
5472 /* The same as above, but return the address. */
5474 static inline tree
*
5475 gimple_omp_continue_control_def_ptr (gimple g
)
5477 gimple_statement_omp_continue
*omp_continue_stmt
=
5478 as_a
<gimple_statement_omp_continue
*> (g
);
5479 return &omp_continue_stmt
->control_def
;
5482 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5485 gimple_omp_continue_set_control_def (gimple g
, tree def
)
5487 gimple_statement_omp_continue
*omp_continue_stmt
=
5488 as_a
<gimple_statement_omp_continue
*> (g
);
5489 omp_continue_stmt
->control_def
= def
;
5493 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5496 gimple_omp_continue_control_use (const_gimple g
)
5498 const gimple_statement_omp_continue
*omp_continue_stmt
=
5499 as_a
<const gimple_statement_omp_continue
*> (g
);
5500 return omp_continue_stmt
->control_use
;
5504 /* The same as above, but return the address. */
5506 static inline tree
*
5507 gimple_omp_continue_control_use_ptr (gimple g
)
5509 gimple_statement_omp_continue
*omp_continue_stmt
=
5510 as_a
<gimple_statement_omp_continue
*> (g
);
5511 return &omp_continue_stmt
->control_use
;
5515 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5518 gimple_omp_continue_set_control_use (gimple g
, tree use
)
5520 gimple_statement_omp_continue
*omp_continue_stmt
=
5521 as_a
<gimple_statement_omp_continue
*> (g
);
5522 omp_continue_stmt
->control_use
= use
;
5525 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
5527 static inline gimple_seq
*
5528 gimple_transaction_body_ptr (gimple gs
)
5530 gimple_statement_transaction
*transaction_stmt
=
5531 as_a
<gimple_statement_transaction
*> (gs
);
5532 return &transaction_stmt
->body
;
5535 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
5537 static inline gimple_seq
5538 gimple_transaction_body (gimple gs
)
5540 return *gimple_transaction_body_ptr (gs
);
5543 /* Return the label associated with a GIMPLE_TRANSACTION. */
5546 gimple_transaction_label (const_gimple gs
)
5548 const gimple_statement_transaction
*transaction_stmt
=
5549 as_a
<const gimple_statement_transaction
*> (gs
);
5550 return transaction_stmt
->label
;
5553 static inline tree
*
5554 gimple_transaction_label_ptr (gimple gs
)
5556 gimple_statement_transaction
*transaction_stmt
=
5557 as_a
<gimple_statement_transaction
*> (gs
);
5558 return &transaction_stmt
->label
;
5561 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
5563 static inline unsigned int
5564 gimple_transaction_subcode (const_gimple gs
)
5566 GIMPLE_CHECK (gs
, GIMPLE_TRANSACTION
);
5570 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
5573 gimple_transaction_set_body (gimple gs
, gimple_seq body
)
5575 gimple_statement_transaction
*transaction_stmt
=
5576 as_a
<gimple_statement_transaction
*> (gs
);
5577 transaction_stmt
->body
= body
;
5580 /* Set the label associated with a GIMPLE_TRANSACTION. */
5583 gimple_transaction_set_label (gimple gs
, tree label
)
5585 gimple_statement_transaction
*transaction_stmt
=
5586 as_a
<gimple_statement_transaction
*> (gs
);
5587 transaction_stmt
->label
= label
;
5590 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
5593 gimple_transaction_set_subcode (gimple gs
, unsigned int subcode
)
5595 GIMPLE_CHECK (gs
, GIMPLE_TRANSACTION
);
5596 gs
->subcode
= subcode
;
5600 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
5602 static inline tree
*
5603 gimple_return_retval_ptr (const_gimple gs
)
5605 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5606 return gimple_op_ptr (gs
, 0);
5609 /* Return the return value for GIMPLE_RETURN GS. */
5612 gimple_return_retval (const_gimple gs
)
5614 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5615 return gimple_op (gs
, 0);
5619 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
5622 gimple_return_set_retval (gimple gs
, tree retval
)
5624 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5625 gimple_set_op (gs
, 0, retval
);
5629 /* Return the return bounds for GIMPLE_RETURN GS. */
5632 gimple_return_retbnd (const_gimple gs
)
5634 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5635 return gimple_op (gs
, 1);
5639 /* Set RETVAL to be the return bounds for GIMPLE_RETURN GS. */
5642 gimple_return_set_retbnd (gimple gs
, tree retval
)
5644 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5645 gimple_set_op (gs
, 1, retval
);
5649 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
5651 #define CASE_GIMPLE_OMP \
5652 case GIMPLE_OMP_PARALLEL: \
5653 case GIMPLE_OMP_TASK: \
5654 case GIMPLE_OMP_FOR: \
5655 case GIMPLE_OMP_SECTIONS: \
5656 case GIMPLE_OMP_SECTIONS_SWITCH: \
5657 case GIMPLE_OMP_SINGLE: \
5658 case GIMPLE_OMP_TARGET: \
5659 case GIMPLE_OMP_TEAMS: \
5660 case GIMPLE_OMP_SECTION: \
5661 case GIMPLE_OMP_MASTER: \
5662 case GIMPLE_OMP_TASKGROUP: \
5663 case GIMPLE_OMP_ORDERED: \
5664 case GIMPLE_OMP_CRITICAL: \
5665 case GIMPLE_OMP_RETURN: \
5666 case GIMPLE_OMP_ATOMIC_LOAD: \
5667 case GIMPLE_OMP_ATOMIC_STORE: \
5668 case GIMPLE_OMP_CONTINUE
5671 is_gimple_omp (const_gimple stmt
)
5673 switch (gimple_code (stmt
))
5683 /* Returns TRUE if statement G is a GIMPLE_NOP. */
5686 gimple_nop_p (const_gimple g
)
5688 return gimple_code (g
) == GIMPLE_NOP
;
5692 /* Return true if GS is a GIMPLE_RESX. */
5695 is_gimple_resx (const_gimple gs
)
5697 return gimple_code (gs
) == GIMPLE_RESX
;
5700 /* Return the predictor of GIMPLE_PREDICT statement GS. */
5702 static inline enum br_predictor
5703 gimple_predict_predictor (gimple gs
)
5705 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5706 return (enum br_predictor
) (gs
->subcode
& ~GF_PREDICT_TAKEN
);
5710 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
5713 gimple_predict_set_predictor (gimple gs
, enum br_predictor predictor
)
5715 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5716 gs
->subcode
= (gs
->subcode
& GF_PREDICT_TAKEN
)
5717 | (unsigned) predictor
;
5721 /* Return the outcome of GIMPLE_PREDICT statement GS. */
5723 static inline enum prediction
5724 gimple_predict_outcome (gimple gs
)
5726 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5727 return (gs
->subcode
& GF_PREDICT_TAKEN
) ? TAKEN
: NOT_TAKEN
;
5731 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
5734 gimple_predict_set_outcome (gimple gs
, enum prediction outcome
)
5736 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5737 if (outcome
== TAKEN
)
5738 gs
->subcode
|= GF_PREDICT_TAKEN
;
5740 gs
->subcode
&= ~GF_PREDICT_TAKEN
;
5744 /* Return the type of the main expression computed by STMT. Return
5745 void_type_node if the statement computes nothing. */
5748 gimple_expr_type (const_gimple stmt
)
5750 enum gimple_code code
= gimple_code (stmt
);
5752 if (code
== GIMPLE_ASSIGN
|| code
== GIMPLE_CALL
)
5755 /* In general we want to pass out a type that can be substituted
5756 for both the RHS and the LHS types if there is a possibly
5757 useless conversion involved. That means returning the
5758 original RHS type as far as we can reconstruct it. */
5759 if (code
== GIMPLE_CALL
)
5761 if (gimple_call_internal_p (stmt
)
5762 && gimple_call_internal_fn (stmt
) == IFN_MASK_STORE
)
5763 type
= TREE_TYPE (gimple_call_arg (stmt
, 3));
5765 type
= gimple_call_return_type (stmt
);
5768 switch (gimple_assign_rhs_code (stmt
))
5770 case POINTER_PLUS_EXPR
:
5771 type
= TREE_TYPE (gimple_assign_rhs1 (stmt
));
5775 /* As fallback use the type of the LHS. */
5776 type
= TREE_TYPE (gimple_get_lhs (stmt
));
5781 else if (code
== GIMPLE_COND
)
5782 return boolean_type_node
;
5784 return void_type_node
;
5787 /* Enum and arrays used for allocation stats. Keep in sync with
5788 gimple.c:gimple_alloc_kind_names. */
5789 enum gimple_alloc_kind
5791 gimple_alloc_kind_assign
, /* Assignments. */
5792 gimple_alloc_kind_phi
, /* PHI nodes. */
5793 gimple_alloc_kind_cond
, /* Conditionals. */
5794 gimple_alloc_kind_rest
, /* Everything else. */
5795 gimple_alloc_kind_all
5798 extern int gimple_alloc_counts
[];
5799 extern int gimple_alloc_sizes
[];
5801 /* Return the allocation kind for a given stmt CODE. */
5802 static inline enum gimple_alloc_kind
5803 gimple_alloc_kind (enum gimple_code code
)
5808 return gimple_alloc_kind_assign
;
5810 return gimple_alloc_kind_phi
;
5812 return gimple_alloc_kind_cond
;
5814 return gimple_alloc_kind_rest
;
5818 /* Return true if a location should not be emitted for this statement
5819 by annotate_all_with_location. */
5822 gimple_do_not_emit_location_p (gimple g
)
5824 return gimple_plf (g
, GF_PLF_1
);
5827 /* Mark statement G so a location will not be emitted by
5828 annotate_one_with_location. */
5831 gimple_set_do_not_emit_location (gimple g
)
5833 /* The PLF flags are initialized to 0 when a new tuple is created,
5834 so no need to initialize it anywhere. */
5835 gimple_set_plf (g
, GF_PLF_1
, true);
5839 /* Macros for showing usage statistics. */
5840 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
5842 : ((x) < 1024*1024*10 \
5844 : (x) / (1024*1024))))
5846 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
5848 #endif /* GCC_GIMPLE_H */