1 /* Gimple IR definitions.
3 Copyright (C) 2007-2013 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_WITH_BOUNDS
= 1 << 7,
94 GF_OMP_PARALLEL_COMBINED
= 1 << 0,
95 GF_OMP_FOR_KIND_MASK
= 3 << 0,
96 GF_OMP_FOR_KIND_FOR
= 0 << 0,
97 GF_OMP_FOR_KIND_DISTRIBUTE
= 1 << 0,
98 GF_OMP_FOR_KIND_SIMD
= 2 << 0,
99 GF_OMP_FOR_KIND_CILKSIMD
= 3 << 0,
100 GF_OMP_FOR_COMBINED
= 1 << 2,
101 GF_OMP_FOR_COMBINED_INTO
= 1 << 3,
102 GF_OMP_TARGET_KIND_MASK
= 3 << 0,
103 GF_OMP_TARGET_KIND_REGION
= 0 << 0,
104 GF_OMP_TARGET_KIND_DATA
= 1 << 0,
105 GF_OMP_TARGET_KIND_UPDATE
= 2 << 0,
107 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
108 a thread synchronization via some sort of barrier. The exact barrier
109 that would otherwise be emitted is dependent on the OMP statement with
110 which this return is associated. */
111 GF_OMP_RETURN_NOWAIT
= 1 << 0,
113 GF_OMP_SECTION_LAST
= 1 << 0,
114 GF_OMP_ATOMIC_NEED_VALUE
= 1 << 0,
115 GF_OMP_ATOMIC_SEQ_CST
= 1 << 1,
116 GF_PREDICT_TAKEN
= 1 << 15
119 /* Currently, there are only two types of gimple debug stmt. Others are
120 envisioned, for example, to enable the generation of is_stmt notes
121 in line number information, to mark sequence points, etc. This
122 subcode is to be used to tell them apart. */
123 enum gimple_debug_subcode
{
124 GIMPLE_DEBUG_BIND
= 0,
125 GIMPLE_DEBUG_SOURCE_BIND
= 1
128 /* Masks for selecting a pass local flag (PLF) to work on. These
129 masks are used by gimple_set_plf and gimple_plf. */
135 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
136 are for 64 bit hosts. */
138 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
139 chain_next ("%h.next"), variable_size
))
140 gimple_statement_base
143 Main identifying code for a tuple. */
144 ENUM_BITFIELD(gimple_code
) code
: 8;
146 /* Nonzero if a warning should not be emitted on this tuple. */
147 unsigned int no_warning
: 1;
149 /* Nonzero if this tuple has been visited. Passes are responsible
150 for clearing this bit before using it. */
151 unsigned int visited
: 1;
153 /* Nonzero if this tuple represents a non-temporal move. */
154 unsigned int nontemporal_move
: 1;
156 /* Pass local flags. These flags are free for any pass to use as
157 they see fit. Passes should not assume that these flags contain
158 any useful value when the pass starts. Any initial state that
159 the pass requires should be set on entry to the pass. See
160 gimple_set_plf and gimple_plf for usage. */
161 unsigned int plf
: 2;
163 /* Nonzero if this statement has been modified and needs to have its
164 operands rescanned. */
165 unsigned modified
: 1;
167 /* Nonzero if this statement contains volatile operands. */
168 unsigned has_volatile_ops
: 1;
170 /* The SUBCODE field can be used for tuple-specific flags for tuples
171 that do not require subcodes. Note that SUBCODE should be at
172 least as wide as tree codes, as several tuples store tree codes
174 unsigned int subcode
: 16;
176 /* UID of this statement. This is used by passes that want to
177 assign IDs to statements. It must be assigned and used by each
178 pass. By default it should be assumed to contain garbage. */
182 Locus information for debug info. */
185 /* Number of operands in this tuple. */
189 Basic block holding this statement. */
193 Linked lists of gimple statements. The next pointers form
194 a NULL terminated list, the prev pointers are a cyclic list.
195 A gimple statement is hence also a double-ended list of
196 statements, with the pointer itself being the first element,
197 and the prev pointer being the last. */
199 gimple
GTY((skip
)) prev
;
203 /* Base structure for tuples with operands. */
205 /* This gimple subclass has no tag value. */
207 gimple_statement_with_ops_base
: public gimple_statement_base
209 /* [ WORD 1-6 ] : base class */
212 SSA operand vectors. NOTE: It should be possible to
213 amalgamate these vectors with the operand vector OP. However,
214 the SSA operand vectors are organized differently and contain
215 more information (like immediate use chaining). */
216 struct use_optype_d
GTY((skip (""))) *use_ops
;
220 /* Statements that take register operands. */
222 struct GTY((tag("GSS_WITH_OPS")))
223 gimple_statement_with_ops
: public gimple_statement_with_ops_base
225 /* [ WORD 1-7 ] : base class */
228 Operand vector. NOTE! This must always be the last field
229 of this structure. In particular, this means that this
230 structure cannot be embedded inside another one. */
231 tree
GTY((length ("%h.num_ops"))) op
[1];
235 /* Base for statements that take both memory and register operands. */
237 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
238 gimple_statement_with_memory_ops_base
: public gimple_statement_with_ops_base
240 /* [ WORD 1-7 ] : base class */
243 Virtual operands for this statement. The GC will pick them
244 up via the ssa_names array. */
245 tree
GTY((skip (""))) vdef
;
246 tree
GTY((skip (""))) vuse
;
250 /* Statements that take both memory and register operands. */
252 struct GTY((tag("GSS_WITH_MEM_OPS")))
253 gimple_statement_with_memory_ops
:
254 public gimple_statement_with_memory_ops_base
256 /* [ WORD 1-9 ] : base class */
259 Operand vector. NOTE! This must always be the last field
260 of this structure. In particular, this means that this
261 structure cannot be embedded inside another one. */
262 tree
GTY((length ("%h.num_ops"))) op
[1];
266 /* Call statements that take both memory and register operands. */
268 struct GTY((tag("GSS_CALL")))
269 gimple_statement_call
: public gimple_statement_with_memory_ops_base
271 /* [ WORD 1-9 ] : base class */
274 struct pt_solution call_used
;
275 struct pt_solution call_clobbered
;
278 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
279 tree
GTY ((tag ("0"))) fntype
;
280 enum internal_fn
GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn
;
284 Operand vector. NOTE! This must always be the last field
285 of this structure. In particular, this means that this
286 structure cannot be embedded inside another one. */
287 tree
GTY((length ("%h.num_ops"))) op
[1];
291 /* OpenMP statements (#pragma omp). */
293 struct GTY((tag("GSS_OMP")))
294 gimple_statement_omp
: public gimple_statement_base
296 /* [ WORD 1-6 ] : base class */
305 struct GTY((tag("GSS_BIND")))
306 gimple_statement_bind
: public gimple_statement_base
308 /* [ WORD 1-6 ] : base class */
311 Variables declared in this scope. */
315 This is different than the BLOCK field in gimple_statement_base,
316 which is analogous to TREE_BLOCK (i.e., the lexical block holding
317 this statement). This field is the equivalent of BIND_EXPR_BLOCK
318 in tree land (i.e., the lexical scope defined by this bind). See
329 struct GTY((tag("GSS_CATCH")))
330 gimple_statement_catch
: public gimple_statement_base
332 /* [ WORD 1-6 ] : base class */
342 /* GIMPLE_EH_FILTER */
344 struct GTY((tag("GSS_EH_FILTER")))
345 gimple_statement_eh_filter
: public gimple_statement_base
347 /* [ WORD 1-6 ] : base class */
360 struct GTY((tag("GSS_EH_ELSE")))
361 gimple_statement_eh_else
: public gimple_statement_base
363 /* [ WORD 1-6 ] : base class */
366 gimple_seq n_body
, e_body
;
369 /* GIMPLE_EH_MUST_NOT_THROW */
371 struct GTY((tag("GSS_EH_MNT")))
372 gimple_statement_eh_mnt
: public gimple_statement_base
374 /* [ WORD 1-6 ] : base class */
376 /* [ WORD 7 ] Abort function decl. */
382 struct GTY((tag("GSS_PHI")))
383 gimple_statement_phi
: public gimple_statement_base
385 /* [ WORD 1-6 ] : base class */
395 struct phi_arg_d
GTY ((length ("%h.nargs"))) args
[1];
399 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
401 struct GTY((tag("GSS_EH_CTRL")))
402 gimple_statement_eh_ctrl
: public gimple_statement_base
404 /* [ WORD 1-6 ] : base class */
407 Exception region number. */
411 struct GTY((tag("GSS_EH_CTRL")))
412 gimple_statement_resx
: public gimple_statement_eh_ctrl
414 /* No extra fields; adds invariant:
415 stmt->code == GIMPLE_RESX. */
418 struct GTY((tag("GSS_EH_CTRL")))
419 gimple_statement_eh_dispatch
: public gimple_statement_eh_ctrl
421 /* No extra fields; adds invariant:
422 stmt->code == GIMPLE_EH_DISPATH. */
428 struct GTY((tag("GSS_TRY")))
429 gimple_statement_try
: public gimple_statement_base
431 /* [ WORD 1-6 ] : base class */
434 Expression to evaluate. */
438 Cleanup expression. */
442 /* Kind of GIMPLE_TRY statements. */
443 enum gimple_try_flags
446 GIMPLE_TRY_CATCH
= 1 << 0,
449 GIMPLE_TRY_FINALLY
= 1 << 1,
450 GIMPLE_TRY_KIND
= GIMPLE_TRY_CATCH
| GIMPLE_TRY_FINALLY
,
452 /* Analogous to TRY_CATCH_IS_CLEANUP. */
453 GIMPLE_TRY_CATCH_IS_CLEANUP
= 1 << 2
456 /* GIMPLE_WITH_CLEANUP_EXPR */
458 struct GTY((tag("GSS_WCE")))
459 gimple_statement_wce
: public gimple_statement_base
461 /* [ WORD 1-6 ] : base class */
463 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
464 executed if an exception is thrown, not on normal exit of its
465 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
469 Cleanup expression. */
476 struct GTY((tag("GSS_ASM")))
477 gimple_statement_asm
: public gimple_statement_with_memory_ops_base
479 /* [ WORD 1-9 ] : base class */
482 __asm__ statement. */
486 Number of inputs, outputs, clobbers, labels. */
493 Operand vector. NOTE! This must always be the last field
494 of this structure. In particular, this means that this
495 structure cannot be embedded inside another one. */
496 tree
GTY((length ("%h.num_ops"))) op
[1];
499 /* GIMPLE_OMP_CRITICAL */
501 struct GTY((tag("GSS_OMP_CRITICAL")))
502 gimple_statement_omp_critical
: public gimple_statement_omp
504 /* [ WORD 1-7 ] : base class */
507 Critical section name. */
512 struct GTY(()) gimple_omp_for_iter
{
513 /* Condition code. */
516 /* Index variable. */
531 struct GTY((tag("GSS_OMP_FOR")))
532 gimple_statement_omp_for
: public gimple_statement_omp
534 /* [ WORD 1-7 ] : base class */
540 Number of elements in iter array. */
544 struct gimple_omp_for_iter
* GTY((length ("%h.collapse"))) iter
;
547 Pre-body evaluated before the loop body begins. */
552 /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET */
553 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
554 gimple_statement_omp_parallel_layout
: public gimple_statement_omp
556 /* [ WORD 1-7 ] : base class */
563 Child function holding the body of the parallel region. */
567 Shared data argument. */
571 /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
572 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
573 gimple_statement_omp_taskreg
: public gimple_statement_omp_parallel_layout
575 /* No extra fields; adds invariant:
576 stmt->code == GIMPLE_OMP_PARALLEL
577 || stmt->code == GIMPLE_OMP_TASK. */
581 /* GIMPLE_OMP_PARALLEL */
582 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
583 gimple_statement_omp_parallel
: public gimple_statement_omp_taskreg
585 /* No extra fields; adds invariant:
586 stmt->code == GIMPLE_OMP_PARALLEL. */
589 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
590 gimple_statement_omp_target
: public gimple_statement_omp_parallel_layout
592 /* No extra fields; adds invariant:
593 stmt->code == GIMPLE_OMP_TARGET. */
596 /* GIMPLE_OMP_TASK */
598 struct GTY((tag("GSS_OMP_TASK")))
599 gimple_statement_omp_task
: public gimple_statement_omp_taskreg
601 /* [ WORD 1-10 ] : base class */
604 Child function holding firstprivate initialization if needed. */
608 Size and alignment in bytes of the argument data block. */
614 /* GIMPLE_OMP_SECTION */
615 /* Uses struct gimple_statement_omp. */
618 /* GIMPLE_OMP_SECTIONS */
620 struct GTY((tag("GSS_OMP_SECTIONS")))
621 gimple_statement_omp_sections
: public gimple_statement_omp
623 /* [ WORD 1-7 ] : base class */
629 The control variable used for deciding which of the sections to
634 /* GIMPLE_OMP_CONTINUE.
636 Note: This does not inherit from gimple_statement_omp, because we
637 do not need the body field. */
639 struct GTY((tag("GSS_OMP_CONTINUE")))
640 gimple_statement_omp_continue
: public gimple_statement_base
642 /* [ WORD 1-6 ] : base class */
651 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
653 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
654 gimple_statement_omp_single_layout
: public gimple_statement_omp
656 /* [ WORD 1-7 ] : base class */
662 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
663 gimple_statement_omp_single
: public gimple_statement_omp_single_layout
665 /* No extra fields; adds invariant:
666 stmt->code == GIMPLE_OMP_SINGLE. */
669 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
670 gimple_statement_omp_teams
: public gimple_statement_omp_single_layout
672 /* No extra fields; adds invariant:
673 stmt->code == GIMPLE_OMP_TEAMS. */
677 /* GIMPLE_OMP_ATOMIC_LOAD.
678 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
679 contains a sequence, which we don't need here. */
681 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
682 gimple_statement_omp_atomic_load
: public gimple_statement_base
684 /* [ WORD 1-6 ] : base class */
690 /* GIMPLE_OMP_ATOMIC_STORE.
691 See note on GIMPLE_OMP_ATOMIC_LOAD. */
693 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
694 gimple_statement_omp_atomic_store_layout
: public gimple_statement_base
696 /* [ WORD 1-6 ] : base class */
702 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
703 gimple_statement_omp_atomic_store
:
704 public gimple_statement_omp_atomic_store_layout
706 /* No extra fields; adds invariant:
707 stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
710 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
711 gimple_statement_omp_return
:
712 public gimple_statement_omp_atomic_store_layout
714 /* No extra fields; adds invariant:
715 stmt->code == GIMPLE_OMP_RETURN. */
718 /* GIMPLE_TRANSACTION. */
720 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
722 /* The __transaction_atomic was declared [[outer]] or it is
723 __transaction_relaxed. */
724 #define GTMA_IS_OUTER (1u << 0)
725 #define GTMA_IS_RELAXED (1u << 1)
726 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
728 /* The transaction is seen to not have an abort. */
729 #define GTMA_HAVE_ABORT (1u << 2)
730 /* The transaction is seen to have loads or stores. */
731 #define GTMA_HAVE_LOAD (1u << 3)
732 #define GTMA_HAVE_STORE (1u << 4)
733 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
734 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
735 /* The transaction WILL enter serial irrevocable mode.
736 An irrevocable block post-dominates the entire transaction, such
737 that all invocations of the transaction will go serial-irrevocable.
738 In such case, we don't bother instrumenting the transaction, and
739 tell the runtime that it should begin the transaction in
740 serial-irrevocable mode. */
741 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
742 /* The transaction contains no instrumentation code whatsover, most
743 likely because it is guaranteed to go irrevocable upon entry. */
744 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
746 struct GTY((tag("GSS_TRANSACTION")))
747 gimple_statement_transaction
: public gimple_statement_with_memory_ops_base
749 /* [ WORD 1-9 ] : base class */
758 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
759 enum gimple_statement_structure_enum
{
760 #include "gsstruct.def"
768 is_a_helper
<gimple_statement_asm
>::test (gimple gs
)
770 return gs
->code
== GIMPLE_ASM
;
776 is_a_helper
<gimple_statement_bind
>::test (gimple gs
)
778 return gs
->code
== GIMPLE_BIND
;
784 is_a_helper
<gimple_statement_call
>::test (gimple gs
)
786 return gs
->code
== GIMPLE_CALL
;
792 is_a_helper
<gimple_statement_catch
>::test (gimple gs
)
794 return gs
->code
== GIMPLE_CATCH
;
800 is_a_helper
<gimple_statement_resx
>::test (gimple gs
)
802 return gs
->code
== GIMPLE_RESX
;
808 is_a_helper
<gimple_statement_eh_dispatch
>::test (gimple gs
)
810 return gs
->code
== GIMPLE_EH_DISPATCH
;
816 is_a_helper
<gimple_statement_eh_else
>::test (gimple gs
)
818 return gs
->code
== GIMPLE_EH_ELSE
;
824 is_a_helper
<gimple_statement_eh_filter
>::test (gimple gs
)
826 return gs
->code
== GIMPLE_EH_FILTER
;
832 is_a_helper
<gimple_statement_eh_mnt
>::test (gimple gs
)
834 return gs
->code
== GIMPLE_EH_MUST_NOT_THROW
;
840 is_a_helper
<gimple_statement_omp_atomic_load
>::test (gimple gs
)
842 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
848 is_a_helper
<gimple_statement_omp_atomic_store
>::test (gimple gs
)
850 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
856 is_a_helper
<gimple_statement_omp_return
>::test (gimple gs
)
858 return gs
->code
== GIMPLE_OMP_RETURN
;
864 is_a_helper
<gimple_statement_omp_continue
>::test (gimple gs
)
866 return gs
->code
== GIMPLE_OMP_CONTINUE
;
872 is_a_helper
<gimple_statement_omp_critical
>::test (gimple gs
)
874 return gs
->code
== GIMPLE_OMP_CRITICAL
;
880 is_a_helper
<gimple_statement_omp_for
>::test (gimple gs
)
882 return gs
->code
== GIMPLE_OMP_FOR
;
888 is_a_helper
<gimple_statement_omp_taskreg
>::test (gimple gs
)
890 return gs
->code
== GIMPLE_OMP_PARALLEL
|| gs
->code
== GIMPLE_OMP_TASK
;
896 is_a_helper
<gimple_statement_omp_parallel
>::test (gimple gs
)
898 return gs
->code
== GIMPLE_OMP_PARALLEL
;
904 is_a_helper
<gimple_statement_omp_target
>::test (gimple gs
)
906 return gs
->code
== GIMPLE_OMP_TARGET
;
912 is_a_helper
<gimple_statement_omp_sections
>::test (gimple gs
)
914 return gs
->code
== GIMPLE_OMP_SECTIONS
;
920 is_a_helper
<gimple_statement_omp_single
>::test (gimple gs
)
922 return gs
->code
== GIMPLE_OMP_SINGLE
;
928 is_a_helper
<gimple_statement_omp_teams
>::test (gimple gs
)
930 return gs
->code
== GIMPLE_OMP_TEAMS
;
936 is_a_helper
<gimple_statement_omp_task
>::test (gimple gs
)
938 return gs
->code
== GIMPLE_OMP_TASK
;
944 is_a_helper
<gimple_statement_phi
>::test (gimple gs
)
946 return gs
->code
== GIMPLE_PHI
;
952 is_a_helper
<gimple_statement_transaction
>::test (gimple gs
)
954 return gs
->code
== GIMPLE_TRANSACTION
;
960 is_a_helper
<gimple_statement_try
>::test (gimple gs
)
962 return gs
->code
== GIMPLE_TRY
;
968 is_a_helper
<gimple_statement_wce
>::test (gimple gs
)
970 return gs
->code
== GIMPLE_WITH_CLEANUP_EXPR
;
976 is_a_helper
<const gimple_statement_asm
>::test (const_gimple gs
)
978 return gs
->code
== GIMPLE_ASM
;
984 is_a_helper
<const gimple_statement_bind
>::test (const_gimple gs
)
986 return gs
->code
== GIMPLE_BIND
;
992 is_a_helper
<const gimple_statement_call
>::test (const_gimple gs
)
994 return gs
->code
== GIMPLE_CALL
;
1000 is_a_helper
<const gimple_statement_catch
>::test (const_gimple gs
)
1002 return gs
->code
== GIMPLE_CATCH
;
1008 is_a_helper
<const gimple_statement_resx
>::test (const_gimple gs
)
1010 return gs
->code
== GIMPLE_RESX
;
1016 is_a_helper
<const gimple_statement_eh_dispatch
>::test (const_gimple gs
)
1018 return gs
->code
== GIMPLE_EH_DISPATCH
;
1024 is_a_helper
<const gimple_statement_eh_filter
>::test (const_gimple gs
)
1026 return gs
->code
== GIMPLE_EH_FILTER
;
1032 is_a_helper
<const gimple_statement_omp_atomic_load
>::test (const_gimple gs
)
1034 return gs
->code
== GIMPLE_OMP_ATOMIC_LOAD
;
1040 is_a_helper
<const gimple_statement_omp_atomic_store
>::test (const_gimple gs
)
1042 return gs
->code
== GIMPLE_OMP_ATOMIC_STORE
;
1048 is_a_helper
<const gimple_statement_omp_return
>::test (const_gimple gs
)
1050 return gs
->code
== GIMPLE_OMP_RETURN
;
1056 is_a_helper
<const gimple_statement_omp_continue
>::test (const_gimple gs
)
1058 return gs
->code
== GIMPLE_OMP_CONTINUE
;
1064 is_a_helper
<const gimple_statement_omp_critical
>::test (const_gimple gs
)
1066 return gs
->code
== GIMPLE_OMP_CRITICAL
;
1072 is_a_helper
<const gimple_statement_omp_for
>::test (const_gimple gs
)
1074 return gs
->code
== GIMPLE_OMP_FOR
;
1080 is_a_helper
<const gimple_statement_omp_taskreg
>::test (const_gimple gs
)
1082 return gs
->code
== GIMPLE_OMP_PARALLEL
|| gs
->code
== GIMPLE_OMP_TASK
;
1088 is_a_helper
<const gimple_statement_omp_parallel
>::test (const_gimple gs
)
1090 return gs
->code
== GIMPLE_OMP_PARALLEL
;
1096 is_a_helper
<const gimple_statement_omp_target
>::test (const_gimple gs
)
1098 return gs
->code
== GIMPLE_OMP_TARGET
;
1104 is_a_helper
<const gimple_statement_omp_sections
>::test (const_gimple gs
)
1106 return gs
->code
== GIMPLE_OMP_SECTIONS
;
1112 is_a_helper
<const gimple_statement_omp_single
>::test (const_gimple gs
)
1114 return gs
->code
== GIMPLE_OMP_SINGLE
;
1120 is_a_helper
<const gimple_statement_omp_teams
>::test (const_gimple gs
)
1122 return gs
->code
== GIMPLE_OMP_TEAMS
;
1128 is_a_helper
<const gimple_statement_omp_task
>::test (const_gimple gs
)
1130 return gs
->code
== GIMPLE_OMP_TASK
;
1136 is_a_helper
<const gimple_statement_phi
>::test (const_gimple gs
)
1138 return gs
->code
== GIMPLE_PHI
;
1144 is_a_helper
<const gimple_statement_transaction
>::test (const_gimple gs
)
1146 return gs
->code
== GIMPLE_TRANSACTION
;
1149 /* Offset in bytes to the location of the operand vector.
1150 Zero if there is no operand vector for this tuple structure. */
1151 extern size_t const gimple_ops_offset_
[];
1153 /* Map GIMPLE codes to GSS codes. */
1154 extern enum gimple_statement_structure_enum
const gss_for_code_
[];
1156 /* This variable holds the currently expanded gimple statement for purposes
1157 of comminucating the profile info to the builtin expanders. */
1158 extern gimple currently_expanding_gimple_stmt
;
1160 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
1161 gimple
gimple_alloc_stat (enum gimple_code
, unsigned MEM_STAT_DECL
);
1162 gimple
gimple_build_return (tree
);
1163 void gimple_call_reset_alias_info (gimple
);
1164 gimple
gimple_build_call_vec (tree
, vec
<tree
> );
1165 gimple
gimple_build_call (tree
, unsigned, ...);
1166 gimple
gimple_build_call_valist (tree
, unsigned, va_list);
1167 gimple
gimple_build_call_internal (enum internal_fn
, unsigned, ...);
1168 gimple
gimple_build_call_internal_vec (enum internal_fn
, vec
<tree
> );
1169 gimple
gimple_build_call_from_tree (tree
);
1170 gimple
gimple_build_assign_stat (tree
, tree MEM_STAT_DECL
);
1171 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
1172 gimple
gimple_build_assign_with_ops (enum tree_code
, tree
,
1173 tree
, tree
, tree CXX_MEM_STAT_INFO
);
1174 gimple
gimple_build_assign_with_ops (enum tree_code
, tree
,
1175 tree
, tree CXX_MEM_STAT_INFO
);
1176 gimple
gimple_build_cond (enum tree_code
, tree
, tree
, tree
, tree
);
1177 gimple
gimple_build_cond_from_tree (tree
, tree
, tree
);
1178 void gimple_cond_set_condition_from_tree (gimple
, tree
);
1179 gimple
gimple_build_label (tree label
);
1180 gimple
gimple_build_goto (tree dest
);
1181 gimple
gimple_build_nop (void);
1182 gimple
gimple_build_bind (tree
, gimple_seq
, tree
);
1183 gimple
gimple_build_asm_vec (const char *, vec
<tree
, va_gc
> *,
1184 vec
<tree
, va_gc
> *, vec
<tree
, va_gc
> *,
1185 vec
<tree
, va_gc
> *);
1186 gimple
gimple_build_catch (tree
, gimple_seq
);
1187 gimple
gimple_build_eh_filter (tree
, gimple_seq
);
1188 gimple
gimple_build_eh_must_not_throw (tree
);
1189 gimple
gimple_build_eh_else (gimple_seq
, gimple_seq
);
1190 gimple_statement_try
*gimple_build_try (gimple_seq
, gimple_seq
,
1191 enum gimple_try_flags
);
1192 gimple
gimple_build_wce (gimple_seq
);
1193 gimple
gimple_build_resx (int);
1194 gimple
gimple_build_switch_nlabels (unsigned, tree
, tree
);
1195 gimple
gimple_build_switch (tree
, tree
, vec
<tree
> );
1196 gimple
gimple_build_eh_dispatch (int);
1197 gimple
gimple_build_debug_bind_stat (tree
, tree
, gimple MEM_STAT_DECL
);
1198 #define gimple_build_debug_bind(var,val,stmt) \
1199 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1200 gimple
gimple_build_debug_source_bind_stat (tree
, tree
, gimple MEM_STAT_DECL
);
1201 #define gimple_build_debug_source_bind(var,val,stmt) \
1202 gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1203 gimple
gimple_build_omp_critical (gimple_seq
, tree
);
1204 gimple
gimple_build_omp_for (gimple_seq
, int, tree
, size_t, gimple_seq
);
1205 gimple
gimple_build_omp_parallel (gimple_seq
, tree
, tree
, tree
);
1206 gimple
gimple_build_omp_task (gimple_seq
, tree
, tree
, tree
, tree
, tree
, tree
);
1207 gimple
gimple_build_omp_section (gimple_seq
);
1208 gimple
gimple_build_omp_master (gimple_seq
);
1209 gimple
gimple_build_omp_taskgroup (gimple_seq
);
1210 gimple
gimple_build_omp_continue (tree
, tree
);
1211 gimple
gimple_build_omp_ordered (gimple_seq
);
1212 gimple
gimple_build_omp_return (bool);
1213 gimple
gimple_build_omp_sections (gimple_seq
, tree
);
1214 gimple
gimple_build_omp_sections_switch (void);
1215 gimple
gimple_build_omp_single (gimple_seq
, tree
);
1216 gimple
gimple_build_omp_target (gimple_seq
, int, tree
);
1217 gimple
gimple_build_omp_teams (gimple_seq
, tree
);
1218 gimple
gimple_build_omp_atomic_load (tree
, tree
);
1219 gimple
gimple_build_omp_atomic_store (tree
);
1220 gimple
gimple_build_transaction (gimple_seq
, tree
);
1221 gimple
gimple_build_predict (enum br_predictor
, enum prediction
);
1222 extern void gimple_seq_add_stmt (gimple_seq
*, gimple
);
1223 extern void gimple_seq_add_stmt_without_update (gimple_seq
*, gimple
);
1224 void gimple_seq_add_seq (gimple_seq
*, gimple_seq
);
1225 extern void annotate_all_with_location_after (gimple_seq
, gimple_stmt_iterator
,
1227 extern void annotate_all_with_location (gimple_seq
, location_t
);
1228 bool empty_body_p (gimple_seq
);
1229 gimple_seq
gimple_seq_copy (gimple_seq
);
1230 bool gimple_call_same_target_p (const_gimple
, const_gimple
);
1231 int gimple_call_flags (const_gimple
);
1232 int gimple_call_arg_flags (const_gimple
, unsigned);
1233 int gimple_call_return_flags (const_gimple
);
1234 bool gimple_assign_copy_p (gimple
);
1235 bool gimple_assign_ssa_name_copy_p (gimple
);
1236 bool gimple_assign_unary_nop_p (gimple
);
1237 void gimple_set_bb (gimple
, basic_block
);
1238 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator
*, tree
);
1239 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator
*, enum tree_code
,
1241 tree
gimple_get_lhs (const_gimple
);
1242 void gimple_set_lhs (gimple
, tree
);
1243 gimple
gimple_copy (gimple
);
1244 bool gimple_has_side_effects (const_gimple
);
1245 bool gimple_could_trap_p_1 (gimple
, bool, bool);
1246 bool gimple_could_trap_p (gimple
);
1247 bool gimple_assign_rhs_could_trap_p (gimple
);
1248 extern void dump_gimple_statistics (void);
1249 unsigned get_gimple_rhs_num_ops (enum tree_code
);
1250 extern tree
canonicalize_cond_expr_cond (tree
);
1251 gimple
gimple_call_copy_skip_args (gimple
, bitmap
);
1252 extern bool gimple_compare_field_offset (tree
, tree
);
1253 extern tree
gimple_unsigned_type (tree
);
1254 extern tree
gimple_signed_type (tree
);
1255 extern alias_set_type
gimple_get_alias_set (tree
);
1256 extern bool gimple_ior_addresses_taken (bitmap
, gimple
);
1257 extern bool is_gimple_builtin_call (gimple stmt
);
1258 extern bool gimple_call_builtin_p (gimple
, enum built_in_class
);
1259 extern bool gimple_call_builtin_p (gimple
, enum built_in_function
);
1260 extern bool gimple_asm_clobbers_memory_p (const_gimple
);
1261 extern void dump_decl_set (FILE *, bitmap
);
1262 extern bool nonfreeing_call_p (gimple
);
1263 extern bool infer_nonnull_range (gimple
, tree
);
1264 extern void sort_case_labels (vec
<tree
> );
1265 extern void preprocess_case_label_vec_for_gimple (vec
<tree
> , tree
, tree
*);
1266 extern void gimple_seq_set_location (gimple_seq
, location_t
);
1268 /* Formal (expression) temporary table handling: multiple occurrences of
1269 the same scalar expression are evaluated into the same temporary. */
1271 typedef struct gimple_temp_hash_elt
1274 tree temp
; /* Value */
1277 /* Get the number of the next statement uid to be allocated. */
1278 static inline unsigned int
1279 gimple_stmt_max_uid (struct function
*fn
)
1281 return fn
->last_stmt_uid
;
1284 /* Set the number of the next statement uid to be allocated. */
1286 set_gimple_stmt_max_uid (struct function
*fn
, unsigned int maxid
)
1288 fn
->last_stmt_uid
= maxid
;
1291 /* Set the number of the next statement uid to be allocated. */
1292 static inline unsigned int
1293 inc_gimple_stmt_max_uid (struct function
*fn
)
1295 return fn
->last_stmt_uid
++;
1298 /* Return the first node in GIMPLE sequence S. */
1300 static inline gimple_seq_node
1301 gimple_seq_first (gimple_seq s
)
1307 /* Return the first statement in GIMPLE sequence S. */
1309 static inline gimple
1310 gimple_seq_first_stmt (gimple_seq s
)
1312 gimple_seq_node n
= gimple_seq_first (s
);
1317 /* Return the last node in GIMPLE sequence S. */
1319 static inline gimple_seq_node
1320 gimple_seq_last (gimple_seq s
)
1322 return s
? s
->prev
: NULL
;
1326 /* Return the last statement in GIMPLE sequence S. */
1328 static inline gimple
1329 gimple_seq_last_stmt (gimple_seq s
)
1331 gimple_seq_node n
= gimple_seq_last (s
);
1336 /* Set the last node in GIMPLE sequence *PS to LAST. */
1339 gimple_seq_set_last (gimple_seq
*ps
, gimple_seq_node last
)
1345 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1348 gimple_seq_set_first (gimple_seq
*ps
, gimple_seq_node first
)
1354 /* Return true if GIMPLE sequence S is empty. */
1357 gimple_seq_empty_p (gimple_seq s
)
1362 /* Allocate a new sequence and initialize its first element with STMT. */
1364 static inline gimple_seq
1365 gimple_seq_alloc_with_stmt (gimple stmt
)
1367 gimple_seq seq
= NULL
;
1368 gimple_seq_add_stmt (&seq
, stmt
);
1373 /* Returns the sequence of statements in BB. */
1375 static inline gimple_seq
1376 bb_seq (const_basic_block bb
)
1378 return (!(bb
->flags
& BB_RTL
)) ? bb
->il
.gimple
.seq
: NULL
;
1381 static inline gimple_seq
*
1382 bb_seq_addr (basic_block bb
)
1384 return (!(bb
->flags
& BB_RTL
)) ? &bb
->il
.gimple
.seq
: NULL
;
1387 /* Sets the sequence of statements in BB to SEQ. */
1390 set_bb_seq (basic_block bb
, gimple_seq seq
)
1392 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
1393 bb
->il
.gimple
.seq
= seq
;
1397 /* Return the code for GIMPLE statement G. */
1399 static inline enum gimple_code
1400 gimple_code (const_gimple g
)
1406 /* Return the GSS code used by a GIMPLE code. */
1408 static inline enum gimple_statement_structure_enum
1409 gss_for_code (enum gimple_code code
)
1411 gcc_gimple_checking_assert ((unsigned int)code
< LAST_AND_UNUSED_GIMPLE_CODE
);
1412 return gss_for_code_
[code
];
1416 /* Return which GSS code is used by GS. */
1418 static inline enum gimple_statement_structure_enum
1419 gimple_statement_structure (gimple gs
)
1421 return gss_for_code (gimple_code (gs
));
1425 /* Return true if statement G has sub-statements. This is only true for
1426 High GIMPLE statements. */
1429 gimple_has_substatements (gimple g
)
1431 switch (gimple_code (g
))
1435 case GIMPLE_EH_FILTER
:
1436 case GIMPLE_EH_ELSE
:
1438 case GIMPLE_OMP_FOR
:
1439 case GIMPLE_OMP_MASTER
:
1440 case GIMPLE_OMP_TASKGROUP
:
1441 case GIMPLE_OMP_ORDERED
:
1442 case GIMPLE_OMP_SECTION
:
1443 case GIMPLE_OMP_PARALLEL
:
1444 case GIMPLE_OMP_TASK
:
1445 case GIMPLE_OMP_SECTIONS
:
1446 case GIMPLE_OMP_SINGLE
:
1447 case GIMPLE_OMP_TARGET
:
1448 case GIMPLE_OMP_TEAMS
:
1449 case GIMPLE_OMP_CRITICAL
:
1450 case GIMPLE_WITH_CLEANUP_EXPR
:
1451 case GIMPLE_TRANSACTION
:
1460 /* Return the basic block holding statement G. */
1462 static inline basic_block
1463 gimple_bb (const_gimple g
)
1469 /* Return the lexical scope block holding statement G. */
1472 gimple_block (const_gimple g
)
1474 return LOCATION_BLOCK (g
->location
);
1478 /* Set BLOCK to be the lexical scope block holding statement G. */
1481 gimple_set_block (gimple g
, tree block
)
1485 COMBINE_LOCATION_DATA (line_table
, g
->location
, block
);
1487 g
->location
= LOCATION_LOCUS (g
->location
);
1491 /* Return location information for statement G. */
1493 static inline location_t
1494 gimple_location (const_gimple g
)
1499 /* Return pointer to location information for statement G. */
1501 static inline const location_t
*
1502 gimple_location_ptr (const_gimple g
)
1504 return &g
->location
;
1508 /* Set location information for statement G. */
1511 gimple_set_location (gimple g
, location_t location
)
1513 g
->location
= location
;
1517 /* Return true if G contains location information. */
1520 gimple_has_location (const_gimple g
)
1522 return LOCATION_LOCUS (gimple_location (g
)) != UNKNOWN_LOCATION
;
1526 /* Return the file name of the location of STMT. */
1528 static inline const char *
1529 gimple_filename (const_gimple stmt
)
1531 return LOCATION_FILE (gimple_location (stmt
));
1535 /* Return the line number of the location of STMT. */
1538 gimple_lineno (const_gimple stmt
)
1540 return LOCATION_LINE (gimple_location (stmt
));
1544 /* Determine whether SEQ is a singleton. */
1547 gimple_seq_singleton_p (gimple_seq seq
)
1549 return ((gimple_seq_first (seq
) != NULL
)
1550 && (gimple_seq_first (seq
) == gimple_seq_last (seq
)));
1553 /* Return true if no warnings should be emitted for statement STMT. */
1556 gimple_no_warning_p (const_gimple stmt
)
1558 return stmt
->no_warning
;
1561 /* Set the no_warning flag of STMT to NO_WARNING. */
1564 gimple_set_no_warning (gimple stmt
, bool no_warning
)
1566 stmt
->no_warning
= (unsigned) no_warning
;
1569 /* Set the visited status on statement STMT to VISITED_P. */
1572 gimple_set_visited (gimple stmt
, bool visited_p
)
1574 stmt
->visited
= (unsigned) visited_p
;
1578 /* Return the visited status for statement STMT. */
1581 gimple_visited_p (gimple stmt
)
1583 return stmt
->visited
;
1587 /* Set pass local flag PLF on statement STMT to VAL_P. */
1590 gimple_set_plf (gimple stmt
, enum plf_mask plf
, bool val_p
)
1593 stmt
->plf
|= (unsigned int) plf
;
1595 stmt
->plf
&= ~((unsigned int) plf
);
1599 /* Return the value of pass local flag PLF on statement STMT. */
1601 static inline unsigned int
1602 gimple_plf (gimple stmt
, enum plf_mask plf
)
1604 return stmt
->plf
& ((unsigned int) plf
);
1608 /* Set the UID of statement. */
1611 gimple_set_uid (gimple g
, unsigned uid
)
1617 /* Return the UID of statement. */
1619 static inline unsigned
1620 gimple_uid (const_gimple g
)
1626 /* Make statement G a singleton sequence. */
1629 gimple_init_singleton (gimple g
)
1636 /* Return true if GIMPLE statement G has register or memory operands. */
1639 gimple_has_ops (const_gimple g
)
1641 return gimple_code (g
) >= GIMPLE_COND
&& gimple_code (g
) <= GIMPLE_RETURN
;
1647 is_a_helper
<const gimple_statement_with_ops
>::test (const_gimple gs
)
1649 return gimple_has_ops (gs
);
1655 is_a_helper
<gimple_statement_with_ops
>::test (gimple gs
)
1657 return gimple_has_ops (gs
);
1660 /* Return true if GIMPLE statement G has memory operands. */
1663 gimple_has_mem_ops (const_gimple g
)
1665 return gimple_code (g
) >= GIMPLE_ASSIGN
&& gimple_code (g
) <= GIMPLE_RETURN
;
1671 is_a_helper
<const gimple_statement_with_memory_ops
>::test (const_gimple gs
)
1673 return gimple_has_mem_ops (gs
);
1679 is_a_helper
<gimple_statement_with_memory_ops
>::test (gimple gs
)
1681 return gimple_has_mem_ops (gs
);
1684 /* Return the set of USE operands for statement G. */
1686 static inline struct use_optype_d
*
1687 gimple_use_ops (const_gimple g
)
1689 const gimple_statement_with_ops
*ops_stmt
=
1690 dyn_cast
<const gimple_statement_with_ops
> (g
);
1693 return ops_stmt
->use_ops
;
1697 /* Set USE to be the set of USE operands for statement G. */
1700 gimple_set_use_ops (gimple g
, struct use_optype_d
*use
)
1702 gimple_statement_with_ops
*ops_stmt
=
1703 as_a
<gimple_statement_with_ops
> (g
);
1704 ops_stmt
->use_ops
= use
;
1708 /* Return the single VUSE operand of the statement G. */
1711 gimple_vuse (const_gimple g
)
1713 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
1714 dyn_cast
<const gimple_statement_with_memory_ops
> (g
);
1717 return mem_ops_stmt
->vuse
;
1720 /* Return the single VDEF operand of the statement G. */
1723 gimple_vdef (const_gimple g
)
1725 const gimple_statement_with_memory_ops
*mem_ops_stmt
=
1726 dyn_cast
<const gimple_statement_with_memory_ops
> (g
);
1729 return mem_ops_stmt
->vdef
;
1732 /* Return the single VUSE operand of the statement G. */
1734 static inline tree
*
1735 gimple_vuse_ptr (gimple g
)
1737 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1738 dyn_cast
<gimple_statement_with_memory_ops
> (g
);
1741 return &mem_ops_stmt
->vuse
;
1744 /* Return the single VDEF operand of the statement G. */
1746 static inline tree
*
1747 gimple_vdef_ptr (gimple g
)
1749 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1750 dyn_cast
<gimple_statement_with_memory_ops
> (g
);
1753 return &mem_ops_stmt
->vdef
;
1756 /* Set the single VUSE operand of the statement G. */
1759 gimple_set_vuse (gimple g
, tree vuse
)
1761 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1762 as_a
<gimple_statement_with_memory_ops
> (g
);
1763 mem_ops_stmt
->vuse
= vuse
;
1766 /* Set the single VDEF operand of the statement G. */
1769 gimple_set_vdef (gimple g
, tree vdef
)
1771 gimple_statement_with_memory_ops
*mem_ops_stmt
=
1772 as_a
<gimple_statement_with_memory_ops
> (g
);
1773 mem_ops_stmt
->vdef
= vdef
;
1777 /* Return true if statement G has operands and the modified field has
1781 gimple_modified_p (const_gimple g
)
1783 return (gimple_has_ops (g
)) ? (bool) g
->modified
: false;
1787 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1788 a MODIFIED field. */
1791 gimple_set_modified (gimple s
, bool modifiedp
)
1793 if (gimple_has_ops (s
))
1794 s
->modified
= (unsigned) modifiedp
;
1798 /* Return the tree code for the expression computed by STMT. This is
1799 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1800 GIMPLE_CALL, return CALL_EXPR as the expression code for
1801 consistency. This is useful when the caller needs to deal with the
1802 three kinds of computation that GIMPLE supports. */
1804 static inline enum tree_code
1805 gimple_expr_code (const_gimple stmt
)
1807 enum gimple_code code
= gimple_code (stmt
);
1808 if (code
== GIMPLE_ASSIGN
|| code
== GIMPLE_COND
)
1809 return (enum tree_code
) stmt
->subcode
;
1812 gcc_gimple_checking_assert (code
== GIMPLE_CALL
);
1818 /* Return true if statement STMT contains volatile operands. */
1821 gimple_has_volatile_ops (const_gimple stmt
)
1823 if (gimple_has_mem_ops (stmt
))
1824 return stmt
->has_volatile_ops
;
1830 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1833 gimple_set_has_volatile_ops (gimple stmt
, bool volatilep
)
1835 if (gimple_has_mem_ops (stmt
))
1836 stmt
->has_volatile_ops
= (unsigned) volatilep
;
1839 /* Return true if STMT is in a transaction. */
1842 gimple_in_transaction (gimple stmt
)
1844 return bb_in_transaction (gimple_bb (stmt
));
1847 /* Return true if statement STMT may access memory. */
1850 gimple_references_memory_p (gimple stmt
)
1852 return gimple_has_mem_ops (stmt
) && gimple_vuse (stmt
);
1856 /* Return the subcode for OMP statement S. */
1858 static inline unsigned
1859 gimple_omp_subcode (const_gimple s
)
1861 gcc_gimple_checking_assert (gimple_code (s
) >= GIMPLE_OMP_ATOMIC_LOAD
1862 && gimple_code (s
) <= GIMPLE_OMP_TEAMS
);
1866 /* Set the subcode for OMP statement S to SUBCODE. */
1869 gimple_omp_set_subcode (gimple s
, unsigned int subcode
)
1871 /* We only have 16 bits for the subcode. Assert that we are not
1873 gcc_gimple_checking_assert (subcode
< (1 << 16));
1874 s
->subcode
= subcode
;
1877 /* Set the nowait flag on OMP_RETURN statement S. */
1880 gimple_omp_return_set_nowait (gimple s
)
1882 GIMPLE_CHECK (s
, GIMPLE_OMP_RETURN
);
1883 s
->subcode
|= GF_OMP_RETURN_NOWAIT
;
1887 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1891 gimple_omp_return_nowait_p (const_gimple g
)
1893 GIMPLE_CHECK (g
, GIMPLE_OMP_RETURN
);
1894 return (gimple_omp_subcode (g
) & GF_OMP_RETURN_NOWAIT
) != 0;
1898 /* Set the LHS of OMP return. */
1901 gimple_omp_return_set_lhs (gimple g
, tree lhs
)
1903 gimple_statement_omp_return
*omp_return_stmt
=
1904 as_a
<gimple_statement_omp_return
> (g
);
1905 omp_return_stmt
->val
= lhs
;
1909 /* Get the LHS of OMP return. */
1912 gimple_omp_return_lhs (const_gimple g
)
1914 const gimple_statement_omp_return
*omp_return_stmt
=
1915 as_a
<const gimple_statement_omp_return
> (g
);
1916 return omp_return_stmt
->val
;
1920 /* Return a pointer to the LHS of OMP return. */
1922 static inline tree
*
1923 gimple_omp_return_lhs_ptr (gimple g
)
1925 gimple_statement_omp_return
*omp_return_stmt
=
1926 as_a
<gimple_statement_omp_return
> (g
);
1927 return &omp_return_stmt
->val
;
1931 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1935 gimple_omp_section_last_p (const_gimple g
)
1937 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
1938 return (gimple_omp_subcode (g
) & GF_OMP_SECTION_LAST
) != 0;
1942 /* Set the GF_OMP_SECTION_LAST flag on G. */
1945 gimple_omp_section_set_last (gimple g
)
1947 GIMPLE_CHECK (g
, GIMPLE_OMP_SECTION
);
1948 g
->subcode
|= GF_OMP_SECTION_LAST
;
1952 /* Return true if OMP parallel statement G has the
1953 GF_OMP_PARALLEL_COMBINED flag set. */
1956 gimple_omp_parallel_combined_p (const_gimple g
)
1958 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
1959 return (gimple_omp_subcode (g
) & GF_OMP_PARALLEL_COMBINED
) != 0;
1963 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1964 value of COMBINED_P. */
1967 gimple_omp_parallel_set_combined_p (gimple g
, bool combined_p
)
1969 GIMPLE_CHECK (g
, GIMPLE_OMP_PARALLEL
);
1971 g
->subcode
|= GF_OMP_PARALLEL_COMBINED
;
1973 g
->subcode
&= ~GF_OMP_PARALLEL_COMBINED
;
1977 /* Return true if OMP atomic load/store statement G has the
1978 GF_OMP_ATOMIC_NEED_VALUE flag set. */
1981 gimple_omp_atomic_need_value_p (const_gimple g
)
1983 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
1984 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
1985 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_NEED_VALUE
) != 0;
1989 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
1992 gimple_omp_atomic_set_need_value (gimple g
)
1994 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
1995 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
1996 g
->subcode
|= GF_OMP_ATOMIC_NEED_VALUE
;
2000 /* Return true if OMP atomic load/store statement G has the
2001 GF_OMP_ATOMIC_SEQ_CST flag set. */
2004 gimple_omp_atomic_seq_cst_p (const_gimple g
)
2006 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2007 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2008 return (gimple_omp_subcode (g
) & GF_OMP_ATOMIC_SEQ_CST
) != 0;
2012 /* Set the GF_OMP_ATOMIC_SEQ_CST flag on G. */
2015 gimple_omp_atomic_set_seq_cst (gimple g
)
2017 if (gimple_code (g
) != GIMPLE_OMP_ATOMIC_LOAD
)
2018 GIMPLE_CHECK (g
, GIMPLE_OMP_ATOMIC_STORE
);
2019 g
->subcode
|= GF_OMP_ATOMIC_SEQ_CST
;
2023 /* Return the number of operands for statement GS. */
2025 static inline unsigned
2026 gimple_num_ops (const_gimple gs
)
2032 /* Set the number of operands for statement GS. */
2035 gimple_set_num_ops (gimple gs
, unsigned num_ops
)
2037 gs
->num_ops
= num_ops
;
2041 /* Return the array of operands for statement GS. */
2043 static inline tree
*
2044 gimple_ops (gimple gs
)
2048 /* All the tuples have their operand vector at the very bottom
2049 of the structure. Note that those structures that do not
2050 have an operand vector have a zero offset. */
2051 off
= gimple_ops_offset_
[gimple_statement_structure (gs
)];
2052 gcc_gimple_checking_assert (off
!= 0);
2054 return (tree
*) ((char *) gs
+ off
);
2058 /* Return operand I for statement GS. */
2061 gimple_op (const_gimple gs
, unsigned i
)
2063 if (gimple_has_ops (gs
))
2065 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2066 return gimple_ops (CONST_CAST_GIMPLE (gs
))[i
];
2072 /* Return a pointer to operand I for statement GS. */
2074 static inline tree
*
2075 gimple_op_ptr (const_gimple gs
, unsigned i
)
2077 if (gimple_has_ops (gs
))
2079 gcc_gimple_checking_assert (i
< gimple_num_ops (gs
));
2080 return gimple_ops (CONST_CAST_GIMPLE (gs
)) + i
;
2086 /* Set operand I of statement GS to OP. */
2089 gimple_set_op (gimple gs
, unsigned i
, tree op
)
2091 gcc_gimple_checking_assert (gimple_has_ops (gs
) && i
< gimple_num_ops (gs
));
2093 /* Note. It may be tempting to assert that OP matches
2094 is_gimple_operand, but that would be wrong. Different tuples
2095 accept slightly different sets of tree operands. Each caller
2096 should perform its own validation. */
2097 gimple_ops (gs
)[i
] = op
;
2100 /* Return true if GS is a GIMPLE_ASSIGN. */
2103 is_gimple_assign (const_gimple gs
)
2105 return gimple_code (gs
) == GIMPLE_ASSIGN
;
2108 /* Determine if expression CODE is one of the valid expressions that can
2109 be used on the RHS of GIMPLE assignments. */
2111 static inline enum gimple_rhs_class
2112 get_gimple_rhs_class (enum tree_code code
)
2114 return (enum gimple_rhs_class
) gimple_rhs_class_table
[(int) code
];
2117 /* Return the LHS of assignment statement GS. */
2120 gimple_assign_lhs (const_gimple gs
)
2122 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2123 return gimple_op (gs
, 0);
2127 /* Return a pointer to the LHS of assignment statement GS. */
2129 static inline tree
*
2130 gimple_assign_lhs_ptr (const_gimple gs
)
2132 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2133 return gimple_op_ptr (gs
, 0);
2137 /* Set LHS to be the LHS operand of assignment statement GS. */
2140 gimple_assign_set_lhs (gimple gs
, tree lhs
)
2142 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2143 gimple_set_op (gs
, 0, lhs
);
2145 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2146 SSA_NAME_DEF_STMT (lhs
) = gs
;
2150 /* Return the first operand on the RHS of assignment statement GS. */
2153 gimple_assign_rhs1 (const_gimple gs
)
2155 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2156 return gimple_op (gs
, 1);
2160 /* Return a pointer to the first operand on the RHS of assignment
2163 static inline tree
*
2164 gimple_assign_rhs1_ptr (const_gimple gs
)
2166 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2167 return gimple_op_ptr (gs
, 1);
2170 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2173 gimple_assign_set_rhs1 (gimple gs
, tree rhs
)
2175 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2177 gimple_set_op (gs
, 1, rhs
);
2181 /* Return the second operand on the RHS of assignment statement GS.
2182 If GS does not have two operands, NULL is returned instead. */
2185 gimple_assign_rhs2 (const_gimple gs
)
2187 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2189 if (gimple_num_ops (gs
) >= 3)
2190 return gimple_op (gs
, 2);
2196 /* Return a pointer to the second operand on the RHS of assignment
2199 static inline tree
*
2200 gimple_assign_rhs2_ptr (const_gimple gs
)
2202 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2203 return gimple_op_ptr (gs
, 2);
2207 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2210 gimple_assign_set_rhs2 (gimple gs
, tree rhs
)
2212 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2214 gimple_set_op (gs
, 2, rhs
);
2217 /* Return the third operand on the RHS of assignment statement GS.
2218 If GS does not have two operands, NULL is returned instead. */
2221 gimple_assign_rhs3 (const_gimple gs
)
2223 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2225 if (gimple_num_ops (gs
) >= 4)
2226 return gimple_op (gs
, 3);
2231 /* Return a pointer to the third operand on the RHS of assignment
2234 static inline tree
*
2235 gimple_assign_rhs3_ptr (const_gimple gs
)
2237 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2238 return gimple_op_ptr (gs
, 3);
2242 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2245 gimple_assign_set_rhs3 (gimple gs
, tree rhs
)
2247 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2249 gimple_set_op (gs
, 3, rhs
);
2252 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
2253 to see only a maximum of two operands. */
2256 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator
*gsi
, enum tree_code code
,
2259 gimple_assign_set_rhs_with_ops_1 (gsi
, code
, op1
, op2
, NULL
);
2262 /* Returns true if GS is a nontemporal move. */
2265 gimple_assign_nontemporal_move_p (const_gimple gs
)
2267 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2268 return gs
->nontemporal_move
;
2271 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2274 gimple_assign_set_nontemporal_move (gimple gs
, bool nontemporal
)
2276 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2277 gs
->nontemporal_move
= nontemporal
;
2281 /* Return the code of the expression computed on the rhs of assignment
2282 statement GS. In case that the RHS is a single object, returns the
2283 tree code of the object. */
2285 static inline enum tree_code
2286 gimple_assign_rhs_code (const_gimple gs
)
2288 enum tree_code code
;
2289 GIMPLE_CHECK (gs
, GIMPLE_ASSIGN
);
2291 code
= (enum tree_code
) gs
->subcode
;
2292 /* While we initially set subcode to the TREE_CODE of the rhs for
2293 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2294 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2295 if (get_gimple_rhs_class (code
) == GIMPLE_SINGLE_RHS
)
2296 code
= TREE_CODE (gimple_assign_rhs1 (gs
));
2302 /* Set CODE to be the code for the expression computed on the RHS of
2306 gimple_assign_set_rhs_code (gimple s
, enum tree_code code
)
2308 GIMPLE_CHECK (s
, GIMPLE_ASSIGN
);
2313 /* Return the gimple rhs class of the code of the expression computed on
2314 the rhs of assignment statement GS.
2315 This will never return GIMPLE_INVALID_RHS. */
2317 static inline enum gimple_rhs_class
2318 gimple_assign_rhs_class (const_gimple gs
)
2320 return get_gimple_rhs_class (gimple_assign_rhs_code (gs
));
2323 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2324 there is no operator associated with the assignment itself.
2325 Unlike gimple_assign_copy_p, this predicate returns true for
2326 any RHS operand, including those that perform an operation
2327 and do not have the semantics of a copy, such as COND_EXPR. */
2330 gimple_assign_single_p (gimple gs
)
2332 return (is_gimple_assign (gs
)
2333 && gimple_assign_rhs_class (gs
) == GIMPLE_SINGLE_RHS
);
2336 /* Return true if GS performs a store to its lhs. */
2339 gimple_store_p (gimple gs
)
2341 tree lhs
= gimple_get_lhs (gs
);
2342 return lhs
&& !is_gimple_reg (lhs
);
2345 /* Return true if GS is an assignment that loads from its rhs1. */
2348 gimple_assign_load_p (gimple gs
)
2351 if (!gimple_assign_single_p (gs
))
2353 rhs
= gimple_assign_rhs1 (gs
);
2354 if (TREE_CODE (rhs
) == WITH_SIZE_EXPR
)
2356 rhs
= get_base_address (rhs
);
2357 return (DECL_P (rhs
)
2358 || TREE_CODE (rhs
) == MEM_REF
|| TREE_CODE (rhs
) == TARGET_MEM_REF
);
2362 /* Return true if S is a type-cast assignment. */
2365 gimple_assign_cast_p (gimple s
)
2367 if (is_gimple_assign (s
))
2369 enum tree_code sc
= gimple_assign_rhs_code (s
);
2370 return CONVERT_EXPR_CODE_P (sc
)
2371 || sc
== VIEW_CONVERT_EXPR
2372 || sc
== FIX_TRUNC_EXPR
;
2378 /* Return true if S is a clobber statement. */
2381 gimple_clobber_p (gimple s
)
2383 return gimple_assign_single_p (s
)
2384 && TREE_CLOBBER_P (gimple_assign_rhs1 (s
));
2387 /* Return true if GS is a GIMPLE_CALL. */
2390 is_gimple_call (const_gimple gs
)
2392 return gimple_code (gs
) == GIMPLE_CALL
;
2395 /* Return the LHS of call statement GS. */
2398 gimple_call_lhs (const_gimple gs
)
2400 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2401 return gimple_op (gs
, 0);
2405 /* Return a pointer to the LHS of call statement GS. */
2407 static inline tree
*
2408 gimple_call_lhs_ptr (const_gimple gs
)
2410 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2411 return gimple_op_ptr (gs
, 0);
2415 /* Set LHS to be the LHS operand of call statement GS. */
2418 gimple_call_set_lhs (gimple gs
, tree lhs
)
2420 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2421 gimple_set_op (gs
, 0, lhs
);
2422 if (lhs
&& TREE_CODE (lhs
) == SSA_NAME
)
2423 SSA_NAME_DEF_STMT (lhs
) = gs
;
2427 /* Return true if call GS calls an internal-only function, as enumerated
2431 gimple_call_internal_p (const_gimple gs
)
2433 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2434 return (gs
->subcode
& GF_CALL_INTERNAL
) != 0;
2438 /* Return true if call GS is marked as instrumented by
2439 Pointer Bounds Checker. */
2442 gimple_call_with_bounds_p (const_gimple gs
)
2444 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2445 return (gs
->subcode
& GF_CALL_WITH_BOUNDS
) != 0;
2449 /* If INSTRUMENTED_P is true, marm statement GS as instrumented by
2450 Pointer Bounds Checker. */
2453 gimple_call_set_with_bounds (gimple gs
, bool with_bounds
)
2455 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2457 gs
->subcode
|= GF_CALL_WITH_BOUNDS
;
2459 gs
->subcode
&= ~GF_CALL_WITH_BOUNDS
;
2463 /* Return the target of internal call GS. */
2465 static inline enum internal_fn
2466 gimple_call_internal_fn (const_gimple gs
)
2468 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
2469 return static_cast <const gimple_statement_call
*> (gs
)->u
.internal_fn
;
2473 /* Return the function type of the function called by GS. */
2476 gimple_call_fntype (const_gimple gs
)
2478 const gimple_statement_call
*call_stmt
=
2479 as_a
<const gimple_statement_call
> (gs
);
2480 if (gimple_call_internal_p (gs
))
2482 return call_stmt
->u
.fntype
;
2485 /* Set the type of the function called by GS to FNTYPE. */
2488 gimple_call_set_fntype (gimple gs
, tree fntype
)
2490 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
> (gs
);
2491 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2492 call_stmt
->u
.fntype
= fntype
;
2496 /* Return the tree node representing the function called by call
2500 gimple_call_fn (const_gimple gs
)
2502 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2503 return gimple_op (gs
, 1);
2506 /* Return a pointer to the tree node representing the function called by call
2509 static inline tree
*
2510 gimple_call_fn_ptr (const_gimple gs
)
2512 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2513 return gimple_op_ptr (gs
, 1);
2517 /* Set FN to be the function called by call statement GS. */
2520 gimple_call_set_fn (gimple gs
, tree fn
)
2522 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2523 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2524 gimple_set_op (gs
, 1, fn
);
2528 /* Set FNDECL to be the function called by call statement GS. */
2531 gimple_call_set_fndecl (gimple gs
, tree decl
)
2533 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2534 gcc_gimple_checking_assert (!gimple_call_internal_p (gs
));
2535 gimple_set_op (gs
, 1, build_fold_addr_expr_loc (gimple_location (gs
), decl
));
2539 /* Set internal function FN to be the function called by call statement GS. */
2542 gimple_call_set_internal_fn (gimple gs
, enum internal_fn fn
)
2544 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
> (gs
);
2545 gcc_gimple_checking_assert (gimple_call_internal_p (gs
));
2546 call_stmt
->u
.internal_fn
= fn
;
2550 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2551 Otherwise return NULL. This function is analogous to
2552 get_callee_fndecl in tree land. */
2555 gimple_call_fndecl (const_gimple gs
)
2557 return gimple_call_addr_fndecl (gimple_call_fn (gs
));
2561 /* Return the type returned by call statement GS. */
2564 gimple_call_return_type (const_gimple gs
)
2566 tree type
= gimple_call_fntype (gs
);
2568 if (type
== NULL_TREE
)
2569 return TREE_TYPE (gimple_call_lhs (gs
));
2571 /* The type returned by a function is the type of its
2573 return TREE_TYPE (type
);
2577 /* Return the static chain for call statement GS. */
2580 gimple_call_chain (const_gimple gs
)
2582 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2583 return gimple_op (gs
, 2);
2587 /* Return a pointer to the static chain for call statement GS. */
2589 static inline tree
*
2590 gimple_call_chain_ptr (const_gimple gs
)
2592 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2593 return gimple_op_ptr (gs
, 2);
2596 /* Set CHAIN to be the static chain for call statement GS. */
2599 gimple_call_set_chain (gimple gs
, tree chain
)
2601 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2603 gimple_set_op (gs
, 2, chain
);
2607 /* Return the number of arguments used by call statement GS. */
2609 static inline unsigned
2610 gimple_call_num_args (const_gimple gs
)
2613 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2614 num_ops
= gimple_num_ops (gs
);
2619 /* Return the argument at position INDEX for call statement GS. */
2622 gimple_call_arg (const_gimple gs
, unsigned index
)
2624 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2625 return gimple_op (gs
, index
+ 3);
2629 /* Return a pointer to the argument at position INDEX for call
2632 static inline tree
*
2633 gimple_call_arg_ptr (const_gimple gs
, unsigned index
)
2635 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2636 return gimple_op_ptr (gs
, index
+ 3);
2640 /* Set ARG to be the argument at position INDEX for call statement GS. */
2643 gimple_call_set_arg (gimple gs
, unsigned index
, tree arg
)
2645 GIMPLE_CHECK (gs
, GIMPLE_CALL
);
2646 gimple_set_op (gs
, index
+ 3, arg
);
2650 /* If TAIL_P is true, mark call statement S as being a tail call
2651 (i.e., a call just before the exit of a function). These calls are
2652 candidate for tail call optimization. */
2655 gimple_call_set_tail (gimple s
, bool tail_p
)
2657 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2659 s
->subcode
|= GF_CALL_TAILCALL
;
2661 s
->subcode
&= ~GF_CALL_TAILCALL
;
2665 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2668 gimple_call_tail_p (gimple s
)
2670 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2671 return (s
->subcode
& GF_CALL_TAILCALL
) != 0;
2675 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2676 slot optimization. This transformation uses the target of the call
2677 expansion as the return slot for calls that return in memory. */
2680 gimple_call_set_return_slot_opt (gimple s
, bool return_slot_opt_p
)
2682 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2683 if (return_slot_opt_p
)
2684 s
->subcode
|= GF_CALL_RETURN_SLOT_OPT
;
2686 s
->subcode
&= ~GF_CALL_RETURN_SLOT_OPT
;
2690 /* Return true if S is marked for return slot optimization. */
2693 gimple_call_return_slot_opt_p (gimple s
)
2695 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2696 return (s
->subcode
& GF_CALL_RETURN_SLOT_OPT
) != 0;
2700 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2701 thunk to the thunked-to function. */
2704 gimple_call_set_from_thunk (gimple s
, bool from_thunk_p
)
2706 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2708 s
->subcode
|= GF_CALL_FROM_THUNK
;
2710 s
->subcode
&= ~GF_CALL_FROM_THUNK
;
2714 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2717 gimple_call_from_thunk_p (gimple s
)
2719 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2720 return (s
->subcode
& GF_CALL_FROM_THUNK
) != 0;
2724 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2725 argument pack in its argument list. */
2728 gimple_call_set_va_arg_pack (gimple s
, bool pass_arg_pack_p
)
2730 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2731 if (pass_arg_pack_p
)
2732 s
->subcode
|= GF_CALL_VA_ARG_PACK
;
2734 s
->subcode
&= ~GF_CALL_VA_ARG_PACK
;
2738 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2739 argument pack in its argument list. */
2742 gimple_call_va_arg_pack_p (gimple s
)
2744 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2745 return (s
->subcode
& GF_CALL_VA_ARG_PACK
) != 0;
2749 /* Return true if S is a noreturn call. */
2752 gimple_call_noreturn_p (gimple s
)
2754 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2755 return (gimple_call_flags (s
) & ECF_NORETURN
) != 0;
2759 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2760 even if the called function can throw in other cases. */
2763 gimple_call_set_nothrow (gimple s
, bool nothrow_p
)
2765 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2767 s
->subcode
|= GF_CALL_NOTHROW
;
2769 s
->subcode
&= ~GF_CALL_NOTHROW
;
2772 /* Return true if S is a nothrow call. */
2775 gimple_call_nothrow_p (gimple s
)
2777 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2778 return (gimple_call_flags (s
) & ECF_NOTHROW
) != 0;
2781 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2782 is known to be emitted for VLA objects. Those are wrapped by
2783 stack_save/stack_restore calls and hence can't lead to unbounded
2784 stack growth even when they occur in loops. */
2787 gimple_call_set_alloca_for_var (gimple s
, bool for_var
)
2789 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2791 s
->subcode
|= GF_CALL_ALLOCA_FOR_VAR
;
2793 s
->subcode
&= ~GF_CALL_ALLOCA_FOR_VAR
;
2796 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2799 gimple_call_alloca_for_var_p (gimple s
)
2801 GIMPLE_CHECK (s
, GIMPLE_CALL
);
2802 return (s
->subcode
& GF_CALL_ALLOCA_FOR_VAR
) != 0;
2805 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2808 gimple_call_copy_flags (gimple dest_call
, gimple orig_call
)
2810 GIMPLE_CHECK (dest_call
, GIMPLE_CALL
);
2811 GIMPLE_CHECK (orig_call
, GIMPLE_CALL
);
2812 dest_call
->subcode
= orig_call
->subcode
;
2816 /* Return a pointer to the points-to solution for the set of call-used
2817 variables of the call CALL. */
2819 static inline struct pt_solution
*
2820 gimple_call_use_set (gimple call
)
2822 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
> (call
);
2823 return &call_stmt
->call_used
;
2827 /* Return a pointer to the points-to solution for the set of call-used
2828 variables of the call CALL. */
2830 static inline struct pt_solution
*
2831 gimple_call_clobber_set (gimple call
)
2833 gimple_statement_call
*call_stmt
= as_a
<gimple_statement_call
> (call
);
2834 return &call_stmt
->call_clobbered
;
2838 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2842 gimple_has_lhs (gimple stmt
)
2844 return (is_gimple_assign (stmt
)
2845 || (is_gimple_call (stmt
)
2846 && gimple_call_lhs (stmt
) != NULL_TREE
));
2850 /* Return the code of the predicate computed by conditional statement GS. */
2852 static inline enum tree_code
2853 gimple_cond_code (const_gimple gs
)
2855 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2856 return (enum tree_code
) gs
->subcode
;
2860 /* Set CODE to be the predicate code for the conditional statement GS. */
2863 gimple_cond_set_code (gimple gs
, enum tree_code code
)
2865 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2870 /* Return the LHS of the predicate computed by conditional statement GS. */
2873 gimple_cond_lhs (const_gimple gs
)
2875 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2876 return gimple_op (gs
, 0);
2879 /* Return the pointer to the LHS of the predicate computed by conditional
2882 static inline tree
*
2883 gimple_cond_lhs_ptr (const_gimple gs
)
2885 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2886 return gimple_op_ptr (gs
, 0);
2889 /* Set LHS to be the LHS operand of the predicate computed by
2890 conditional statement GS. */
2893 gimple_cond_set_lhs (gimple gs
, tree lhs
)
2895 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2896 gimple_set_op (gs
, 0, lhs
);
2900 /* Return the RHS operand of the predicate computed by conditional GS. */
2903 gimple_cond_rhs (const_gimple gs
)
2905 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2906 return gimple_op (gs
, 1);
2909 /* Return the pointer to the RHS operand of the predicate computed by
2912 static inline tree
*
2913 gimple_cond_rhs_ptr (const_gimple gs
)
2915 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2916 return gimple_op_ptr (gs
, 1);
2920 /* Set RHS to be the RHS operand of the predicate computed by
2921 conditional statement GS. */
2924 gimple_cond_set_rhs (gimple gs
, tree rhs
)
2926 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2927 gimple_set_op (gs
, 1, rhs
);
2931 /* Return the label used by conditional statement GS when its
2932 predicate evaluates to true. */
2935 gimple_cond_true_label (const_gimple gs
)
2937 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2938 return gimple_op (gs
, 2);
2942 /* Set LABEL to be the label used by conditional statement GS when its
2943 predicate evaluates to true. */
2946 gimple_cond_set_true_label (gimple gs
, tree label
)
2948 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2949 gimple_set_op (gs
, 2, label
);
2953 /* Set LABEL to be the label used by conditional statement GS when its
2954 predicate evaluates to false. */
2957 gimple_cond_set_false_label (gimple gs
, tree label
)
2959 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2960 gimple_set_op (gs
, 3, label
);
2964 /* Return the label used by conditional statement GS when its
2965 predicate evaluates to false. */
2968 gimple_cond_false_label (const_gimple gs
)
2970 GIMPLE_CHECK (gs
, GIMPLE_COND
);
2971 return gimple_op (gs
, 3);
2975 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
2978 gimple_cond_make_false (gimple gs
)
2980 gimple_cond_set_lhs (gs
, boolean_true_node
);
2981 gimple_cond_set_rhs (gs
, boolean_false_node
);
2982 gs
->subcode
= EQ_EXPR
;
2986 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
2989 gimple_cond_make_true (gimple gs
)
2991 gimple_cond_set_lhs (gs
, boolean_true_node
);
2992 gimple_cond_set_rhs (gs
, boolean_true_node
);
2993 gs
->subcode
= EQ_EXPR
;
2996 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2997 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3000 gimple_cond_true_p (const_gimple gs
)
3002 tree lhs
= gimple_cond_lhs (gs
);
3003 tree rhs
= gimple_cond_rhs (gs
);
3004 enum tree_code code
= gimple_cond_code (gs
);
3006 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3009 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3012 if (code
== NE_EXPR
&& lhs
!= rhs
)
3015 if (code
== EQ_EXPR
&& lhs
== rhs
)
3021 /* Check if conditional statement GS is of the form 'if (1 != 1)',
3022 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3025 gimple_cond_false_p (const_gimple gs
)
3027 tree lhs
= gimple_cond_lhs (gs
);
3028 tree rhs
= gimple_cond_rhs (gs
);
3029 enum tree_code code
= gimple_cond_code (gs
);
3031 if (lhs
!= boolean_true_node
&& lhs
!= boolean_false_node
)
3034 if (rhs
!= boolean_true_node
&& rhs
!= boolean_false_node
)
3037 if (code
== NE_EXPR
&& lhs
== rhs
)
3040 if (code
== EQ_EXPR
&& lhs
!= rhs
)
3046 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3049 gimple_cond_set_condition (gimple stmt
, enum tree_code code
, tree lhs
, tree rhs
)
3051 gimple_cond_set_code (stmt
, code
);
3052 gimple_cond_set_lhs (stmt
, lhs
);
3053 gimple_cond_set_rhs (stmt
, rhs
);
3056 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3059 gimple_label_label (const_gimple gs
)
3061 GIMPLE_CHECK (gs
, GIMPLE_LABEL
);
3062 return gimple_op (gs
, 0);
3066 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3070 gimple_label_set_label (gimple gs
, tree label
)
3072 GIMPLE_CHECK (gs
, GIMPLE_LABEL
);
3073 gimple_set_op (gs
, 0, label
);
3077 /* Return the destination of the unconditional jump GS. */
3080 gimple_goto_dest (const_gimple gs
)
3082 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3083 return gimple_op (gs
, 0);
3087 /* Set DEST to be the destination of the unconditonal jump GS. */
3090 gimple_goto_set_dest (gimple gs
, tree dest
)
3092 GIMPLE_CHECK (gs
, GIMPLE_GOTO
);
3093 gimple_set_op (gs
, 0, dest
);
3097 /* Return the variables declared in the GIMPLE_BIND statement GS. */
3100 gimple_bind_vars (const_gimple gs
)
3102 const gimple_statement_bind
*bind_stmt
=
3103 as_a
<const gimple_statement_bind
> (gs
);
3104 return bind_stmt
->vars
;
3108 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
3112 gimple_bind_set_vars (gimple gs
, tree vars
)
3114 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3115 bind_stmt
->vars
= vars
;
3119 /* Append VARS to the set of variables declared in the GIMPLE_BIND
3123 gimple_bind_append_vars (gimple gs
, tree vars
)
3125 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3126 bind_stmt
->vars
= chainon (bind_stmt
->vars
, vars
);
3130 static inline gimple_seq
*
3131 gimple_bind_body_ptr (gimple gs
)
3133 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3134 return &bind_stmt
->body
;
3137 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
3139 static inline gimple_seq
3140 gimple_bind_body (gimple gs
)
3142 return *gimple_bind_body_ptr (gs
);
3146 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
3150 gimple_bind_set_body (gimple gs
, gimple_seq seq
)
3152 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3153 bind_stmt
->body
= seq
;
3157 /* Append a statement to the end of a GIMPLE_BIND's body. */
3160 gimple_bind_add_stmt (gimple gs
, gimple stmt
)
3162 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3163 gimple_seq_add_stmt (&bind_stmt
->body
, stmt
);
3167 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
3170 gimple_bind_add_seq (gimple gs
, gimple_seq seq
)
3172 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3173 gimple_seq_add_seq (&bind_stmt
->body
, seq
);
3177 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
3178 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
3181 gimple_bind_block (const_gimple gs
)
3183 const gimple_statement_bind
*bind_stmt
=
3184 as_a
<const gimple_statement_bind
> (gs
);
3185 return bind_stmt
->block
;
3189 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
3193 gimple_bind_set_block (gimple gs
, tree block
)
3195 gimple_statement_bind
*bind_stmt
= as_a
<gimple_statement_bind
> (gs
);
3196 gcc_gimple_checking_assert (block
== NULL_TREE
3197 || TREE_CODE (block
) == BLOCK
);
3198 bind_stmt
->block
= block
;
3202 /* Return the number of input operands for GIMPLE_ASM GS. */
3204 static inline unsigned
3205 gimple_asm_ninputs (const_gimple gs
)
3207 const gimple_statement_asm
*asm_stmt
=
3208 as_a
<const gimple_statement_asm
> (gs
);
3209 return asm_stmt
->ni
;
3213 /* Return the number of output operands for GIMPLE_ASM GS. */
3215 static inline unsigned
3216 gimple_asm_noutputs (const_gimple gs
)
3218 const gimple_statement_asm
*asm_stmt
=
3219 as_a
<const gimple_statement_asm
> (gs
);
3220 return asm_stmt
->no
;
3224 /* Return the number of clobber operands for GIMPLE_ASM GS. */
3226 static inline unsigned
3227 gimple_asm_nclobbers (const_gimple gs
)
3229 const gimple_statement_asm
*asm_stmt
=
3230 as_a
<const gimple_statement_asm
> (gs
);
3231 return asm_stmt
->nc
;
3234 /* Return the number of label operands for GIMPLE_ASM GS. */
3236 static inline unsigned
3237 gimple_asm_nlabels (const_gimple gs
)
3239 const gimple_statement_asm
*asm_stmt
=
3240 as_a
<const gimple_statement_asm
> (gs
);
3241 return asm_stmt
->nl
;
3244 /* Return input operand INDEX of GIMPLE_ASM GS. */
3247 gimple_asm_input_op (const_gimple gs
, unsigned index
)
3249 const gimple_statement_asm
*asm_stmt
=
3250 as_a
<const gimple_statement_asm
> (gs
);
3251 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
3252 return gimple_op (gs
, index
+ asm_stmt
->no
);
3255 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
3257 static inline tree
*
3258 gimple_asm_input_op_ptr (const_gimple gs
, unsigned index
)
3260 const gimple_statement_asm
*asm_stmt
=
3261 as_a
<const gimple_statement_asm
> (gs
);
3262 gcc_gimple_checking_assert (index
< asm_stmt
->ni
);
3263 return gimple_op_ptr (gs
, index
+ asm_stmt
->no
);
3267 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
3270 gimple_asm_set_input_op (gimple gs
, unsigned index
, tree in_op
)
3272 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
> (gs
);
3273 gcc_gimple_checking_assert (index
< asm_stmt
->ni
3274 && TREE_CODE (in_op
) == TREE_LIST
);
3275 gimple_set_op (gs
, index
+ asm_stmt
->no
, in_op
);
3279 /* Return output operand INDEX of GIMPLE_ASM GS. */
3282 gimple_asm_output_op (const_gimple gs
, unsigned index
)
3284 const gimple_statement_asm
*asm_stmt
=
3285 as_a
<const gimple_statement_asm
> (gs
);
3286 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
3287 return gimple_op (gs
, index
);
3290 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
3292 static inline tree
*
3293 gimple_asm_output_op_ptr (const_gimple gs
, unsigned index
)
3295 const gimple_statement_asm
*asm_stmt
=
3296 as_a
<const gimple_statement_asm
> (gs
);
3297 gcc_gimple_checking_assert (index
< asm_stmt
->no
);
3298 return gimple_op_ptr (gs
, index
);
3302 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
3305 gimple_asm_set_output_op (gimple gs
, unsigned index
, tree out_op
)
3307 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
> (gs
);
3308 gcc_gimple_checking_assert (index
< asm_stmt
->no
3309 && TREE_CODE (out_op
) == TREE_LIST
);
3310 gimple_set_op (gs
, index
, out_op
);
3314 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3317 gimple_asm_clobber_op (const_gimple gs
, unsigned index
)
3319 const gimple_statement_asm
*asm_stmt
=
3320 as_a
<const gimple_statement_asm
> (gs
);
3321 gcc_gimple_checking_assert (index
< asm_stmt
->nc
);
3322 return gimple_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->no
);
3326 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3329 gimple_asm_set_clobber_op (gimple gs
, unsigned index
, tree clobber_op
)
3331 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
> (gs
);
3332 gcc_gimple_checking_assert (index
< asm_stmt
->nc
3333 && TREE_CODE (clobber_op
) == TREE_LIST
);
3334 gimple_set_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->no
, clobber_op
);
3337 /* Return label operand INDEX of GIMPLE_ASM GS. */
3340 gimple_asm_label_op (const_gimple gs
, unsigned index
)
3342 const gimple_statement_asm
*asm_stmt
=
3343 as_a
<const gimple_statement_asm
> (gs
);
3344 gcc_gimple_checking_assert (index
< asm_stmt
->nl
);
3345 return gimple_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->nc
);
3348 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3351 gimple_asm_set_label_op (gimple gs
, unsigned index
, tree label_op
)
3353 gimple_statement_asm
*asm_stmt
= as_a
<gimple_statement_asm
> (gs
);
3354 gcc_gimple_checking_assert (index
< asm_stmt
->nl
3355 && TREE_CODE (label_op
) == TREE_LIST
);
3356 gimple_set_op (gs
, index
+ asm_stmt
->ni
+ asm_stmt
->nc
, label_op
);
3359 /* Return the string representing the assembly instruction in
3362 static inline const char *
3363 gimple_asm_string (const_gimple gs
)
3365 const gimple_statement_asm
*asm_stmt
=
3366 as_a
<const gimple_statement_asm
> (gs
);
3367 return asm_stmt
->string
;
3371 /* Return true if GS is an asm statement marked volatile. */
3374 gimple_asm_volatile_p (const_gimple gs
)
3376 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3377 return (gs
->subcode
& GF_ASM_VOLATILE
) != 0;
3381 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3384 gimple_asm_set_volatile (gimple gs
, bool volatile_p
)
3386 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3388 gs
->subcode
|= GF_ASM_VOLATILE
;
3390 gs
->subcode
&= ~GF_ASM_VOLATILE
;
3394 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3397 gimple_asm_set_input (gimple gs
, bool input_p
)
3399 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3401 gs
->subcode
|= GF_ASM_INPUT
;
3403 gs
->subcode
&= ~GF_ASM_INPUT
;
3407 /* Return true if asm GS is an ASM_INPUT. */
3410 gimple_asm_input_p (const_gimple gs
)
3412 GIMPLE_CHECK (gs
, GIMPLE_ASM
);
3413 return (gs
->subcode
& GF_ASM_INPUT
) != 0;
3417 /* Return the types handled by GIMPLE_CATCH statement GS. */
3420 gimple_catch_types (const_gimple gs
)
3422 const gimple_statement_catch
*catch_stmt
=
3423 as_a
<const gimple_statement_catch
> (gs
);
3424 return catch_stmt
->types
;
3428 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3430 static inline tree
*
3431 gimple_catch_types_ptr (gimple gs
)
3433 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
> (gs
);
3434 return &catch_stmt
->types
;
3438 /* Return a pointer to the GIMPLE sequence representing the body of
3439 the handler of GIMPLE_CATCH statement GS. */
3441 static inline gimple_seq
*
3442 gimple_catch_handler_ptr (gimple gs
)
3444 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
> (gs
);
3445 return &catch_stmt
->handler
;
3449 /* Return the GIMPLE sequence representing the body of the handler of
3450 GIMPLE_CATCH statement GS. */
3452 static inline gimple_seq
3453 gimple_catch_handler (gimple gs
)
3455 return *gimple_catch_handler_ptr (gs
);
3459 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3462 gimple_catch_set_types (gimple gs
, tree t
)
3464 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
> (gs
);
3465 catch_stmt
->types
= t
;
3469 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3472 gimple_catch_set_handler (gimple gs
, gimple_seq handler
)
3474 gimple_statement_catch
*catch_stmt
= as_a
<gimple_statement_catch
> (gs
);
3475 catch_stmt
->handler
= handler
;
3479 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3482 gimple_eh_filter_types (const_gimple gs
)
3484 const gimple_statement_eh_filter
*eh_filter_stmt
=
3485 as_a
<const gimple_statement_eh_filter
> (gs
);
3486 return eh_filter_stmt
->types
;
3490 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3493 static inline tree
*
3494 gimple_eh_filter_types_ptr (gimple gs
)
3496 gimple_statement_eh_filter
*eh_filter_stmt
=
3497 as_a
<gimple_statement_eh_filter
> (gs
);
3498 return &eh_filter_stmt
->types
;
3502 /* Return a pointer to the sequence of statement to execute when
3503 GIMPLE_EH_FILTER statement fails. */
3505 static inline gimple_seq
*
3506 gimple_eh_filter_failure_ptr (gimple gs
)
3508 gimple_statement_eh_filter
*eh_filter_stmt
=
3509 as_a
<gimple_statement_eh_filter
> (gs
);
3510 return &eh_filter_stmt
->failure
;
3514 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3517 static inline gimple_seq
3518 gimple_eh_filter_failure (gimple gs
)
3520 return *gimple_eh_filter_failure_ptr (gs
);
3524 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3527 gimple_eh_filter_set_types (gimple gs
, tree types
)
3529 gimple_statement_eh_filter
*eh_filter_stmt
=
3530 as_a
<gimple_statement_eh_filter
> (gs
);
3531 eh_filter_stmt
->types
= types
;
3535 /* Set FAILURE to be the sequence of statements to execute on failure
3536 for GIMPLE_EH_FILTER GS. */
3539 gimple_eh_filter_set_failure (gimple gs
, gimple_seq failure
)
3541 gimple_statement_eh_filter
*eh_filter_stmt
=
3542 as_a
<gimple_statement_eh_filter
> (gs
);
3543 eh_filter_stmt
->failure
= failure
;
3546 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3549 gimple_eh_must_not_throw_fndecl (gimple gs
)
3551 gimple_statement_eh_mnt
*eh_mnt_stmt
= as_a
<gimple_statement_eh_mnt
> (gs
);
3552 return eh_mnt_stmt
->fndecl
;
3555 /* Set the function decl to be called by GS to DECL. */
3558 gimple_eh_must_not_throw_set_fndecl (gimple gs
, tree decl
)
3560 gimple_statement_eh_mnt
*eh_mnt_stmt
= as_a
<gimple_statement_eh_mnt
> (gs
);
3561 eh_mnt_stmt
->fndecl
= decl
;
3564 /* GIMPLE_EH_ELSE accessors. */
3566 static inline gimple_seq
*
3567 gimple_eh_else_n_body_ptr (gimple gs
)
3569 gimple_statement_eh_else
*eh_else_stmt
=
3570 as_a
<gimple_statement_eh_else
> (gs
);
3571 return &eh_else_stmt
->n_body
;
3574 static inline gimple_seq
3575 gimple_eh_else_n_body (gimple gs
)
3577 return *gimple_eh_else_n_body_ptr (gs
);
3580 static inline gimple_seq
*
3581 gimple_eh_else_e_body_ptr (gimple gs
)
3583 gimple_statement_eh_else
*eh_else_stmt
=
3584 as_a
<gimple_statement_eh_else
> (gs
);
3585 return &eh_else_stmt
->e_body
;
3588 static inline gimple_seq
3589 gimple_eh_else_e_body (gimple gs
)
3591 return *gimple_eh_else_e_body_ptr (gs
);
3595 gimple_eh_else_set_n_body (gimple gs
, gimple_seq seq
)
3597 gimple_statement_eh_else
*eh_else_stmt
=
3598 as_a
<gimple_statement_eh_else
> (gs
);
3599 eh_else_stmt
->n_body
= seq
;
3603 gimple_eh_else_set_e_body (gimple gs
, gimple_seq seq
)
3605 gimple_statement_eh_else
*eh_else_stmt
=
3606 as_a
<gimple_statement_eh_else
> (gs
);
3607 eh_else_stmt
->e_body
= seq
;
3610 /* GIMPLE_TRY accessors. */
3612 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3613 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3615 static inline enum gimple_try_flags
3616 gimple_try_kind (const_gimple gs
)
3618 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
3619 return (enum gimple_try_flags
) (gs
->subcode
& GIMPLE_TRY_KIND
);
3623 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3626 gimple_try_set_kind (gimple gs
, enum gimple_try_flags kind
)
3628 GIMPLE_CHECK (gs
, GIMPLE_TRY
);
3629 gcc_gimple_checking_assert (kind
== GIMPLE_TRY_CATCH
3630 || kind
== GIMPLE_TRY_FINALLY
);
3631 if (gimple_try_kind (gs
) != kind
)
3632 gs
->subcode
= (unsigned int) kind
;
3636 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3639 gimple_try_catch_is_cleanup (const_gimple gs
)
3641 gcc_gimple_checking_assert (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
);
3642 return (gs
->subcode
& GIMPLE_TRY_CATCH_IS_CLEANUP
) != 0;
3646 /* Return a pointer to the sequence of statements used as the
3647 body for GIMPLE_TRY GS. */
3649 static inline gimple_seq
*
3650 gimple_try_eval_ptr (gimple gs
)
3652 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
> (gs
);
3653 return &try_stmt
->eval
;
3657 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3659 static inline gimple_seq
3660 gimple_try_eval (gimple gs
)
3662 return *gimple_try_eval_ptr (gs
);
3666 /* Return a pointer to the sequence of statements used as the cleanup body for
3669 static inline gimple_seq
*
3670 gimple_try_cleanup_ptr (gimple gs
)
3672 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
> (gs
);
3673 return &try_stmt
->cleanup
;
3677 /* Return the sequence of statements used as the cleanup body for
3680 static inline gimple_seq
3681 gimple_try_cleanup (gimple gs
)
3683 return *gimple_try_cleanup_ptr (gs
);
3687 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3690 gimple_try_set_catch_is_cleanup (gimple g
, bool catch_is_cleanup
)
3692 gcc_gimple_checking_assert (gimple_try_kind (g
) == GIMPLE_TRY_CATCH
);
3693 if (catch_is_cleanup
)
3694 g
->subcode
|= GIMPLE_TRY_CATCH_IS_CLEANUP
;
3696 g
->subcode
&= ~GIMPLE_TRY_CATCH_IS_CLEANUP
;
3700 /* Set EVAL to be the sequence of statements to use as the body for
3704 gimple_try_set_eval (gimple gs
, gimple_seq eval
)
3706 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
> (gs
);
3707 try_stmt
->eval
= eval
;
3711 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3712 body for GIMPLE_TRY GS. */
3715 gimple_try_set_cleanup (gimple gs
, gimple_seq cleanup
)
3717 gimple_statement_try
*try_stmt
= as_a
<gimple_statement_try
> (gs
);
3718 try_stmt
->cleanup
= cleanup
;
3722 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3724 static inline gimple_seq
*
3725 gimple_wce_cleanup_ptr (gimple gs
)
3727 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
> (gs
);
3728 return &wce_stmt
->cleanup
;
3732 /* Return the cleanup sequence for cleanup statement GS. */
3734 static inline gimple_seq
3735 gimple_wce_cleanup (gimple gs
)
3737 return *gimple_wce_cleanup_ptr (gs
);
3741 /* Set CLEANUP to be the cleanup sequence for GS. */
3744 gimple_wce_set_cleanup (gimple gs
, gimple_seq cleanup
)
3746 gimple_statement_wce
*wce_stmt
= as_a
<gimple_statement_wce
> (gs
);
3747 wce_stmt
->cleanup
= cleanup
;
3751 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3754 gimple_wce_cleanup_eh_only (const_gimple gs
)
3756 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
3757 return gs
->subcode
!= 0;
3761 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3764 gimple_wce_set_cleanup_eh_only (gimple gs
, bool eh_only_p
)
3766 GIMPLE_CHECK (gs
, GIMPLE_WITH_CLEANUP_EXPR
);
3767 gs
->subcode
= (unsigned int) eh_only_p
;
3771 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3773 static inline unsigned
3774 gimple_phi_capacity (const_gimple gs
)
3776 const gimple_statement_phi
*phi_stmt
=
3777 as_a
<const gimple_statement_phi
> (gs
);
3778 return phi_stmt
->capacity
;
3782 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3783 be exactly the number of incoming edges for the basic block holding
3786 static inline unsigned
3787 gimple_phi_num_args (const_gimple gs
)
3789 const gimple_statement_phi
*phi_stmt
=
3790 as_a
<const gimple_statement_phi
> (gs
);
3791 return phi_stmt
->nargs
;
3795 /* Return the SSA name created by GIMPLE_PHI GS. */
3798 gimple_phi_result (const_gimple gs
)
3800 const gimple_statement_phi
*phi_stmt
=
3801 as_a
<const gimple_statement_phi
> (gs
);
3802 return phi_stmt
->result
;
3805 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3807 static inline tree
*
3808 gimple_phi_result_ptr (gimple gs
)
3810 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
> (gs
);
3811 return &phi_stmt
->result
;
3814 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3817 gimple_phi_set_result (gimple gs
, tree result
)
3819 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
> (gs
);
3820 phi_stmt
->result
= result
;
3821 if (result
&& TREE_CODE (result
) == SSA_NAME
)
3822 SSA_NAME_DEF_STMT (result
) = gs
;
3826 /* Return the PHI argument corresponding to incoming edge INDEX for
3829 static inline struct phi_arg_d
*
3830 gimple_phi_arg (gimple gs
, unsigned index
)
3832 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
> (gs
);
3833 gcc_gimple_checking_assert (index
<= phi_stmt
->capacity
);
3834 return &(phi_stmt
->args
[index
]);
3837 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3838 for GIMPLE_PHI GS. */
3841 gimple_phi_set_arg (gimple gs
, unsigned index
, struct phi_arg_d
* phiarg
)
3843 gimple_statement_phi
*phi_stmt
= as_a
<gimple_statement_phi
> (gs
);
3844 gcc_gimple_checking_assert (index
<= phi_stmt
->nargs
);
3845 phi_stmt
->args
[index
] = *phiarg
;
3848 /* Return the PHI nodes for basic block BB, or NULL if there are no
3851 static inline gimple_seq
3852 phi_nodes (const_basic_block bb
)
3854 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
3855 return bb
->il
.gimple
.phi_nodes
;
3858 /* Return a pointer to the PHI nodes for basic block BB. */
3860 static inline gimple_seq
*
3861 phi_nodes_ptr (basic_block bb
)
3863 gcc_checking_assert (!(bb
->flags
& BB_RTL
));
3864 return &bb
->il
.gimple
.phi_nodes
;
3867 /* Return the tree operand for argument I of PHI node GS. */
3870 gimple_phi_arg_def (gimple gs
, size_t index
)
3872 return gimple_phi_arg (gs
, index
)->def
;
3876 /* Return a pointer to the tree operand for argument I of PHI node GS. */
3878 static inline tree
*
3879 gimple_phi_arg_def_ptr (gimple gs
, size_t index
)
3881 return &gimple_phi_arg (gs
, index
)->def
;
3884 /* Return the edge associated with argument I of phi node GS. */
3887 gimple_phi_arg_edge (gimple gs
, size_t i
)
3889 return EDGE_PRED (gimple_bb (gs
), i
);
3892 /* Return the source location of gimple argument I of phi node GS. */
3894 static inline source_location
3895 gimple_phi_arg_location (gimple gs
, size_t i
)
3897 return gimple_phi_arg (gs
, i
)->locus
;
3900 /* Return the source location of the argument on edge E of phi node GS. */
3902 static inline source_location
3903 gimple_phi_arg_location_from_edge (gimple gs
, edge e
)
3905 return gimple_phi_arg (gs
, e
->dest_idx
)->locus
;
3908 /* Set the source location of gimple argument I of phi node GS to LOC. */
3911 gimple_phi_arg_set_location (gimple gs
, size_t i
, source_location loc
)
3913 gimple_phi_arg (gs
, i
)->locus
= loc
;
3916 /* Return TRUE if argument I of phi node GS has a location record. */
3919 gimple_phi_arg_has_location (gimple gs
, size_t i
)
3921 return gimple_phi_arg_location (gs
, i
) != UNKNOWN_LOCATION
;
3925 /* Return the region number for GIMPLE_RESX GS. */
3928 gimple_resx_region (const_gimple gs
)
3930 const gimple_statement_resx
*resx_stmt
=
3931 as_a
<const gimple_statement_resx
> (gs
);
3932 return resx_stmt
->region
;
3935 /* Set REGION to be the region number for GIMPLE_RESX GS. */
3938 gimple_resx_set_region (gimple gs
, int region
)
3940 gimple_statement_resx
*resx_stmt
= as_a
<gimple_statement_resx
> (gs
);
3941 resx_stmt
->region
= region
;
3944 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
3947 gimple_eh_dispatch_region (const_gimple gs
)
3949 const gimple_statement_eh_dispatch
*eh_dispatch_stmt
=
3950 as_a
<const gimple_statement_eh_dispatch
> (gs
);
3951 return eh_dispatch_stmt
->region
;
3954 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
3957 gimple_eh_dispatch_set_region (gimple gs
, int region
)
3959 gimple_statement_eh_dispatch
*eh_dispatch_stmt
=
3960 as_a
<gimple_statement_eh_dispatch
> (gs
);
3961 eh_dispatch_stmt
->region
= region
;
3964 /* Return the number of labels associated with the switch statement GS. */
3966 static inline unsigned
3967 gimple_switch_num_labels (const_gimple gs
)
3970 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
3971 num_ops
= gimple_num_ops (gs
);
3972 gcc_gimple_checking_assert (num_ops
> 1);
3977 /* Set NLABELS to be the number of labels for the switch statement GS. */
3980 gimple_switch_set_num_labels (gimple g
, unsigned nlabels
)
3982 GIMPLE_CHECK (g
, GIMPLE_SWITCH
);
3983 gimple_set_num_ops (g
, nlabels
+ 1);
3987 /* Return the index variable used by the switch statement GS. */
3990 gimple_switch_index (const_gimple gs
)
3992 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
3993 return gimple_op (gs
, 0);
3997 /* Return a pointer to the index variable for the switch statement GS. */
3999 static inline tree
*
4000 gimple_switch_index_ptr (const_gimple gs
)
4002 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4003 return gimple_op_ptr (gs
, 0);
4007 /* Set INDEX to be the index variable for switch statement GS. */
4010 gimple_switch_set_index (gimple gs
, tree index
)
4012 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4013 gcc_gimple_checking_assert (SSA_VAR_P (index
) || CONSTANT_CLASS_P (index
));
4014 gimple_set_op (gs
, 0, index
);
4018 /* Return the label numbered INDEX. The default label is 0, followed by any
4019 labels in a switch statement. */
4022 gimple_switch_label (const_gimple gs
, unsigned index
)
4024 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4025 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1);
4026 return gimple_op (gs
, index
+ 1);
4029 /* Set the label number INDEX to LABEL. 0 is always the default label. */
4032 gimple_switch_set_label (gimple gs
, unsigned index
, tree label
)
4034 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
4035 gcc_gimple_checking_assert (gimple_num_ops (gs
) > index
+ 1
4036 && (label
== NULL_TREE
4037 || TREE_CODE (label
) == CASE_LABEL_EXPR
));
4038 gimple_set_op (gs
, index
+ 1, label
);
4041 /* Return the default label for a switch statement. */
4044 gimple_switch_default_label (const_gimple gs
)
4046 tree label
= gimple_switch_label (gs
, 0);
4047 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4051 /* Set the default label for a switch statement. */
4054 gimple_switch_set_default_label (gimple gs
, tree label
)
4056 gcc_checking_assert (!CASE_LOW (label
) && !CASE_HIGH (label
));
4057 gimple_switch_set_label (gs
, 0, label
);
4060 /* Return true if GS is a GIMPLE_DEBUG statement. */
4063 is_gimple_debug (const_gimple gs
)
4065 return gimple_code (gs
) == GIMPLE_DEBUG
;
4068 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
4071 gimple_debug_bind_p (const_gimple s
)
4073 if (is_gimple_debug (s
))
4074 return s
->subcode
== GIMPLE_DEBUG_BIND
;
4079 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
4082 gimple_debug_bind_get_var (gimple dbg
)
4084 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4085 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4086 return gimple_op (dbg
, 0);
4089 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
4093 gimple_debug_bind_get_value (gimple dbg
)
4095 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4096 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4097 return gimple_op (dbg
, 1);
4100 /* Return a pointer to the value bound to the variable in a
4101 GIMPLE_DEBUG bind statement. */
4103 static inline tree
*
4104 gimple_debug_bind_get_value_ptr (gimple dbg
)
4106 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4107 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4108 return gimple_op_ptr (dbg
, 1);
4111 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
4114 gimple_debug_bind_set_var (gimple dbg
, tree var
)
4116 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4117 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4118 gimple_set_op (dbg
, 0, var
);
4121 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
4125 gimple_debug_bind_set_value (gimple dbg
, tree value
)
4127 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4128 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4129 gimple_set_op (dbg
, 1, value
);
4132 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
4134 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
4136 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
4140 gimple_debug_bind_reset_value (gimple dbg
)
4142 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4143 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4144 gimple_set_op (dbg
, 1, GIMPLE_DEBUG_BIND_NOVALUE
);
4147 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
4151 gimple_debug_bind_has_value_p (gimple dbg
)
4153 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4154 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg
));
4155 return gimple_op (dbg
, 1) != GIMPLE_DEBUG_BIND_NOVALUE
;
4158 #undef GIMPLE_DEBUG_BIND_NOVALUE
4160 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
4163 gimple_debug_source_bind_p (const_gimple s
)
4165 if (is_gimple_debug (s
))
4166 return s
->subcode
== GIMPLE_DEBUG_SOURCE_BIND
;
4171 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
4174 gimple_debug_source_bind_get_var (gimple dbg
)
4176 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4177 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4178 return gimple_op (dbg
, 0);
4181 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
4185 gimple_debug_source_bind_get_value (gimple dbg
)
4187 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4188 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4189 return gimple_op (dbg
, 1);
4192 /* Return a pointer to the value bound to the variable in a
4193 GIMPLE_DEBUG source bind statement. */
4195 static inline tree
*
4196 gimple_debug_source_bind_get_value_ptr (gimple dbg
)
4198 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4199 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4200 return gimple_op_ptr (dbg
, 1);
4203 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
4206 gimple_debug_source_bind_set_var (gimple dbg
, tree var
)
4208 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4209 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4210 gimple_set_op (dbg
, 0, var
);
4213 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
4217 gimple_debug_source_bind_set_value (gimple dbg
, tree value
)
4219 GIMPLE_CHECK (dbg
, GIMPLE_DEBUG
);
4220 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg
));
4221 gimple_set_op (dbg
, 1, value
);
4224 /* Return the line number for EXPR, or return -1 if we have no line
4225 number information for it. */
4227 get_lineno (const_gimple stmt
)
4234 loc
= gimple_location (stmt
);
4235 if (loc
== UNKNOWN_LOCATION
)
4238 return LOCATION_LINE (loc
);
4241 /* Return a pointer to the body for the OMP statement GS. */
4243 static inline gimple_seq
*
4244 gimple_omp_body_ptr (gimple gs
)
4246 return &static_cast <gimple_statement_omp
*> (gs
)->body
;
4249 /* Return the body for the OMP statement GS. */
4251 static inline gimple_seq
4252 gimple_omp_body (gimple gs
)
4254 return *gimple_omp_body_ptr (gs
);
4257 /* Set BODY to be the body for the OMP statement GS. */
4260 gimple_omp_set_body (gimple gs
, gimple_seq body
)
4262 static_cast <gimple_statement_omp
*> (gs
)->body
= body
;
4266 /* Return the name associated with OMP_CRITICAL statement GS. */
4269 gimple_omp_critical_name (const_gimple gs
)
4271 const gimple_statement_omp_critical
*omp_critical_stmt
=
4272 as_a
<const gimple_statement_omp_critical
> (gs
);
4273 return omp_critical_stmt
->name
;
4277 /* Return a pointer to the name associated with OMP critical statement GS. */
4279 static inline tree
*
4280 gimple_omp_critical_name_ptr (gimple gs
)
4282 gimple_statement_omp_critical
*omp_critical_stmt
=
4283 as_a
<gimple_statement_omp_critical
> (gs
);
4284 return &omp_critical_stmt
->name
;
4288 /* Set NAME to be the name associated with OMP critical statement GS. */
4291 gimple_omp_critical_set_name (gimple gs
, tree name
)
4293 gimple_statement_omp_critical
*omp_critical_stmt
=
4294 as_a
<gimple_statement_omp_critical
> (gs
);
4295 omp_critical_stmt
->name
= name
;
4299 /* Return the kind of OMP for statemement. */
4302 gimple_omp_for_kind (const_gimple g
)
4304 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4305 return (gimple_omp_subcode (g
) & GF_OMP_FOR_KIND_MASK
);
4309 /* Set the OMP for kind. */
4312 gimple_omp_for_set_kind (gimple g
, int kind
)
4314 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4315 g
->subcode
= (g
->subcode
& ~GF_OMP_FOR_KIND_MASK
)
4316 | (kind
& GF_OMP_FOR_KIND_MASK
);
4320 /* Return true if OMP for statement G has the
4321 GF_OMP_FOR_COMBINED flag set. */
4324 gimple_omp_for_combined_p (const_gimple g
)
4326 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4327 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED
) != 0;
4331 /* Set the GF_OMP_FOR_COMBINED field in G depending on the boolean
4332 value of COMBINED_P. */
4335 gimple_omp_for_set_combined_p (gimple g
, bool combined_p
)
4337 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4339 g
->subcode
|= GF_OMP_FOR_COMBINED
;
4341 g
->subcode
&= ~GF_OMP_FOR_COMBINED
;
4345 /* Return true if OMP for statement G has the
4346 GF_OMP_FOR_COMBINED_INTO flag set. */
4349 gimple_omp_for_combined_into_p (const_gimple g
)
4351 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4352 return (gimple_omp_subcode (g
) & GF_OMP_FOR_COMBINED_INTO
) != 0;
4356 /* Set the GF_OMP_FOR_COMBINED_INTO field in G depending on the boolean
4357 value of COMBINED_P. */
4360 gimple_omp_for_set_combined_into_p (gimple g
, bool combined_p
)
4362 GIMPLE_CHECK (g
, GIMPLE_OMP_FOR
);
4364 g
->subcode
|= GF_OMP_FOR_COMBINED_INTO
;
4366 g
->subcode
&= ~GF_OMP_FOR_COMBINED_INTO
;
4370 /* Return the clauses associated with OMP_FOR GS. */
4373 gimple_omp_for_clauses (const_gimple gs
)
4375 const gimple_statement_omp_for
*omp_for_stmt
=
4376 as_a
<const gimple_statement_omp_for
> (gs
);
4377 return omp_for_stmt
->clauses
;
4381 /* Return a pointer to the OMP_FOR GS. */
4383 static inline tree
*
4384 gimple_omp_for_clauses_ptr (gimple gs
)
4386 gimple_statement_omp_for
*omp_for_stmt
=
4387 as_a
<gimple_statement_omp_for
> (gs
);
4388 return &omp_for_stmt
->clauses
;
4392 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
4395 gimple_omp_for_set_clauses (gimple gs
, tree clauses
)
4397 gimple_statement_omp_for
*omp_for_stmt
=
4398 as_a
<gimple_statement_omp_for
> (gs
);
4399 omp_for_stmt
->clauses
= clauses
;
4403 /* Get the collapse count of OMP_FOR GS. */
4405 static inline size_t
4406 gimple_omp_for_collapse (gimple gs
)
4408 gimple_statement_omp_for
*omp_for_stmt
=
4409 as_a
<gimple_statement_omp_for
> (gs
);
4410 return omp_for_stmt
->collapse
;
4414 /* Return the index variable for OMP_FOR GS. */
4417 gimple_omp_for_index (const_gimple gs
, size_t i
)
4419 const gimple_statement_omp_for
*omp_for_stmt
=
4420 as_a
<const gimple_statement_omp_for
> (gs
);
4421 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4422 return omp_for_stmt
->iter
[i
].index
;
4426 /* Return a pointer to the index variable for OMP_FOR GS. */
4428 static inline tree
*
4429 gimple_omp_for_index_ptr (gimple gs
, size_t i
)
4431 gimple_statement_omp_for
*omp_for_stmt
=
4432 as_a
<gimple_statement_omp_for
> (gs
);
4433 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4434 return &omp_for_stmt
->iter
[i
].index
;
4438 /* Set INDEX to be the index variable for OMP_FOR GS. */
4441 gimple_omp_for_set_index (gimple gs
, size_t i
, tree index
)
4443 gimple_statement_omp_for
*omp_for_stmt
=
4444 as_a
<gimple_statement_omp_for
> (gs
);
4445 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4446 omp_for_stmt
->iter
[i
].index
= index
;
4450 /* Return the initial value for OMP_FOR GS. */
4453 gimple_omp_for_initial (const_gimple gs
, size_t i
)
4455 const gimple_statement_omp_for
*omp_for_stmt
=
4456 as_a
<const gimple_statement_omp_for
> (gs
);
4457 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4458 return omp_for_stmt
->iter
[i
].initial
;
4462 /* Return a pointer to the initial value for OMP_FOR GS. */
4464 static inline tree
*
4465 gimple_omp_for_initial_ptr (gimple gs
, size_t i
)
4467 gimple_statement_omp_for
*omp_for_stmt
=
4468 as_a
<gimple_statement_omp_for
> (gs
);
4469 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4470 return &omp_for_stmt
->iter
[i
].initial
;
4474 /* Set INITIAL to be the initial value for OMP_FOR GS. */
4477 gimple_omp_for_set_initial (gimple gs
, size_t i
, tree initial
)
4479 gimple_statement_omp_for
*omp_for_stmt
=
4480 as_a
<gimple_statement_omp_for
> (gs
);
4481 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4482 omp_for_stmt
->iter
[i
].initial
= initial
;
4486 /* Return the final value for OMP_FOR GS. */
4489 gimple_omp_for_final (const_gimple gs
, size_t i
)
4491 const gimple_statement_omp_for
*omp_for_stmt
=
4492 as_a
<const gimple_statement_omp_for
> (gs
);
4493 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4494 return omp_for_stmt
->iter
[i
].final
;
4498 /* Return a pointer to the final value for OMP_FOR GS. */
4500 static inline tree
*
4501 gimple_omp_for_final_ptr (gimple gs
, size_t i
)
4503 gimple_statement_omp_for
*omp_for_stmt
=
4504 as_a
<gimple_statement_omp_for
> (gs
);
4505 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4506 return &omp_for_stmt
->iter
[i
].final
;
4510 /* Set FINAL to be the final value for OMP_FOR GS. */
4513 gimple_omp_for_set_final (gimple gs
, size_t i
, tree final
)
4515 gimple_statement_omp_for
*omp_for_stmt
=
4516 as_a
<gimple_statement_omp_for
> (gs
);
4517 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4518 omp_for_stmt
->iter
[i
].final
= final
;
4522 /* Return the increment value for OMP_FOR GS. */
4525 gimple_omp_for_incr (const_gimple gs
, size_t i
)
4527 const gimple_statement_omp_for
*omp_for_stmt
=
4528 as_a
<const gimple_statement_omp_for
> (gs
);
4529 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4530 return omp_for_stmt
->iter
[i
].incr
;
4534 /* Return a pointer to the increment value for OMP_FOR GS. */
4536 static inline tree
*
4537 gimple_omp_for_incr_ptr (gimple gs
, size_t i
)
4539 gimple_statement_omp_for
*omp_for_stmt
=
4540 as_a
<gimple_statement_omp_for
> (gs
);
4541 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4542 return &omp_for_stmt
->iter
[i
].incr
;
4546 /* Set INCR to be the increment value for OMP_FOR GS. */
4549 gimple_omp_for_set_incr (gimple gs
, size_t i
, tree incr
)
4551 gimple_statement_omp_for
*omp_for_stmt
=
4552 as_a
<gimple_statement_omp_for
> (gs
);
4553 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
4554 omp_for_stmt
->iter
[i
].incr
= incr
;
4558 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4559 statement GS starts. */
4561 static inline gimple_seq
*
4562 gimple_omp_for_pre_body_ptr (gimple gs
)
4564 gimple_statement_omp_for
*omp_for_stmt
=
4565 as_a
<gimple_statement_omp_for
> (gs
);
4566 return &omp_for_stmt
->pre_body
;
4570 /* Return the sequence of statements to execute before the OMP_FOR
4571 statement GS starts. */
4573 static inline gimple_seq
4574 gimple_omp_for_pre_body (gimple gs
)
4576 return *gimple_omp_for_pre_body_ptr (gs
);
4580 /* Set PRE_BODY to be the sequence of statements to execute before the
4581 OMP_FOR statement GS starts. */
4584 gimple_omp_for_set_pre_body (gimple gs
, gimple_seq pre_body
)
4586 gimple_statement_omp_for
*omp_for_stmt
=
4587 as_a
<gimple_statement_omp_for
> (gs
);
4588 omp_for_stmt
->pre_body
= pre_body
;
4592 /* Return the clauses associated with OMP_PARALLEL GS. */
4595 gimple_omp_parallel_clauses (const_gimple gs
)
4597 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4598 as_a
<const gimple_statement_omp_parallel
> (gs
);
4599 return omp_parallel_stmt
->clauses
;
4603 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4605 static inline tree
*
4606 gimple_omp_parallel_clauses_ptr (gimple gs
)
4608 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4609 as_a
<gimple_statement_omp_parallel
> (gs
);
4610 return &omp_parallel_stmt
->clauses
;
4614 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4618 gimple_omp_parallel_set_clauses (gimple gs
, tree clauses
)
4620 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4621 as_a
<gimple_statement_omp_parallel
> (gs
);
4622 omp_parallel_stmt
->clauses
= clauses
;
4626 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4629 gimple_omp_parallel_child_fn (const_gimple gs
)
4631 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4632 as_a
<const gimple_statement_omp_parallel
> (gs
);
4633 return omp_parallel_stmt
->child_fn
;
4636 /* Return a pointer to the child function used to hold the body of
4639 static inline tree
*
4640 gimple_omp_parallel_child_fn_ptr (gimple gs
)
4642 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4643 as_a
<gimple_statement_omp_parallel
> (gs
);
4644 return &omp_parallel_stmt
->child_fn
;
4648 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4651 gimple_omp_parallel_set_child_fn (gimple gs
, tree child_fn
)
4653 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4654 as_a
<gimple_statement_omp_parallel
> (gs
);
4655 omp_parallel_stmt
->child_fn
= child_fn
;
4659 /* Return the artificial argument used to send variables and values
4660 from the parent to the children threads in OMP_PARALLEL GS. */
4663 gimple_omp_parallel_data_arg (const_gimple gs
)
4665 const gimple_statement_omp_parallel
*omp_parallel_stmt
=
4666 as_a
<const gimple_statement_omp_parallel
> (gs
);
4667 return omp_parallel_stmt
->data_arg
;
4671 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4673 static inline tree
*
4674 gimple_omp_parallel_data_arg_ptr (gimple gs
)
4676 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4677 as_a
<gimple_statement_omp_parallel
> (gs
);
4678 return &omp_parallel_stmt
->data_arg
;
4682 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4685 gimple_omp_parallel_set_data_arg (gimple gs
, tree data_arg
)
4687 gimple_statement_omp_parallel
*omp_parallel_stmt
=
4688 as_a
<gimple_statement_omp_parallel
> (gs
);
4689 omp_parallel_stmt
->data_arg
= data_arg
;
4693 /* Return the clauses associated with OMP_TASK GS. */
4696 gimple_omp_task_clauses (const_gimple gs
)
4698 const gimple_statement_omp_task
*omp_task_stmt
=
4699 as_a
<const gimple_statement_omp_task
> (gs
);
4700 return omp_task_stmt
->clauses
;
4704 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4706 static inline tree
*
4707 gimple_omp_task_clauses_ptr (gimple gs
)
4709 gimple_statement_omp_task
*omp_task_stmt
=
4710 as_a
<gimple_statement_omp_task
> (gs
);
4711 return &omp_task_stmt
->clauses
;
4715 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4719 gimple_omp_task_set_clauses (gimple gs
, tree clauses
)
4721 gimple_statement_omp_task
*omp_task_stmt
=
4722 as_a
<gimple_statement_omp_task
> (gs
);
4723 omp_task_stmt
->clauses
= clauses
;
4727 /* Return the child function used to hold the body of OMP_TASK GS. */
4730 gimple_omp_task_child_fn (const_gimple gs
)
4732 const gimple_statement_omp_task
*omp_task_stmt
=
4733 as_a
<const gimple_statement_omp_task
> (gs
);
4734 return omp_task_stmt
->child_fn
;
4737 /* Return a pointer to the child function used to hold the body of
4740 static inline tree
*
4741 gimple_omp_task_child_fn_ptr (gimple gs
)
4743 gimple_statement_omp_task
*omp_task_stmt
=
4744 as_a
<gimple_statement_omp_task
> (gs
);
4745 return &omp_task_stmt
->child_fn
;
4749 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4752 gimple_omp_task_set_child_fn (gimple gs
, tree child_fn
)
4754 gimple_statement_omp_task
*omp_task_stmt
=
4755 as_a
<gimple_statement_omp_task
> (gs
);
4756 omp_task_stmt
->child_fn
= child_fn
;
4760 /* Return the artificial argument used to send variables and values
4761 from the parent to the children threads in OMP_TASK GS. */
4764 gimple_omp_task_data_arg (const_gimple gs
)
4766 const gimple_statement_omp_task
*omp_task_stmt
=
4767 as_a
<const gimple_statement_omp_task
> (gs
);
4768 return omp_task_stmt
->data_arg
;
4772 /* Return a pointer to the data argument for OMP_TASK GS. */
4774 static inline tree
*
4775 gimple_omp_task_data_arg_ptr (gimple gs
)
4777 gimple_statement_omp_task
*omp_task_stmt
=
4778 as_a
<gimple_statement_omp_task
> (gs
);
4779 return &omp_task_stmt
->data_arg
;
4783 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4786 gimple_omp_task_set_data_arg (gimple gs
, tree data_arg
)
4788 gimple_statement_omp_task
*omp_task_stmt
=
4789 as_a
<gimple_statement_omp_task
> (gs
);
4790 omp_task_stmt
->data_arg
= data_arg
;
4794 /* Return the clauses associated with OMP_TASK GS. */
4797 gimple_omp_taskreg_clauses (const_gimple gs
)
4799 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4800 as_a
<const gimple_statement_omp_taskreg
> (gs
);
4801 return omp_taskreg_stmt
->clauses
;
4805 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4807 static inline tree
*
4808 gimple_omp_taskreg_clauses_ptr (gimple gs
)
4810 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4811 as_a
<gimple_statement_omp_taskreg
> (gs
);
4812 return &omp_taskreg_stmt
->clauses
;
4816 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4820 gimple_omp_taskreg_set_clauses (gimple gs
, tree clauses
)
4822 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4823 as_a
<gimple_statement_omp_taskreg
> (gs
);
4824 omp_taskreg_stmt
->clauses
= clauses
;
4828 /* Return the child function used to hold the body of OMP_TASK GS. */
4831 gimple_omp_taskreg_child_fn (const_gimple gs
)
4833 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4834 as_a
<const gimple_statement_omp_taskreg
> (gs
);
4835 return omp_taskreg_stmt
->child_fn
;
4838 /* Return a pointer to the child function used to hold the body of
4841 static inline tree
*
4842 gimple_omp_taskreg_child_fn_ptr (gimple gs
)
4844 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4845 as_a
<gimple_statement_omp_taskreg
> (gs
);
4846 return &omp_taskreg_stmt
->child_fn
;
4850 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4853 gimple_omp_taskreg_set_child_fn (gimple gs
, tree child_fn
)
4855 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4856 as_a
<gimple_statement_omp_taskreg
> (gs
);
4857 omp_taskreg_stmt
->child_fn
= child_fn
;
4861 /* Return the artificial argument used to send variables and values
4862 from the parent to the children threads in OMP_TASK GS. */
4865 gimple_omp_taskreg_data_arg (const_gimple gs
)
4867 const gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4868 as_a
<const gimple_statement_omp_taskreg
> (gs
);
4869 return omp_taskreg_stmt
->data_arg
;
4873 /* Return a pointer to the data argument for OMP_TASK GS. */
4875 static inline tree
*
4876 gimple_omp_taskreg_data_arg_ptr (gimple gs
)
4878 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4879 as_a
<gimple_statement_omp_taskreg
> (gs
);
4880 return &omp_taskreg_stmt
->data_arg
;
4884 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4887 gimple_omp_taskreg_set_data_arg (gimple gs
, tree data_arg
)
4889 gimple_statement_omp_taskreg
*omp_taskreg_stmt
=
4890 as_a
<gimple_statement_omp_taskreg
> (gs
);
4891 omp_taskreg_stmt
->data_arg
= data_arg
;
4895 /* Return the copy function used to hold the body of OMP_TASK GS. */
4898 gimple_omp_task_copy_fn (const_gimple gs
)
4900 const gimple_statement_omp_task
*omp_task_stmt
=
4901 as_a
<const gimple_statement_omp_task
> (gs
);
4902 return omp_task_stmt
->copy_fn
;
4905 /* Return a pointer to the copy function used to hold the body of
4908 static inline tree
*
4909 gimple_omp_task_copy_fn_ptr (gimple gs
)
4911 gimple_statement_omp_task
*omp_task_stmt
=
4912 as_a
<gimple_statement_omp_task
> (gs
);
4913 return &omp_task_stmt
->copy_fn
;
4917 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
4920 gimple_omp_task_set_copy_fn (gimple gs
, tree copy_fn
)
4922 gimple_statement_omp_task
*omp_task_stmt
=
4923 as_a
<gimple_statement_omp_task
> (gs
);
4924 omp_task_stmt
->copy_fn
= copy_fn
;
4928 /* Return size of the data block in bytes in OMP_TASK GS. */
4931 gimple_omp_task_arg_size (const_gimple gs
)
4933 const gimple_statement_omp_task
*omp_task_stmt
=
4934 as_a
<const gimple_statement_omp_task
> (gs
);
4935 return omp_task_stmt
->arg_size
;
4939 /* Return a pointer to the data block size for OMP_TASK GS. */
4941 static inline tree
*
4942 gimple_omp_task_arg_size_ptr (gimple gs
)
4944 gimple_statement_omp_task
*omp_task_stmt
=
4945 as_a
<gimple_statement_omp_task
> (gs
);
4946 return &omp_task_stmt
->arg_size
;
4950 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
4953 gimple_omp_task_set_arg_size (gimple gs
, tree arg_size
)
4955 gimple_statement_omp_task
*omp_task_stmt
=
4956 as_a
<gimple_statement_omp_task
> (gs
);
4957 omp_task_stmt
->arg_size
= arg_size
;
4961 /* Return align of the data block in bytes in OMP_TASK GS. */
4964 gimple_omp_task_arg_align (const_gimple gs
)
4966 const gimple_statement_omp_task
*omp_task_stmt
=
4967 as_a
<const gimple_statement_omp_task
> (gs
);
4968 return omp_task_stmt
->arg_align
;
4972 /* Return a pointer to the data block align for OMP_TASK GS. */
4974 static inline tree
*
4975 gimple_omp_task_arg_align_ptr (gimple gs
)
4977 gimple_statement_omp_task
*omp_task_stmt
=
4978 as_a
<gimple_statement_omp_task
> (gs
);
4979 return &omp_task_stmt
->arg_align
;
4983 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
4986 gimple_omp_task_set_arg_align (gimple gs
, tree arg_align
)
4988 gimple_statement_omp_task
*omp_task_stmt
=
4989 as_a
<gimple_statement_omp_task
> (gs
);
4990 omp_task_stmt
->arg_align
= arg_align
;
4994 /* Return the clauses associated with OMP_SINGLE GS. */
4997 gimple_omp_single_clauses (const_gimple gs
)
4999 const gimple_statement_omp_single
*omp_single_stmt
=
5000 as_a
<const gimple_statement_omp_single
> (gs
);
5001 return omp_single_stmt
->clauses
;
5005 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
5007 static inline tree
*
5008 gimple_omp_single_clauses_ptr (gimple gs
)
5010 gimple_statement_omp_single
*omp_single_stmt
=
5011 as_a
<gimple_statement_omp_single
> (gs
);
5012 return &omp_single_stmt
->clauses
;
5016 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
5019 gimple_omp_single_set_clauses (gimple gs
, tree clauses
)
5021 gimple_statement_omp_single
*omp_single_stmt
=
5022 as_a
<gimple_statement_omp_single
> (gs
);
5023 omp_single_stmt
->clauses
= clauses
;
5027 /* Return the clauses associated with OMP_TARGET GS. */
5030 gimple_omp_target_clauses (const_gimple gs
)
5032 const gimple_statement_omp_target
*omp_target_stmt
=
5033 as_a
<const gimple_statement_omp_target
> (gs
);
5034 return omp_target_stmt
->clauses
;
5038 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
5040 static inline tree
*
5041 gimple_omp_target_clauses_ptr (gimple gs
)
5043 gimple_statement_omp_target
*omp_target_stmt
=
5044 as_a
<gimple_statement_omp_target
> (gs
);
5045 return &omp_target_stmt
->clauses
;
5049 /* Set CLAUSES to be the clauses associated with OMP_TARGET GS. */
5052 gimple_omp_target_set_clauses (gimple gs
, tree clauses
)
5054 gimple_statement_omp_target
*omp_target_stmt
=
5055 as_a
<gimple_statement_omp_target
> (gs
);
5056 omp_target_stmt
->clauses
= clauses
;
5060 /* Return the kind of OMP target statemement. */
5063 gimple_omp_target_kind (const_gimple g
)
5065 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
5066 return (gimple_omp_subcode (g
) & GF_OMP_TARGET_KIND_MASK
);
5070 /* Set the OMP target kind. */
5073 gimple_omp_target_set_kind (gimple g
, int kind
)
5075 GIMPLE_CHECK (g
, GIMPLE_OMP_TARGET
);
5076 g
->subcode
= (g
->subcode
& ~GF_OMP_TARGET_KIND_MASK
)
5077 | (kind
& GF_OMP_TARGET_KIND_MASK
);
5081 /* Return the child function used to hold the body of OMP_TARGET GS. */
5084 gimple_omp_target_child_fn (const_gimple gs
)
5086 const gimple_statement_omp_target
*omp_target_stmt
=
5087 as_a
<const gimple_statement_omp_target
> (gs
);
5088 return omp_target_stmt
->child_fn
;
5091 /* Return a pointer to the child function used to hold the body of
5094 static inline tree
*
5095 gimple_omp_target_child_fn_ptr (gimple gs
)
5097 gimple_statement_omp_target
*omp_target_stmt
=
5098 as_a
<gimple_statement_omp_target
> (gs
);
5099 return &omp_target_stmt
->child_fn
;
5103 /* Set CHILD_FN to be the child function for OMP_TARGET GS. */
5106 gimple_omp_target_set_child_fn (gimple gs
, tree child_fn
)
5108 gimple_statement_omp_target
*omp_target_stmt
=
5109 as_a
<gimple_statement_omp_target
> (gs
);
5110 omp_target_stmt
->child_fn
= child_fn
;
5114 /* Return the artificial argument used to send variables and values
5115 from the parent to the children threads in OMP_TARGET GS. */
5118 gimple_omp_target_data_arg (const_gimple gs
)
5120 const gimple_statement_omp_target
*omp_target_stmt
=
5121 as_a
<const gimple_statement_omp_target
> (gs
);
5122 return omp_target_stmt
->data_arg
;
5126 /* Return a pointer to the data argument for OMP_TARGET GS. */
5128 static inline tree
*
5129 gimple_omp_target_data_arg_ptr (gimple gs
)
5131 gimple_statement_omp_target
*omp_target_stmt
=
5132 as_a
<gimple_statement_omp_target
> (gs
);
5133 return &omp_target_stmt
->data_arg
;
5137 /* Set DATA_ARG to be the data argument for OMP_TARGET GS. */
5140 gimple_omp_target_set_data_arg (gimple gs
, tree data_arg
)
5142 gimple_statement_omp_target
*omp_target_stmt
=
5143 as_a
<gimple_statement_omp_target
> (gs
);
5144 omp_target_stmt
->data_arg
= data_arg
;
5148 /* Return the clauses associated with OMP_TEAMS GS. */
5151 gimple_omp_teams_clauses (const_gimple gs
)
5153 const gimple_statement_omp_teams
*omp_teams_stmt
=
5154 as_a
<const gimple_statement_omp_teams
> (gs
);
5155 return omp_teams_stmt
->clauses
;
5159 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
5161 static inline tree
*
5162 gimple_omp_teams_clauses_ptr (gimple gs
)
5164 gimple_statement_omp_teams
*omp_teams_stmt
=
5165 as_a
<gimple_statement_omp_teams
> (gs
);
5166 return &omp_teams_stmt
->clauses
;
5170 /* Set CLAUSES to be the clauses associated with OMP_TEAMS GS. */
5173 gimple_omp_teams_set_clauses (gimple gs
, tree clauses
)
5175 gimple_statement_omp_teams
*omp_teams_stmt
=
5176 as_a
<gimple_statement_omp_teams
> (gs
);
5177 omp_teams_stmt
->clauses
= clauses
;
5181 /* Return the clauses associated with OMP_SECTIONS GS. */
5184 gimple_omp_sections_clauses (const_gimple gs
)
5186 const gimple_statement_omp_sections
*omp_sections_stmt
=
5187 as_a
<const gimple_statement_omp_sections
> (gs
);
5188 return omp_sections_stmt
->clauses
;
5192 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
5194 static inline tree
*
5195 gimple_omp_sections_clauses_ptr (gimple gs
)
5197 gimple_statement_omp_sections
*omp_sections_stmt
=
5198 as_a
<gimple_statement_omp_sections
> (gs
);
5199 return &omp_sections_stmt
->clauses
;
5203 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
5207 gimple_omp_sections_set_clauses (gimple gs
, tree clauses
)
5209 gimple_statement_omp_sections
*omp_sections_stmt
=
5210 as_a
<gimple_statement_omp_sections
> (gs
);
5211 omp_sections_stmt
->clauses
= clauses
;
5215 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
5219 gimple_omp_sections_control (const_gimple gs
)
5221 const gimple_statement_omp_sections
*omp_sections_stmt
=
5222 as_a
<const gimple_statement_omp_sections
> (gs
);
5223 return omp_sections_stmt
->control
;
5227 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
5230 static inline tree
*
5231 gimple_omp_sections_control_ptr (gimple gs
)
5233 gimple_statement_omp_sections
*omp_sections_stmt
=
5234 as_a
<gimple_statement_omp_sections
> (gs
);
5235 return &omp_sections_stmt
->control
;
5239 /* Set CONTROL to be the set of clauses associated with the
5240 GIMPLE_OMP_SECTIONS in GS. */
5243 gimple_omp_sections_set_control (gimple gs
, tree control
)
5245 gimple_statement_omp_sections
*omp_sections_stmt
=
5246 as_a
<gimple_statement_omp_sections
> (gs
);
5247 omp_sections_stmt
->control
= control
;
5251 /* Set COND to be the condition code for OMP_FOR GS. */
5254 gimple_omp_for_set_cond (gimple gs
, size_t i
, enum tree_code cond
)
5256 gimple_statement_omp_for
*omp_for_stmt
=
5257 as_a
<gimple_statement_omp_for
> (gs
);
5258 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond
) == tcc_comparison
5259 && i
< omp_for_stmt
->collapse
);
5260 omp_for_stmt
->iter
[i
].cond
= cond
;
5264 /* Return the condition code associated with OMP_FOR GS. */
5266 static inline enum tree_code
5267 gimple_omp_for_cond (const_gimple gs
, size_t i
)
5269 const gimple_statement_omp_for
*omp_for_stmt
=
5270 as_a
<const gimple_statement_omp_for
> (gs
);
5271 gcc_gimple_checking_assert (i
< omp_for_stmt
->collapse
);
5272 return omp_for_stmt
->iter
[i
].cond
;
5276 /* Set the value being stored in an atomic store. */
5279 gimple_omp_atomic_store_set_val (gimple g
, tree val
)
5281 gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5282 as_a
<gimple_statement_omp_atomic_store
> (g
);
5283 omp_atomic_store_stmt
->val
= val
;
5287 /* Return the value being stored in an atomic store. */
5290 gimple_omp_atomic_store_val (const_gimple g
)
5292 const gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5293 as_a
<const gimple_statement_omp_atomic_store
> (g
);
5294 return omp_atomic_store_stmt
->val
;
5298 /* Return a pointer to the value being stored in an atomic store. */
5300 static inline tree
*
5301 gimple_omp_atomic_store_val_ptr (gimple g
)
5303 gimple_statement_omp_atomic_store
*omp_atomic_store_stmt
=
5304 as_a
<gimple_statement_omp_atomic_store
> (g
);
5305 return &omp_atomic_store_stmt
->val
;
5309 /* Set the LHS of an atomic load. */
5312 gimple_omp_atomic_load_set_lhs (gimple g
, tree lhs
)
5314 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5315 as_a
<gimple_statement_omp_atomic_load
> (g
);
5316 omp_atomic_load_stmt
->lhs
= lhs
;
5320 /* Get the LHS of an atomic load. */
5323 gimple_omp_atomic_load_lhs (const_gimple g
)
5325 const gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5326 as_a
<const gimple_statement_omp_atomic_load
> (g
);
5327 return omp_atomic_load_stmt
->lhs
;
5331 /* Return a pointer to the LHS of an atomic load. */
5333 static inline tree
*
5334 gimple_omp_atomic_load_lhs_ptr (gimple g
)
5336 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5337 as_a
<gimple_statement_omp_atomic_load
> (g
);
5338 return &omp_atomic_load_stmt
->lhs
;
5342 /* Set the RHS of an atomic load. */
5345 gimple_omp_atomic_load_set_rhs (gimple g
, tree rhs
)
5347 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5348 as_a
<gimple_statement_omp_atomic_load
> (g
);
5349 omp_atomic_load_stmt
->rhs
= rhs
;
5353 /* Get the RHS of an atomic load. */
5356 gimple_omp_atomic_load_rhs (const_gimple g
)
5358 const gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5359 as_a
<const gimple_statement_omp_atomic_load
> (g
);
5360 return omp_atomic_load_stmt
->rhs
;
5364 /* Return a pointer to the RHS of an atomic load. */
5366 static inline tree
*
5367 gimple_omp_atomic_load_rhs_ptr (gimple g
)
5369 gimple_statement_omp_atomic_load
*omp_atomic_load_stmt
=
5370 as_a
<gimple_statement_omp_atomic_load
> (g
);
5371 return &omp_atomic_load_stmt
->rhs
;
5375 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5378 gimple_omp_continue_control_def (const_gimple g
)
5380 const gimple_statement_omp_continue
*omp_continue_stmt
=
5381 as_a
<const gimple_statement_omp_continue
> (g
);
5382 return omp_continue_stmt
->control_def
;
5385 /* The same as above, but return the address. */
5387 static inline tree
*
5388 gimple_omp_continue_control_def_ptr (gimple g
)
5390 gimple_statement_omp_continue
*omp_continue_stmt
=
5391 as_a
<gimple_statement_omp_continue
> (g
);
5392 return &omp_continue_stmt
->control_def
;
5395 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5398 gimple_omp_continue_set_control_def (gimple g
, tree def
)
5400 gimple_statement_omp_continue
*omp_continue_stmt
=
5401 as_a
<gimple_statement_omp_continue
> (g
);
5402 omp_continue_stmt
->control_def
= def
;
5406 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5409 gimple_omp_continue_control_use (const_gimple g
)
5411 const gimple_statement_omp_continue
*omp_continue_stmt
=
5412 as_a
<const gimple_statement_omp_continue
> (g
);
5413 return omp_continue_stmt
->control_use
;
5417 /* The same as above, but return the address. */
5419 static inline tree
*
5420 gimple_omp_continue_control_use_ptr (gimple g
)
5422 gimple_statement_omp_continue
*omp_continue_stmt
=
5423 as_a
<gimple_statement_omp_continue
> (g
);
5424 return &omp_continue_stmt
->control_use
;
5428 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5431 gimple_omp_continue_set_control_use (gimple g
, tree use
)
5433 gimple_statement_omp_continue
*omp_continue_stmt
=
5434 as_a
<gimple_statement_omp_continue
> (g
);
5435 omp_continue_stmt
->control_use
= use
;
5438 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
5440 static inline gimple_seq
*
5441 gimple_transaction_body_ptr (gimple gs
)
5443 gimple_statement_transaction
*transaction_stmt
=
5444 as_a
<gimple_statement_transaction
> (gs
);
5445 return &transaction_stmt
->body
;
5448 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
5450 static inline gimple_seq
5451 gimple_transaction_body (gimple gs
)
5453 return *gimple_transaction_body_ptr (gs
);
5456 /* Return the label associated with a GIMPLE_TRANSACTION. */
5459 gimple_transaction_label (const_gimple gs
)
5461 const gimple_statement_transaction
*transaction_stmt
=
5462 as_a
<const gimple_statement_transaction
> (gs
);
5463 return transaction_stmt
->label
;
5466 static inline tree
*
5467 gimple_transaction_label_ptr (gimple gs
)
5469 gimple_statement_transaction
*transaction_stmt
=
5470 as_a
<gimple_statement_transaction
> (gs
);
5471 return &transaction_stmt
->label
;
5474 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
5476 static inline unsigned int
5477 gimple_transaction_subcode (const_gimple gs
)
5479 GIMPLE_CHECK (gs
, GIMPLE_TRANSACTION
);
5483 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
5486 gimple_transaction_set_body (gimple gs
, gimple_seq body
)
5488 gimple_statement_transaction
*transaction_stmt
=
5489 as_a
<gimple_statement_transaction
> (gs
);
5490 transaction_stmt
->body
= body
;
5493 /* Set the label associated with a GIMPLE_TRANSACTION. */
5496 gimple_transaction_set_label (gimple gs
, tree label
)
5498 gimple_statement_transaction
*transaction_stmt
=
5499 as_a
<gimple_statement_transaction
> (gs
);
5500 transaction_stmt
->label
= label
;
5503 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
5506 gimple_transaction_set_subcode (gimple gs
, unsigned int subcode
)
5508 GIMPLE_CHECK (gs
, GIMPLE_TRANSACTION
);
5509 gs
->subcode
= subcode
;
5513 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
5515 static inline tree
*
5516 gimple_return_retval_ptr (const_gimple gs
)
5518 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5519 return gimple_op_ptr (gs
, 0);
5522 /* Return the return value for GIMPLE_RETURN GS. */
5525 gimple_return_retval (const_gimple gs
)
5527 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5528 return gimple_op (gs
, 0);
5532 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
5535 gimple_return_set_retval (gimple gs
, tree retval
)
5537 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5538 gimple_set_op (gs
, 0, retval
);
5542 /* Return the return bounds for GIMPLE_RETURN GS. */
5545 gimple_return_retbnd (const_gimple gs
)
5547 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5548 return gimple_op (gs
, 1);
5552 /* Set RETVAL to be the return bounds for GIMPLE_RETURN GS. */
5555 gimple_return_set_retbnd (gimple gs
, tree retval
)
5557 GIMPLE_CHECK (gs
, GIMPLE_RETURN
);
5558 gimple_set_op (gs
, 1, retval
);
5562 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
5564 #define CASE_GIMPLE_OMP \
5565 case GIMPLE_OMP_PARALLEL: \
5566 case GIMPLE_OMP_TASK: \
5567 case GIMPLE_OMP_FOR: \
5568 case GIMPLE_OMP_SECTIONS: \
5569 case GIMPLE_OMP_SECTIONS_SWITCH: \
5570 case GIMPLE_OMP_SINGLE: \
5571 case GIMPLE_OMP_TARGET: \
5572 case GIMPLE_OMP_TEAMS: \
5573 case GIMPLE_OMP_SECTION: \
5574 case GIMPLE_OMP_MASTER: \
5575 case GIMPLE_OMP_TASKGROUP: \
5576 case GIMPLE_OMP_ORDERED: \
5577 case GIMPLE_OMP_CRITICAL: \
5578 case GIMPLE_OMP_RETURN: \
5579 case GIMPLE_OMP_ATOMIC_LOAD: \
5580 case GIMPLE_OMP_ATOMIC_STORE: \
5581 case GIMPLE_OMP_CONTINUE
5584 is_gimple_omp (const_gimple stmt
)
5586 switch (gimple_code (stmt
))
5596 /* Returns TRUE if statement G is a GIMPLE_NOP. */
5599 gimple_nop_p (const_gimple g
)
5601 return gimple_code (g
) == GIMPLE_NOP
;
5605 /* Return true if GS is a GIMPLE_RESX. */
5608 is_gimple_resx (const_gimple gs
)
5610 return gimple_code (gs
) == GIMPLE_RESX
;
5613 /* Return the predictor of GIMPLE_PREDICT statement GS. */
5615 static inline enum br_predictor
5616 gimple_predict_predictor (gimple gs
)
5618 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5619 return (enum br_predictor
) (gs
->subcode
& ~GF_PREDICT_TAKEN
);
5623 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
5626 gimple_predict_set_predictor (gimple gs
, enum br_predictor predictor
)
5628 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5629 gs
->subcode
= (gs
->subcode
& GF_PREDICT_TAKEN
)
5630 | (unsigned) predictor
;
5634 /* Return the outcome of GIMPLE_PREDICT statement GS. */
5636 static inline enum prediction
5637 gimple_predict_outcome (gimple gs
)
5639 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5640 return (gs
->subcode
& GF_PREDICT_TAKEN
) ? TAKEN
: NOT_TAKEN
;
5644 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
5647 gimple_predict_set_outcome (gimple gs
, enum prediction outcome
)
5649 GIMPLE_CHECK (gs
, GIMPLE_PREDICT
);
5650 if (outcome
== TAKEN
)
5651 gs
->subcode
|= GF_PREDICT_TAKEN
;
5653 gs
->subcode
&= ~GF_PREDICT_TAKEN
;
5657 /* Return the type of the main expression computed by STMT. Return
5658 void_type_node if the statement computes nothing. */
5661 gimple_expr_type (const_gimple stmt
)
5663 enum gimple_code code
= gimple_code (stmt
);
5665 if (code
== GIMPLE_ASSIGN
|| code
== GIMPLE_CALL
)
5668 /* In general we want to pass out a type that can be substituted
5669 for both the RHS and the LHS types if there is a possibly
5670 useless conversion involved. That means returning the
5671 original RHS type as far as we can reconstruct it. */
5672 if (code
== GIMPLE_CALL
)
5673 type
= gimple_call_return_type (stmt
);
5675 switch (gimple_assign_rhs_code (stmt
))
5677 case POINTER_PLUS_EXPR
:
5678 type
= TREE_TYPE (gimple_assign_rhs1 (stmt
));
5682 /* As fallback use the type of the LHS. */
5683 type
= TREE_TYPE (gimple_get_lhs (stmt
));
5688 else if (code
== GIMPLE_COND
)
5689 return boolean_type_node
;
5691 return void_type_node
;
5694 /* Enum and arrays used for allocation stats. Keep in sync with
5695 gimple.c:gimple_alloc_kind_names. */
5696 enum gimple_alloc_kind
5698 gimple_alloc_kind_assign
, /* Assignments. */
5699 gimple_alloc_kind_phi
, /* PHI nodes. */
5700 gimple_alloc_kind_cond
, /* Conditionals. */
5701 gimple_alloc_kind_rest
, /* Everything else. */
5702 gimple_alloc_kind_all
5705 extern int gimple_alloc_counts
[];
5706 extern int gimple_alloc_sizes
[];
5708 /* Return the allocation kind for a given stmt CODE. */
5709 static inline enum gimple_alloc_kind
5710 gimple_alloc_kind (enum gimple_code code
)
5715 return gimple_alloc_kind_assign
;
5717 return gimple_alloc_kind_phi
;
5719 return gimple_alloc_kind_cond
;
5721 return gimple_alloc_kind_rest
;
5725 /* Return true if a location should not be emitted for this statement
5726 by annotate_all_with_location. */
5729 gimple_do_not_emit_location_p (gimple g
)
5731 return gimple_plf (g
, GF_PLF_1
);
5734 /* Mark statement G so a location will not be emitted by
5735 annotate_one_with_location. */
5738 gimple_set_do_not_emit_location (gimple g
)
5740 /* The PLF flags are initialized to 0 when a new tuple is created,
5741 so no need to initialize it anywhere. */
5742 gimple_set_plf (g
, GF_PLF_1
, true);
5746 /* Macros for showing usage statistics. */
5747 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
5749 : ((x) < 1024*1024*10 \
5751 : (x) / (1024*1024))))
5753 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
5755 #endif /* GCC_GIMPLE_H */