Document HLE / RTM intrinsics
[official-gcc.git] / gcc / gimple.h
blob1bbd7d76a11ad83e9ef7568069a2e99db5a511e1
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
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #ifndef GCC_GIMPLE_H
23 #define GCC_GIMPLE_H
25 #include "pointer-set.h"
26 #include "vec.h"
27 #include "ggc.h"
28 #include "basic-block.h"
29 #include "tree.h"
30 #include "tree-ssa-operands.h"
31 #include "tree-ssa-alias.h"
32 #include "internal-fn.h"
34 typedef gimple gimple_seq_node;
36 /* For each block, the PHI nodes that need to be rewritten are stored into
37 these vectors. */
38 typedef vec<gimple> gimple_vec;
40 enum gimple_code {
41 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
42 #include "gimple.def"
43 #undef DEFGSCODE
44 LAST_AND_UNUSED_GIMPLE_CODE
47 extern const char *const gimple_code_name[];
48 extern const unsigned char gimple_rhs_class_table[];
50 /* Error out if a gimple tuple is addressed incorrectly. */
51 #if defined ENABLE_GIMPLE_CHECKING
52 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
53 extern void gimple_check_failed (const_gimple, const char *, int, \
54 const char *, enum gimple_code, \
55 enum tree_code) ATTRIBUTE_NORETURN;
57 #define GIMPLE_CHECK(GS, CODE) \
58 do { \
59 const_gimple __gs = (GS); \
60 if (gimple_code (__gs) != (CODE)) \
61 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
62 (CODE), ERROR_MARK); \
63 } while (0)
64 #else /* not ENABLE_GIMPLE_CHECKING */
65 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
66 #define GIMPLE_CHECK(GS, CODE) (void)0
67 #endif
69 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
70 get_gimple_rhs_class. */
71 enum gimple_rhs_class
73 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
74 GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
75 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
76 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
77 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
78 name, a _DECL, a _REF, etc. */
81 /* Specific flags for individual GIMPLE statements. These flags are
82 always stored in gimple_statement_base.subcode and they may only be
83 defined for statement codes that do not use sub-codes.
85 Values for the masks can overlap as long as the overlapping values
86 are never used in the same statement class.
88 The maximum mask value that can be defined is 1 << 15 (i.e., each
89 statement code can hold up to 16 bitflags).
91 Keep this list sorted. */
92 enum gf_mask {
93 GF_ASM_INPUT = 1 << 0,
94 GF_ASM_VOLATILE = 1 << 1,
95 GF_CALL_FROM_THUNK = 1 << 0,
96 GF_CALL_RETURN_SLOT_OPT = 1 << 1,
97 GF_CALL_TAILCALL = 1 << 2,
98 GF_CALL_VA_ARG_PACK = 1 << 3,
99 GF_CALL_NOTHROW = 1 << 4,
100 GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
101 GF_CALL_INTERNAL = 1 << 6,
102 GF_OMP_PARALLEL_COMBINED = 1 << 0,
104 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
105 a thread synchronization via some sort of barrier. The exact barrier
106 that would otherwise be emitted is dependent on the OMP statement with
107 which this return is associated. */
108 GF_OMP_RETURN_NOWAIT = 1 << 0,
110 GF_OMP_SECTION_LAST = 1 << 0,
111 GF_OMP_ATOMIC_NEED_VALUE = 1 << 0,
112 GF_PREDICT_TAKEN = 1 << 15
115 /* Currently, there are only two types of gimple debug stmt. Others are
116 envisioned, for example, to enable the generation of is_stmt notes
117 in line number information, to mark sequence points, etc. This
118 subcode is to be used to tell them apart. */
119 enum gimple_debug_subcode {
120 GIMPLE_DEBUG_BIND = 0,
121 GIMPLE_DEBUG_SOURCE_BIND = 1
124 /* Masks for selecting a pass local flag (PLF) to work on. These
125 masks are used by gimple_set_plf and gimple_plf. */
126 enum plf_mask {
127 GF_PLF_1 = 1 << 0,
128 GF_PLF_2 = 1 << 1
131 /* Iterator object for GIMPLE statement sequences. */
133 typedef struct
135 /* Sequence node holding the current statement. */
136 gimple_seq_node ptr;
138 /* Sequence and basic block holding the statement. These fields
139 are necessary to handle edge cases such as when statement is
140 added to an empty basic block or when the last statement of a
141 block/sequence is removed. */
142 gimple_seq *seq;
143 basic_block bb;
144 } gimple_stmt_iterator;
147 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
148 are for 64 bit hosts. */
150 struct GTY((chain_next ("%h.next"))) gimple_statement_base {
151 /* [ WORD 1 ]
152 Main identifying code for a tuple. */
153 ENUM_BITFIELD(gimple_code) code : 8;
155 /* Nonzero if a warning should not be emitted on this tuple. */
156 unsigned int no_warning : 1;
158 /* Nonzero if this tuple has been visited. Passes are responsible
159 for clearing this bit before using it. */
160 unsigned int visited : 1;
162 /* Nonzero if this tuple represents a non-temporal move. */
163 unsigned int nontemporal_move : 1;
165 /* Pass local flags. These flags are free for any pass to use as
166 they see fit. Passes should not assume that these flags contain
167 any useful value when the pass starts. Any initial state that
168 the pass requires should be set on entry to the pass. See
169 gimple_set_plf and gimple_plf for usage. */
170 unsigned int plf : 2;
172 /* Nonzero if this statement has been modified and needs to have its
173 operands rescanned. */
174 unsigned modified : 1;
176 /* Nonzero if this statement contains volatile operands. */
177 unsigned has_volatile_ops : 1;
179 /* The SUBCODE field can be used for tuple-specific flags for tuples
180 that do not require subcodes. Note that SUBCODE should be at
181 least as wide as tree codes, as several tuples store tree codes
182 in there. */
183 unsigned int subcode : 16;
185 /* UID of this statement. This is used by passes that want to
186 assign IDs to statements. It must be assigned and used by each
187 pass. By default it should be assumed to contain garbage. */
188 unsigned uid;
190 /* [ WORD 2 ]
191 Locus information for debug info. */
192 location_t location;
194 /* Number of operands in this tuple. */
195 unsigned num_ops;
197 /* [ WORD 3 ]
198 Basic block holding this statement. */
199 basic_block bb;
201 /* [ WORD 4-5 ]
202 Linked lists of gimple statements. The next pointers form
203 a NULL terminated list, the prev pointers are a cyclic list.
204 A gimple statement is hence also a double-ended list of
205 statements, with the pointer itself being the first element,
206 and the prev pointer being the last. */
207 gimple next;
208 gimple GTY((skip)) prev;
212 /* Base structure for tuples with operands. */
214 struct GTY(()) gimple_statement_with_ops_base
216 /* [ WORD 1-6 ] */
217 struct gimple_statement_base gsbase;
219 /* [ WORD 7 ]
220 SSA operand vectors. NOTE: It should be possible to
221 amalgamate these vectors with the operand vector OP. However,
222 the SSA operand vectors are organized differently and contain
223 more information (like immediate use chaining). */
224 struct use_optype_d GTY((skip (""))) *use_ops;
228 /* Statements that take register operands. */
230 struct GTY(()) gimple_statement_with_ops
232 /* [ WORD 1-7 ] */
233 struct gimple_statement_with_ops_base opbase;
235 /* [ WORD 8 ]
236 Operand vector. NOTE! This must always be the last field
237 of this structure. In particular, this means that this
238 structure cannot be embedded inside another one. */
239 tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
243 /* Base for statements that take both memory and register operands. */
245 struct GTY(()) gimple_statement_with_memory_ops_base
247 /* [ WORD 1-7 ] */
248 struct gimple_statement_with_ops_base opbase;
250 /* [ WORD 8-9 ]
251 Virtual operands for this statement. The GC will pick them
252 up via the ssa_names array. */
253 tree GTY((skip (""))) vdef;
254 tree GTY((skip (""))) vuse;
258 /* Statements that take both memory and register operands. */
260 struct GTY(()) gimple_statement_with_memory_ops
262 /* [ WORD 1-9 ] */
263 struct gimple_statement_with_memory_ops_base membase;
265 /* [ WORD 10 ]
266 Operand vector. NOTE! This must always be the last field
267 of this structure. In particular, this means that this
268 structure cannot be embedded inside another one. */
269 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
273 /* Call statements that take both memory and register operands. */
275 struct GTY(()) gimple_statement_call
277 /* [ WORD 1-9 ] */
278 struct gimple_statement_with_memory_ops_base membase;
280 /* [ WORD 10-13 ] */
281 struct pt_solution call_used;
282 struct pt_solution call_clobbered;
284 /* [ WORD 14 ] */
285 union GTY ((desc ("%1.membase.opbase.gsbase.subcode & GF_CALL_INTERNAL"))) {
286 tree GTY ((tag ("0"))) fntype;
287 enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
288 } u;
290 /* [ WORD 15 ]
291 Operand vector. NOTE! This must always be the last field
292 of this structure. In particular, this means that this
293 structure cannot be embedded inside another one. */
294 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
298 /* OpenMP statements (#pragma omp). */
300 struct GTY(()) gimple_statement_omp {
301 /* [ WORD 1-6 ] */
302 struct gimple_statement_base gsbase;
304 /* [ WORD 7 ] */
305 gimple_seq body;
309 /* GIMPLE_BIND */
311 struct GTY(()) gimple_statement_bind {
312 /* [ WORD 1-6 ] */
313 struct gimple_statement_base gsbase;
315 /* [ WORD 7 ]
316 Variables declared in this scope. */
317 tree vars;
319 /* [ WORD 8 ]
320 This is different than the BLOCK field in gimple_statement_base,
321 which is analogous to TREE_BLOCK (i.e., the lexical block holding
322 this statement). This field is the equivalent of BIND_EXPR_BLOCK
323 in tree land (i.e., the lexical scope defined by this bind). See
324 gimple-low.c. */
325 tree block;
327 /* [ WORD 9 ] */
328 gimple_seq body;
332 /* GIMPLE_CATCH */
334 struct GTY(()) gimple_statement_catch {
335 /* [ WORD 1-6 ] */
336 struct gimple_statement_base gsbase;
338 /* [ WORD 7 ] */
339 tree types;
341 /* [ WORD 8 ] */
342 gimple_seq handler;
346 /* GIMPLE_EH_FILTER */
348 struct GTY(()) gimple_statement_eh_filter {
349 /* [ WORD 1-6 ] */
350 struct gimple_statement_base gsbase;
352 /* [ WORD 7 ]
353 Filter types. */
354 tree types;
356 /* [ WORD 8 ]
357 Failure actions. */
358 gimple_seq failure;
361 /* GIMPLE_EH_ELSE */
363 struct GTY(()) gimple_statement_eh_else {
364 /* [ WORD 1-6 ] */
365 struct gimple_statement_base gsbase;
367 /* [ WORD 7,8 ] */
368 gimple_seq n_body, e_body;
371 /* GIMPLE_EH_MUST_NOT_THROW */
373 struct GTY(()) gimple_statement_eh_mnt {
374 /* [ WORD 1-6 ] */
375 struct gimple_statement_base gsbase;
377 /* [ WORD 7 ] Abort function decl. */
378 tree fndecl;
381 /* GIMPLE_PHI */
383 struct GTY(()) gimple_statement_phi {
384 /* [ WORD 1-6 ] */
385 struct gimple_statement_base gsbase;
387 /* [ WORD 7 ] */
388 unsigned capacity;
389 unsigned nargs;
391 /* [ WORD 8 ] */
392 tree result;
394 /* [ WORD 9 ] */
395 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
399 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
401 struct GTY(()) gimple_statement_eh_ctrl
403 /* [ WORD 1-6 ] */
404 struct gimple_statement_base gsbase;
406 /* [ WORD 7 ]
407 Exception region number. */
408 int region;
412 /* GIMPLE_TRY */
414 struct GTY(()) gimple_statement_try {
415 /* [ WORD 1-6 ] */
416 struct gimple_statement_base gsbase;
418 /* [ WORD 7 ]
419 Expression to evaluate. */
420 gimple_seq eval;
422 /* [ WORD 8 ]
423 Cleanup expression. */
424 gimple_seq cleanup;
427 /* Kind of GIMPLE_TRY statements. */
428 enum gimple_try_flags
430 /* A try/catch. */
431 GIMPLE_TRY_CATCH = 1 << 0,
433 /* A try/finally. */
434 GIMPLE_TRY_FINALLY = 1 << 1,
435 GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
437 /* Analogous to TRY_CATCH_IS_CLEANUP. */
438 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
441 /* GIMPLE_WITH_CLEANUP_EXPR */
443 struct GTY(()) gimple_statement_wce {
444 /* [ WORD 1-6 ] */
445 struct gimple_statement_base gsbase;
447 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
448 executed if an exception is thrown, not on normal exit of its
449 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
450 in TARGET_EXPRs. */
452 /* [ WORD 7 ]
453 Cleanup expression. */
454 gimple_seq cleanup;
458 /* GIMPLE_ASM */
460 struct GTY(()) gimple_statement_asm
462 /* [ WORD 1-9 ] */
463 struct gimple_statement_with_memory_ops_base membase;
465 /* [ WORD 10 ]
466 __asm__ statement. */
467 const char *string;
469 /* [ WORD 11 ]
470 Number of inputs, outputs, clobbers, labels. */
471 unsigned char ni;
472 unsigned char no;
473 unsigned char nc;
474 unsigned char nl;
476 /* [ WORD 12 ]
477 Operand vector. NOTE! This must always be the last field
478 of this structure. In particular, this means that this
479 structure cannot be embedded inside another one. */
480 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
483 /* GIMPLE_OMP_CRITICAL */
485 struct GTY(()) gimple_statement_omp_critical {
486 /* [ WORD 1-7 ] */
487 struct gimple_statement_omp omp;
489 /* [ WORD 8 ]
490 Critical section name. */
491 tree name;
495 struct GTY(()) gimple_omp_for_iter {
496 /* Condition code. */
497 enum tree_code cond;
499 /* Index variable. */
500 tree index;
502 /* Initial value. */
503 tree initial;
505 /* Final value. */
506 tree final;
508 /* Increment. */
509 tree incr;
512 /* GIMPLE_OMP_FOR */
514 struct GTY(()) gimple_statement_omp_for {
515 /* [ WORD 1-7 ] */
516 struct gimple_statement_omp omp;
518 /* [ WORD 8 ] */
519 tree clauses;
521 /* [ WORD 9 ]
522 Number of elements in iter array. */
523 size_t collapse;
525 /* [ WORD 10 ] */
526 struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
528 /* [ WORD 11 ]
529 Pre-body evaluated before the loop body begins. */
530 gimple_seq pre_body;
534 /* GIMPLE_OMP_PARALLEL */
536 struct GTY(()) gimple_statement_omp_parallel {
537 /* [ WORD 1-7 ] */
538 struct gimple_statement_omp omp;
540 /* [ WORD 8 ]
541 Clauses. */
542 tree clauses;
544 /* [ WORD 9 ]
545 Child function holding the body of the parallel region. */
546 tree child_fn;
548 /* [ WORD 10 ]
549 Shared data argument. */
550 tree data_arg;
554 /* GIMPLE_OMP_TASK */
556 struct GTY(()) gimple_statement_omp_task {
557 /* [ WORD 1-10 ] */
558 struct gimple_statement_omp_parallel par;
560 /* [ WORD 11 ]
561 Child function holding firstprivate initialization if needed. */
562 tree copy_fn;
564 /* [ WORD 12-13 ]
565 Size and alignment in bytes of the argument data block. */
566 tree arg_size;
567 tree arg_align;
571 /* GIMPLE_OMP_SECTION */
572 /* Uses struct gimple_statement_omp. */
575 /* GIMPLE_OMP_SECTIONS */
577 struct GTY(()) gimple_statement_omp_sections {
578 /* [ WORD 1-7 ] */
579 struct gimple_statement_omp omp;
581 /* [ WORD 8 ] */
582 tree clauses;
584 /* [ WORD 9 ]
585 The control variable used for deciding which of the sections to
586 execute. */
587 tree control;
590 /* GIMPLE_OMP_CONTINUE.
592 Note: This does not inherit from gimple_statement_omp, because we
593 do not need the body field. */
595 struct GTY(()) gimple_statement_omp_continue {
596 /* [ WORD 1-6 ] */
597 struct gimple_statement_base gsbase;
599 /* [ WORD 7 ] */
600 tree control_def;
602 /* [ WORD 8 ] */
603 tree control_use;
606 /* GIMPLE_OMP_SINGLE */
608 struct GTY(()) gimple_statement_omp_single {
609 /* [ WORD 1-7 ] */
610 struct gimple_statement_omp omp;
612 /* [ WORD 7 ] */
613 tree clauses;
617 /* GIMPLE_OMP_ATOMIC_LOAD.
618 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
619 contains a sequence, which we don't need here. */
621 struct GTY(()) gimple_statement_omp_atomic_load {
622 /* [ WORD 1-6 ] */
623 struct gimple_statement_base gsbase;
625 /* [ WORD 7-8 ] */
626 tree rhs, lhs;
629 /* GIMPLE_OMP_ATOMIC_STORE.
630 See note on GIMPLE_OMP_ATOMIC_LOAD. */
632 struct GTY(()) gimple_statement_omp_atomic_store {
633 /* [ WORD 1-6 ] */
634 struct gimple_statement_base gsbase;
636 /* [ WORD 7 ] */
637 tree val;
640 /* GIMPLE_TRANSACTION. */
642 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
644 /* The __transaction_atomic was declared [[outer]] or it is
645 __transaction_relaxed. */
646 #define GTMA_IS_OUTER (1u << 0)
647 #define GTMA_IS_RELAXED (1u << 1)
648 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
650 /* The transaction is seen to not have an abort. */
651 #define GTMA_HAVE_ABORT (1u << 2)
652 /* The transaction is seen to have loads or stores. */
653 #define GTMA_HAVE_LOAD (1u << 3)
654 #define GTMA_HAVE_STORE (1u << 4)
655 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
656 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
657 /* The transaction WILL enter serial irrevocable mode.
658 An irrevocable block post-dominates the entire transaction, such
659 that all invocations of the transaction will go serial-irrevocable.
660 In such case, we don't bother instrumenting the transaction, and
661 tell the runtime that it should begin the transaction in
662 serial-irrevocable mode. */
663 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
664 /* The transaction contains no instrumentation code whatsover, most
665 likely because it is guaranteed to go irrevocable upon entry. */
666 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
668 struct GTY(()) gimple_statement_transaction
670 /* [ WORD 1-9 ] */
671 struct gimple_statement_with_memory_ops_base gsbase;
673 /* [ WORD 10 ] */
674 gimple_seq body;
676 /* [ WORD 11 ] */
677 tree label;
680 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
681 enum gimple_statement_structure_enum {
682 #include "gsstruct.def"
683 LAST_GSS_ENUM
685 #undef DEFGSSTRUCT
688 /* Define the overall contents of a gimple tuple. It may be any of the
689 structures declared above for various types of tuples. */
691 union GTY ((desc ("gimple_statement_structure (&%h)"),
692 chain_next ("%h.gsbase.next"), variable_size)) gimple_statement_d {
693 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
694 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
695 struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
696 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
697 struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
698 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
699 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
700 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
701 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
702 struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
703 struct gimple_statement_eh_else GTY ((tag ("GSS_EH_ELSE"))) gimple_eh_else;
704 struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
705 struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
706 struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
707 struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
708 struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
709 struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
710 struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
711 struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
712 struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
713 struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
714 struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
715 struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
716 struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
717 struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
718 struct gimple_statement_transaction GTY((tag ("GSS_TRANSACTION"))) gimple_transaction;
721 /* In gimple.c. */
723 /* Offset in bytes to the location of the operand vector.
724 Zero if there is no operand vector for this tuple structure. */
725 extern size_t const gimple_ops_offset_[];
727 /* Map GIMPLE codes to GSS codes. */
728 extern enum gimple_statement_structure_enum const gss_for_code_[];
730 /* This variable holds the currently expanded gimple statement for purposes
731 of comminucating the profile info to the builtin expanders. */
732 extern gimple currently_expanding_gimple_stmt;
734 gimple gimple_build_return (tree);
736 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
737 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
739 void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *, tree *);
741 gimple
742 gimple_build_assign_with_ops (enum tree_code, tree,
743 tree, tree CXX_MEM_STAT_INFO);
744 gimple
745 gimple_build_assign_with_ops (enum tree_code, tree,
746 tree, tree, tree CXX_MEM_STAT_INFO);
748 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
749 #define gimple_build_debug_bind(var,val,stmt) \
750 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
751 gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
752 #define gimple_build_debug_source_bind(var,val,stmt) \
753 gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
755 gimple gimple_build_call_vec (tree, vec<tree> );
756 gimple gimple_build_call (tree, unsigned, ...);
757 gimple gimple_build_call_valist (tree, unsigned, va_list);
758 gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
759 gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
760 gimple gimple_build_call_from_tree (tree);
761 gimple gimplify_assign (tree, tree, gimple_seq *);
762 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
763 gimple gimple_build_label (tree label);
764 gimple gimple_build_goto (tree dest);
765 gimple gimple_build_nop (void);
766 gimple gimple_build_bind (tree, gimple_seq, tree);
767 gimple gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
768 vec<tree, va_gc> *, vec<tree, va_gc> *,
769 vec<tree, va_gc> *);
770 gimple gimple_build_catch (tree, gimple_seq);
771 gimple gimple_build_eh_filter (tree, gimple_seq);
772 gimple gimple_build_eh_must_not_throw (tree);
773 gimple gimple_build_eh_else (gimple_seq, gimple_seq);
774 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
775 gimple gimple_build_wce (gimple_seq);
776 gimple gimple_build_resx (int);
777 gimple gimple_build_eh_dispatch (int);
778 gimple gimple_build_switch_nlabels (unsigned, tree, tree);
779 gimple gimple_build_switch (tree, tree, vec<tree> );
780 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
781 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
782 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq);
783 gimple gimple_build_omp_critical (gimple_seq, tree);
784 gimple gimple_build_omp_section (gimple_seq);
785 gimple gimple_build_omp_continue (tree, tree);
786 gimple gimple_build_omp_master (gimple_seq);
787 gimple gimple_build_omp_return (bool);
788 gimple gimple_build_omp_ordered (gimple_seq);
789 gimple gimple_build_omp_sections (gimple_seq, tree);
790 gimple gimple_build_omp_sections_switch (void);
791 gimple gimple_build_omp_single (gimple_seq, tree);
792 gimple gimple_build_cdt (tree, tree);
793 gimple gimple_build_omp_atomic_load (tree, tree);
794 gimple gimple_build_omp_atomic_store (tree);
795 gimple gimple_build_transaction (gimple_seq, tree);
796 gimple gimple_build_predict (enum br_predictor, enum prediction);
797 enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
798 void sort_case_labels (vec<tree> );
799 void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
800 void gimple_set_body (tree, gimple_seq);
801 gimple_seq gimple_body (tree);
802 bool gimple_has_body_p (tree);
803 gimple_seq gimple_seq_alloc (void);
804 void gimple_seq_free (gimple_seq);
805 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
806 gimple_seq gimple_seq_copy (gimple_seq);
807 bool gimple_call_same_target_p (const_gimple, const_gimple);
808 int gimple_call_flags (const_gimple);
809 int gimple_call_return_flags (const_gimple);
810 int gimple_call_arg_flags (const_gimple, unsigned);
811 void gimple_call_reset_alias_info (gimple);
812 bool gimple_assign_copy_p (gimple);
813 bool gimple_assign_ssa_name_copy_p (gimple);
814 bool gimple_assign_unary_nop_p (gimple);
815 void gimple_set_bb (gimple, basic_block);
816 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
817 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
818 tree, tree, tree);
819 tree gimple_get_lhs (const_gimple);
820 void gimple_set_lhs (gimple, tree);
821 void gimple_replace_lhs (gimple, tree);
822 gimple gimple_copy (gimple);
823 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
824 gimple gimple_build_cond_from_tree (tree, tree, tree);
825 void gimple_cond_set_condition_from_tree (gimple, tree);
826 bool gimple_has_side_effects (const_gimple);
827 bool gimple_could_trap_p (gimple);
828 bool gimple_could_trap_p_1 (gimple, bool, bool);
829 bool gimple_assign_rhs_could_trap_p (gimple);
830 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
831 bool empty_body_p (gimple_seq);
832 unsigned get_gimple_rhs_num_ops (enum tree_code);
833 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
834 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
835 const char *gimple_decl_printable_name (tree, int);
836 tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree);
837 tree gimple_extract_devirt_binfo_from_cst (tree);
839 /* Returns true iff T is a scalar register variable. */
840 extern bool is_gimple_reg (tree);
841 /* Returns true iff T is any sort of variable. */
842 extern bool is_gimple_variable (tree);
843 /* Returns true iff T is any sort of symbol. */
844 extern bool is_gimple_id (tree);
845 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */
846 extern bool is_gimple_min_lval (tree);
847 /* Returns true iff T is something whose address can be taken. */
848 extern bool is_gimple_addressable (tree);
849 /* Returns true iff T is any valid GIMPLE lvalue. */
850 extern bool is_gimple_lvalue (tree);
852 /* Returns true iff T is a GIMPLE address. */
853 bool is_gimple_address (const_tree);
854 /* Returns true iff T is a GIMPLE invariant address. */
855 bool is_gimple_invariant_address (const_tree);
856 /* Returns true iff T is a GIMPLE invariant address at interprocedural
857 level. */
858 bool is_gimple_ip_invariant_address (const_tree);
859 /* Returns true iff T is a valid GIMPLE constant. */
860 bool is_gimple_constant (const_tree);
861 /* Returns true iff T is a GIMPLE restricted function invariant. */
862 extern bool is_gimple_min_invariant (const_tree);
863 /* Returns true iff T is a GIMPLE restricted interprecodural invariant. */
864 extern bool is_gimple_ip_invariant (const_tree);
865 /* Returns true iff T is a GIMPLE rvalue. */
866 extern bool is_gimple_val (tree);
867 /* Returns true iff T is a GIMPLE asm statement input. */
868 extern bool is_gimple_asm_val (tree);
869 /* Returns true iff T is a valid address operand of a MEM_REF. */
870 bool is_gimple_mem_ref_addr (tree);
872 /* Returns true iff T is a valid if-statement condition. */
873 extern bool is_gimple_condexpr (tree);
875 /* Returns true iff T is a valid call address expression. */
876 extern bool is_gimple_call_addr (tree);
878 /* Return TRUE iff stmt is a call to a built-in function. */
879 extern bool is_gimple_builtin_call (gimple stmt);
881 extern void recalculate_side_effects (tree);
882 extern bool gimple_compare_field_offset (tree, tree);
883 extern tree gimple_register_canonical_type (tree);
884 extern void print_gimple_types_stats (const char *);
885 extern void free_gimple_type_tables (void);
886 extern tree gimple_unsigned_type (tree);
887 extern tree gimple_signed_type (tree);
888 extern alias_set_type gimple_get_alias_set (tree);
889 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
890 unsigned *);
891 extern bool walk_stmt_load_store_addr_ops (gimple, void *,
892 bool (*)(gimple, tree, void *),
893 bool (*)(gimple, tree, void *),
894 bool (*)(gimple, tree, void *));
895 extern bool walk_stmt_load_store_ops (gimple, void *,
896 bool (*)(gimple, tree, void *),
897 bool (*)(gimple, tree, void *));
898 extern bool gimple_ior_addresses_taken (bitmap, gimple);
899 extern bool gimple_call_builtin_p (gimple, enum built_in_class);
900 extern bool gimple_call_builtin_p (gimple, enum built_in_function);
901 extern bool gimple_asm_clobbers_memory_p (const_gimple);
903 /* In gimplify.c */
904 extern tree create_tmp_var_raw (tree, const char *);
905 extern tree create_tmp_var_name (const char *);
906 extern tree create_tmp_var (tree, const char *);
907 extern tree create_tmp_reg (tree, const char *);
908 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
909 extern tree get_formal_tmp_var (tree, gimple_seq *);
910 extern void declare_vars (tree, gimple, bool);
911 extern void annotate_all_with_location (gimple_seq, location_t);
913 /* Validation of GIMPLE expressions. Note that these predicates only check
914 the basic form of the expression, they don't recurse to make sure that
915 underlying nodes are also of the right form. */
916 typedef bool (*gimple_predicate)(tree);
919 /* FIXME we should deduce this from the predicate. */
920 enum fallback {
921 fb_none = 0, /* Do not generate a temporary. */
923 fb_rvalue = 1, /* Generate an rvalue to hold the result of a
924 gimplified expression. */
926 fb_lvalue = 2, /* Generate an lvalue to hold the result of a
927 gimplified expression. */
929 fb_mayfail = 4, /* Gimplification may fail. Error issued
930 afterwards. */
931 fb_either= fb_rvalue | fb_lvalue
934 typedef int fallback_t;
936 enum gimplify_status {
937 GS_ERROR = -2, /* Something Bad Seen. */
938 GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
939 GS_OK = 0, /* We did something, maybe more to do. */
940 GS_ALL_DONE = 1 /* The expression is fully gimplified. */
943 struct gimplify_ctx
945 struct gimplify_ctx *prev_context;
947 vec<gimple> bind_expr_stack;
948 tree temps;
949 gimple_seq conditional_cleanups;
950 tree exit_label;
951 tree return_temp;
953 vec<tree> case_labels;
954 /* The formal temporary table. Should this be persistent? */
955 htab_t temp_htab;
957 int conditions;
958 bool save_stack;
959 bool into_ssa;
960 bool allow_rhs_cond_expr;
961 bool in_cleanup_point_expr;
964 /* Return true if gimplify_one_sizepos doesn't need to gimplify
965 expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
966 fields). */
967 static inline bool
968 is_gimple_sizepos (tree expr)
970 /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
971 is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do
972 anything if it's already a VAR_DECL. If it's a VAR_DECL from another
973 function, the gimplifier will want to replace it with a new variable,
974 but that will cause problems if this type is from outside the function.
975 It's OK to have that here. */
976 return (expr == NULL_TREE
977 || TREE_CONSTANT (expr)
978 || TREE_CODE (expr) == VAR_DECL
979 || CONTAINS_PLACEHOLDER_P (expr));
982 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
983 bool (*) (tree), fallback_t);
984 extern void gimplify_type_sizes (tree, gimple_seq *);
985 extern void gimplify_one_sizepos (tree *, gimple_seq *);
986 enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, gimple_seq *,
987 bool, tree);
988 extern bool gimplify_stmt (tree *, gimple_seq *);
989 extern gimple gimplify_body (tree, bool);
990 extern void push_gimplify_context (struct gimplify_ctx *);
991 extern void pop_gimplify_context (gimple);
992 extern void gimplify_and_add (tree, gimple_seq *);
994 /* Miscellaneous helpers. */
995 extern void gimple_add_tmp_var (tree);
996 extern gimple gimple_current_bind_expr (void);
997 extern vec<gimple> gimple_bind_expr_stack (void);
998 extern tree voidify_wrapper_expr (tree, tree);
999 extern tree build_and_jump (tree *);
1000 extern tree force_labels_r (tree *, int *, void *);
1001 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
1002 gimple_seq *);
1003 struct gimplify_omp_ctx;
1004 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
1005 extern tree gimple_boolify (tree);
1006 extern gimple_predicate rhs_predicate_for (tree);
1007 extern tree canonicalize_cond_expr_cond (tree);
1009 /* In omp-low.c. */
1010 extern tree omp_reduction_init (tree, tree);
1012 /* In trans-mem.c. */
1013 extern void diagnose_tm_safe_errors (tree);
1014 extern void compute_transaction_bits (void);
1016 /* In tree-nested.c. */
1017 extern void lower_nested_functions (tree);
1018 extern void insert_field_into_struct (tree, tree);
1020 /* In gimplify.c. */
1021 extern void gimplify_function_tree (tree);
1023 /* In cfgexpand.c. */
1024 extern tree gimple_assign_rhs_to_tree (gimple);
1026 /* In builtins.c */
1027 extern bool validate_gimple_arglist (const_gimple, ...);
1029 /* In tree-ssa.c */
1030 extern bool tree_ssa_useless_type_conversion (tree);
1031 extern tree tree_ssa_strip_useless_type_conversions (tree);
1032 extern bool useless_type_conversion_p (tree, tree);
1033 extern bool types_compatible_p (tree, tree);
1035 /* Return the first node in GIMPLE sequence S. */
1037 static inline gimple_seq_node
1038 gimple_seq_first (gimple_seq s)
1040 return s;
1044 /* Return the first statement in GIMPLE sequence S. */
1046 static inline gimple
1047 gimple_seq_first_stmt (gimple_seq s)
1049 gimple_seq_node n = gimple_seq_first (s);
1050 return n;
1054 /* Return the last node in GIMPLE sequence S. */
1056 static inline gimple_seq_node
1057 gimple_seq_last (gimple_seq s)
1059 return s ? s->gsbase.prev : NULL;
1063 /* Return the last statement in GIMPLE sequence S. */
1065 static inline gimple
1066 gimple_seq_last_stmt (gimple_seq s)
1068 gimple_seq_node n = gimple_seq_last (s);
1069 return n;
1073 /* Set the last node in GIMPLE sequence *PS to LAST. */
1075 static inline void
1076 gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1078 (*ps)->gsbase.prev = last;
1082 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1084 static inline void
1085 gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1087 *ps = first;
1091 /* Return true if GIMPLE sequence S is empty. */
1093 static inline bool
1094 gimple_seq_empty_p (gimple_seq s)
1096 return s == NULL;
1100 void gimple_seq_add_stmt (gimple_seq *, gimple);
1102 /* Link gimple statement GS to the end of the sequence *SEQ_P. If
1103 *SEQ_P is NULL, a new sequence is allocated. This function is
1104 similar to gimple_seq_add_stmt, but does not scan the operands.
1105 During gimplification, we need to manipulate statement sequences
1106 before the def/use vectors have been constructed. */
1107 void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
1109 /* Allocate a new sequence and initialize its first element with STMT. */
1111 static inline gimple_seq
1112 gimple_seq_alloc_with_stmt (gimple stmt)
1114 gimple_seq seq = NULL;
1115 gimple_seq_add_stmt (&seq, stmt);
1116 return seq;
1120 /* Returns the sequence of statements in BB. */
1122 static inline gimple_seq
1123 bb_seq (const_basic_block bb)
1125 return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1128 static inline gimple_seq *
1129 bb_seq_addr (basic_block bb)
1131 return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1134 /* Sets the sequence of statements in BB to SEQ. */
1136 static inline void
1137 set_bb_seq (basic_block bb, gimple_seq seq)
1139 gcc_checking_assert (!(bb->flags & BB_RTL));
1140 bb->il.gimple.seq = seq;
1144 /* Return the code for GIMPLE statement G. */
1146 static inline enum gimple_code
1147 gimple_code (const_gimple g)
1149 return g->gsbase.code;
1153 /* Return the GSS code used by a GIMPLE code. */
1155 static inline enum gimple_statement_structure_enum
1156 gss_for_code (enum gimple_code code)
1158 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1159 return gss_for_code_[code];
1163 /* Return which GSS code is used by GS. */
1165 static inline enum gimple_statement_structure_enum
1166 gimple_statement_structure (gimple gs)
1168 return gss_for_code (gimple_code (gs));
1172 /* Return true if statement G has sub-statements. This is only true for
1173 High GIMPLE statements. */
1175 static inline bool
1176 gimple_has_substatements (gimple g)
1178 switch (gimple_code (g))
1180 case GIMPLE_BIND:
1181 case GIMPLE_CATCH:
1182 case GIMPLE_EH_FILTER:
1183 case GIMPLE_EH_ELSE:
1184 case GIMPLE_TRY:
1185 case GIMPLE_OMP_FOR:
1186 case GIMPLE_OMP_MASTER:
1187 case GIMPLE_OMP_ORDERED:
1188 case GIMPLE_OMP_SECTION:
1189 case GIMPLE_OMP_PARALLEL:
1190 case GIMPLE_OMP_TASK:
1191 case GIMPLE_OMP_SECTIONS:
1192 case GIMPLE_OMP_SINGLE:
1193 case GIMPLE_OMP_CRITICAL:
1194 case GIMPLE_WITH_CLEANUP_EXPR:
1195 case GIMPLE_TRANSACTION:
1196 return true;
1198 default:
1199 return false;
1204 /* Return the basic block holding statement G. */
1206 static inline basic_block
1207 gimple_bb (const_gimple g)
1209 return g->gsbase.bb;
1213 /* Return the lexical scope block holding statement G. */
1215 static inline tree
1216 gimple_block (const_gimple g)
1218 return LOCATION_BLOCK (g->gsbase.location);
1222 /* Set BLOCK to be the lexical scope block holding statement G. */
1224 static inline void
1225 gimple_set_block (gimple g, tree block)
1227 if (block)
1228 g->gsbase.location =
1229 COMBINE_LOCATION_DATA (line_table, g->gsbase.location, block);
1230 else
1231 g->gsbase.location = LOCATION_LOCUS (g->gsbase.location);
1235 /* Return location information for statement G. */
1237 static inline location_t
1238 gimple_location (const_gimple g)
1240 return g->gsbase.location;
1243 /* Return pointer to location information for statement G. */
1245 static inline const location_t *
1246 gimple_location_ptr (const_gimple g)
1248 return &g->gsbase.location;
1252 /* Set location information for statement G. */
1254 static inline void
1255 gimple_set_location (gimple g, location_t location)
1257 g->gsbase.location = location;
1261 /* Return true if G contains location information. */
1263 static inline bool
1264 gimple_has_location (const_gimple g)
1266 return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1270 /* Return the file name of the location of STMT. */
1272 static inline const char *
1273 gimple_filename (const_gimple stmt)
1275 return LOCATION_FILE (gimple_location (stmt));
1279 /* Return the line number of the location of STMT. */
1281 static inline int
1282 gimple_lineno (const_gimple stmt)
1284 return LOCATION_LINE (gimple_location (stmt));
1288 /* Determine whether SEQ is a singleton. */
1290 static inline bool
1291 gimple_seq_singleton_p (gimple_seq seq)
1293 return ((gimple_seq_first (seq) != NULL)
1294 && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1297 /* Return true if no warnings should be emitted for statement STMT. */
1299 static inline bool
1300 gimple_no_warning_p (const_gimple stmt)
1302 return stmt->gsbase.no_warning;
1305 /* Set the no_warning flag of STMT to NO_WARNING. */
1307 static inline void
1308 gimple_set_no_warning (gimple stmt, bool no_warning)
1310 stmt->gsbase.no_warning = (unsigned) no_warning;
1313 /* Set the visited status on statement STMT to VISITED_P. */
1315 static inline void
1316 gimple_set_visited (gimple stmt, bool visited_p)
1318 stmt->gsbase.visited = (unsigned) visited_p;
1322 /* Return the visited status for statement STMT. */
1324 static inline bool
1325 gimple_visited_p (gimple stmt)
1327 return stmt->gsbase.visited;
1331 /* Set pass local flag PLF on statement STMT to VAL_P. */
1333 static inline void
1334 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1336 if (val_p)
1337 stmt->gsbase.plf |= (unsigned int) plf;
1338 else
1339 stmt->gsbase.plf &= ~((unsigned int) plf);
1343 /* Return the value of pass local flag PLF on statement STMT. */
1345 static inline unsigned int
1346 gimple_plf (gimple stmt, enum plf_mask plf)
1348 return stmt->gsbase.plf & ((unsigned int) plf);
1352 /* Set the UID of statement. */
1354 static inline void
1355 gimple_set_uid (gimple g, unsigned uid)
1357 g->gsbase.uid = uid;
1361 /* Return the UID of statement. */
1363 static inline unsigned
1364 gimple_uid (const_gimple g)
1366 return g->gsbase.uid;
1370 /* Make statement G a singleton sequence. */
1372 static inline void
1373 gimple_init_singleton (gimple g)
1375 g->gsbase.next = NULL;
1376 g->gsbase.prev = g;
1380 /* Return true if GIMPLE statement G has register or memory operands. */
1382 static inline bool
1383 gimple_has_ops (const_gimple g)
1385 return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1389 /* Return true if GIMPLE statement G has memory operands. */
1391 static inline bool
1392 gimple_has_mem_ops (const_gimple g)
1394 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1398 /* Return the set of USE operands for statement G. */
1400 static inline struct use_optype_d *
1401 gimple_use_ops (const_gimple g)
1403 if (!gimple_has_ops (g))
1404 return NULL;
1405 return g->gsops.opbase.use_ops;
1409 /* Set USE to be the set of USE operands for statement G. */
1411 static inline void
1412 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1414 gcc_gimple_checking_assert (gimple_has_ops (g));
1415 g->gsops.opbase.use_ops = use;
1419 /* Return the set of VUSE operand for statement G. */
1421 static inline use_operand_p
1422 gimple_vuse_op (const_gimple g)
1424 struct use_optype_d *ops;
1425 if (!gimple_has_mem_ops (g))
1426 return NULL_USE_OPERAND_P;
1427 ops = g->gsops.opbase.use_ops;
1428 if (ops
1429 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
1430 return USE_OP_PTR (ops);
1431 return NULL_USE_OPERAND_P;
1434 /* Return the set of VDEF operand for statement G. */
1436 static inline def_operand_p
1437 gimple_vdef_op (gimple g)
1439 if (!gimple_has_mem_ops (g))
1440 return NULL_DEF_OPERAND_P;
1441 if (g->gsmembase.vdef)
1442 return &g->gsmembase.vdef;
1443 return NULL_DEF_OPERAND_P;
1447 /* Return the single VUSE operand of the statement G. */
1449 static inline tree
1450 gimple_vuse (const_gimple g)
1452 if (!gimple_has_mem_ops (g))
1453 return NULL_TREE;
1454 return g->gsmembase.vuse;
1457 /* Return the single VDEF operand of the statement G. */
1459 static inline tree
1460 gimple_vdef (const_gimple g)
1462 if (!gimple_has_mem_ops (g))
1463 return NULL_TREE;
1464 return g->gsmembase.vdef;
1467 /* Return the single VUSE operand of the statement G. */
1469 static inline tree *
1470 gimple_vuse_ptr (gimple g)
1472 if (!gimple_has_mem_ops (g))
1473 return NULL;
1474 return &g->gsmembase.vuse;
1477 /* Return the single VDEF operand of the statement G. */
1479 static inline tree *
1480 gimple_vdef_ptr (gimple g)
1482 if (!gimple_has_mem_ops (g))
1483 return NULL;
1484 return &g->gsmembase.vdef;
1487 /* Set the single VUSE operand of the statement G. */
1489 static inline void
1490 gimple_set_vuse (gimple g, tree vuse)
1492 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1493 g->gsmembase.vuse = vuse;
1496 /* Set the single VDEF operand of the statement G. */
1498 static inline void
1499 gimple_set_vdef (gimple g, tree vdef)
1501 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1502 g->gsmembase.vdef = vdef;
1506 /* Return true if statement G has operands and the modified field has
1507 been set. */
1509 static inline bool
1510 gimple_modified_p (const_gimple g)
1512 return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
1516 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1517 a MODIFIED field. */
1519 static inline void
1520 gimple_set_modified (gimple s, bool modifiedp)
1522 if (gimple_has_ops (s))
1523 s->gsbase.modified = (unsigned) modifiedp;
1527 /* Return the tree code for the expression computed by STMT. This is
1528 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1529 GIMPLE_CALL, return CALL_EXPR as the expression code for
1530 consistency. This is useful when the caller needs to deal with the
1531 three kinds of computation that GIMPLE supports. */
1533 static inline enum tree_code
1534 gimple_expr_code (const_gimple stmt)
1536 enum gimple_code code = gimple_code (stmt);
1537 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1538 return (enum tree_code) stmt->gsbase.subcode;
1539 else
1541 gcc_gimple_checking_assert (code == GIMPLE_CALL);
1542 return CALL_EXPR;
1547 /* Mark statement S as modified, and update it. */
1549 static inline void
1550 update_stmt (gimple s)
1552 if (gimple_has_ops (s))
1554 gimple_set_modified (s, true);
1555 update_stmt_operands (s);
1559 /* Update statement S if it has been optimized. */
1561 static inline void
1562 update_stmt_if_modified (gimple s)
1564 if (gimple_modified_p (s))
1565 update_stmt_operands (s);
1568 /* Return true if statement STMT contains volatile operands. */
1570 static inline bool
1571 gimple_has_volatile_ops (const_gimple stmt)
1573 if (gimple_has_mem_ops (stmt))
1574 return stmt->gsbase.has_volatile_ops;
1575 else
1576 return false;
1580 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1582 static inline void
1583 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1585 if (gimple_has_mem_ops (stmt))
1586 stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
1589 /* Return true if BB is in a transaction. */
1591 static inline bool
1592 block_in_transaction (basic_block bb)
1594 return flag_tm && bb->flags & BB_IN_TRANSACTION;
1597 /* Return true if STMT is in a transaction. */
1599 static inline bool
1600 gimple_in_transaction (gimple stmt)
1602 return block_in_transaction (gimple_bb (stmt));
1605 /* Return true if statement STMT may access memory. */
1607 static inline bool
1608 gimple_references_memory_p (gimple stmt)
1610 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1614 /* Return the subcode for OMP statement S. */
1616 static inline unsigned
1617 gimple_omp_subcode (const_gimple s)
1619 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1620 && gimple_code (s) <= GIMPLE_OMP_SINGLE);
1621 return s->gsbase.subcode;
1624 /* Set the subcode for OMP statement S to SUBCODE. */
1626 static inline void
1627 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1629 /* We only have 16 bits for the subcode. Assert that we are not
1630 overflowing it. */
1631 gcc_gimple_checking_assert (subcode < (1 << 16));
1632 s->gsbase.subcode = subcode;
1635 /* Set the nowait flag on OMP_RETURN statement S. */
1637 static inline void
1638 gimple_omp_return_set_nowait (gimple s)
1640 GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1641 s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
1645 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1646 flag set. */
1648 static inline bool
1649 gimple_omp_return_nowait_p (const_gimple g)
1651 GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1652 return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1656 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1657 flag set. */
1659 static inline bool
1660 gimple_omp_section_last_p (const_gimple g)
1662 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1663 return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1667 /* Set the GF_OMP_SECTION_LAST flag on G. */
1669 static inline void
1670 gimple_omp_section_set_last (gimple g)
1672 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1673 g->gsbase.subcode |= GF_OMP_SECTION_LAST;
1677 /* Return true if OMP parallel statement G has the
1678 GF_OMP_PARALLEL_COMBINED flag set. */
1680 static inline bool
1681 gimple_omp_parallel_combined_p (const_gimple g)
1683 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1684 return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1688 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1689 value of COMBINED_P. */
1691 static inline void
1692 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1694 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1695 if (combined_p)
1696 g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
1697 else
1698 g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
1702 /* Return true if OMP atomic load/store statement G has the
1703 GF_OMP_ATOMIC_NEED_VALUE flag set. */
1705 static inline bool
1706 gimple_omp_atomic_need_value_p (const_gimple g)
1708 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1709 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1710 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
1714 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
1716 static inline void
1717 gimple_omp_atomic_set_need_value (gimple g)
1719 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1720 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1721 g->gsbase.subcode |= GF_OMP_ATOMIC_NEED_VALUE;
1725 /* Return the number of operands for statement GS. */
1727 static inline unsigned
1728 gimple_num_ops (const_gimple gs)
1730 return gs->gsbase.num_ops;
1734 /* Set the number of operands for statement GS. */
1736 static inline void
1737 gimple_set_num_ops (gimple gs, unsigned num_ops)
1739 gs->gsbase.num_ops = num_ops;
1743 /* Return the array of operands for statement GS. */
1745 static inline tree *
1746 gimple_ops (gimple gs)
1748 size_t off;
1750 /* All the tuples have their operand vector at the very bottom
1751 of the structure. Note that those structures that do not
1752 have an operand vector have a zero offset. */
1753 off = gimple_ops_offset_[gimple_statement_structure (gs)];
1754 gcc_gimple_checking_assert (off != 0);
1756 return (tree *) ((char *) gs + off);
1760 /* Return operand I for statement GS. */
1762 static inline tree
1763 gimple_op (const_gimple gs, unsigned i)
1765 if (gimple_has_ops (gs))
1767 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1768 return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1770 else
1771 return NULL_TREE;
1774 /* Return a pointer to operand I for statement GS. */
1776 static inline tree *
1777 gimple_op_ptr (const_gimple gs, unsigned i)
1779 if (gimple_has_ops (gs))
1781 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1782 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1784 else
1785 return NULL;
1788 /* Set operand I of statement GS to OP. */
1790 static inline void
1791 gimple_set_op (gimple gs, unsigned i, tree op)
1793 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1795 /* Note. It may be tempting to assert that OP matches
1796 is_gimple_operand, but that would be wrong. Different tuples
1797 accept slightly different sets of tree operands. Each caller
1798 should perform its own validation. */
1799 gimple_ops (gs)[i] = op;
1802 /* Return true if GS is a GIMPLE_ASSIGN. */
1804 static inline bool
1805 is_gimple_assign (const_gimple gs)
1807 return gimple_code (gs) == GIMPLE_ASSIGN;
1810 /* Determine if expression CODE is one of the valid expressions that can
1811 be used on the RHS of GIMPLE assignments. */
1813 static inline enum gimple_rhs_class
1814 get_gimple_rhs_class (enum tree_code code)
1816 return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1819 /* Return the LHS of assignment statement GS. */
1821 static inline tree
1822 gimple_assign_lhs (const_gimple gs)
1824 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1825 return gimple_op (gs, 0);
1829 /* Return a pointer to the LHS of assignment statement GS. */
1831 static inline tree *
1832 gimple_assign_lhs_ptr (const_gimple gs)
1834 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1835 return gimple_op_ptr (gs, 0);
1839 /* Set LHS to be the LHS operand of assignment statement GS. */
1841 static inline void
1842 gimple_assign_set_lhs (gimple gs, tree lhs)
1844 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1845 gimple_set_op (gs, 0, lhs);
1847 if (lhs && TREE_CODE (lhs) == SSA_NAME)
1848 SSA_NAME_DEF_STMT (lhs) = gs;
1852 /* Return the first operand on the RHS of assignment statement GS. */
1854 static inline tree
1855 gimple_assign_rhs1 (const_gimple gs)
1857 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1858 return gimple_op (gs, 1);
1862 /* Return a pointer to the first operand on the RHS of assignment
1863 statement GS. */
1865 static inline tree *
1866 gimple_assign_rhs1_ptr (const_gimple gs)
1868 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1869 return gimple_op_ptr (gs, 1);
1872 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
1874 static inline void
1875 gimple_assign_set_rhs1 (gimple gs, tree rhs)
1877 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1879 gimple_set_op (gs, 1, rhs);
1883 /* Return the second operand on the RHS of assignment statement GS.
1884 If GS does not have two operands, NULL is returned instead. */
1886 static inline tree
1887 gimple_assign_rhs2 (const_gimple gs)
1889 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1891 if (gimple_num_ops (gs) >= 3)
1892 return gimple_op (gs, 2);
1893 else
1894 return NULL_TREE;
1898 /* Return a pointer to the second operand on the RHS of assignment
1899 statement GS. */
1901 static inline tree *
1902 gimple_assign_rhs2_ptr (const_gimple gs)
1904 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1905 return gimple_op_ptr (gs, 2);
1909 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
1911 static inline void
1912 gimple_assign_set_rhs2 (gimple gs, tree rhs)
1914 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1916 gimple_set_op (gs, 2, rhs);
1919 /* Return the third operand on the RHS of assignment statement GS.
1920 If GS does not have two operands, NULL is returned instead. */
1922 static inline tree
1923 gimple_assign_rhs3 (const_gimple gs)
1925 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1927 if (gimple_num_ops (gs) >= 4)
1928 return gimple_op (gs, 3);
1929 else
1930 return NULL_TREE;
1933 /* Return a pointer to the third operand on the RHS of assignment
1934 statement GS. */
1936 static inline tree *
1937 gimple_assign_rhs3_ptr (const_gimple gs)
1939 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1940 return gimple_op_ptr (gs, 3);
1944 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
1946 static inline void
1947 gimple_assign_set_rhs3 (gimple gs, tree rhs)
1949 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1951 gimple_set_op (gs, 3, rhs);
1954 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
1955 to see only a maximum of two operands. */
1957 static inline void
1958 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
1959 tree op1, tree op2)
1961 gimple_assign_set_rhs_with_ops_1 (gsi, code, op1, op2, NULL);
1964 /* A wrapper around extract_ops_from_tree_1, for callers which expect
1965 to see only a maximum of two operands. */
1967 static inline void
1968 extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0,
1969 tree *op1)
1971 tree op2;
1972 extract_ops_from_tree_1 (expr, code, op0, op1, &op2);
1973 gcc_assert (op2 == NULL_TREE);
1976 /* Returns true if GS is a nontemporal move. */
1978 static inline bool
1979 gimple_assign_nontemporal_move_p (const_gimple gs)
1981 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1982 return gs->gsbase.nontemporal_move;
1985 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
1987 static inline void
1988 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
1990 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1991 gs->gsbase.nontemporal_move = nontemporal;
1995 /* Return the code of the expression computed on the rhs of assignment
1996 statement GS. In case that the RHS is a single object, returns the
1997 tree code of the object. */
1999 static inline enum tree_code
2000 gimple_assign_rhs_code (const_gimple gs)
2002 enum tree_code code;
2003 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2005 code = (enum tree_code) gs->gsbase.subcode;
2006 /* While we initially set subcode to the TREE_CODE of the rhs for
2007 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2008 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2009 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2010 code = TREE_CODE (gimple_assign_rhs1 (gs));
2012 return code;
2016 /* Set CODE to be the code for the expression computed on the RHS of
2017 assignment S. */
2019 static inline void
2020 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
2022 GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2023 s->gsbase.subcode = code;
2027 /* Return the gimple rhs class of the code of the expression computed on
2028 the rhs of assignment statement GS.
2029 This will never return GIMPLE_INVALID_RHS. */
2031 static inline enum gimple_rhs_class
2032 gimple_assign_rhs_class (const_gimple gs)
2034 return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2037 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2038 there is no operator associated with the assignment itself.
2039 Unlike gimple_assign_copy_p, this predicate returns true for
2040 any RHS operand, including those that perform an operation
2041 and do not have the semantics of a copy, such as COND_EXPR. */
2043 static inline bool
2044 gimple_assign_single_p (gimple gs)
2046 return (is_gimple_assign (gs)
2047 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2050 /* Return true if GS performs a store to its lhs. */
2052 static inline bool
2053 gimple_store_p (gimple gs)
2055 tree lhs = gimple_get_lhs (gs);
2056 return lhs && !is_gimple_reg (lhs);
2059 /* Return true if GS is an assignment that loads from its rhs1. */
2061 static inline bool
2062 gimple_assign_load_p (gimple gs)
2064 tree rhs;
2065 if (!gimple_assign_single_p (gs))
2066 return false;
2067 rhs = gimple_assign_rhs1 (gs);
2068 if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
2069 return true;
2070 rhs = get_base_address (rhs);
2071 return (DECL_P (rhs)
2072 || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
2076 /* Return true if S is a type-cast assignment. */
2078 static inline bool
2079 gimple_assign_cast_p (gimple s)
2081 if (is_gimple_assign (s))
2083 enum tree_code sc = gimple_assign_rhs_code (s);
2084 return CONVERT_EXPR_CODE_P (sc)
2085 || sc == VIEW_CONVERT_EXPR
2086 || sc == FIX_TRUNC_EXPR;
2089 return false;
2092 /* Return true if S is a clobber statement. */
2094 static inline bool
2095 gimple_clobber_p (gimple s)
2097 return gimple_assign_single_p (s)
2098 && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2101 /* Return true if GS is a GIMPLE_CALL. */
2103 static inline bool
2104 is_gimple_call (const_gimple gs)
2106 return gimple_code (gs) == GIMPLE_CALL;
2109 /* Return the LHS of call statement GS. */
2111 static inline tree
2112 gimple_call_lhs (const_gimple gs)
2114 GIMPLE_CHECK (gs, GIMPLE_CALL);
2115 return gimple_op (gs, 0);
2119 /* Return a pointer to the LHS of call statement GS. */
2121 static inline tree *
2122 gimple_call_lhs_ptr (const_gimple gs)
2124 GIMPLE_CHECK (gs, GIMPLE_CALL);
2125 return gimple_op_ptr (gs, 0);
2129 /* Set LHS to be the LHS operand of call statement GS. */
2131 static inline void
2132 gimple_call_set_lhs (gimple gs, tree lhs)
2134 GIMPLE_CHECK (gs, GIMPLE_CALL);
2135 gimple_set_op (gs, 0, lhs);
2136 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2137 SSA_NAME_DEF_STMT (lhs) = gs;
2141 /* Return true if call GS calls an internal-only function, as enumerated
2142 by internal_fn. */
2144 static inline bool
2145 gimple_call_internal_p (const_gimple gs)
2147 GIMPLE_CHECK (gs, GIMPLE_CALL);
2148 return (gs->gsbase.subcode & GF_CALL_INTERNAL) != 0;
2152 /* Return the target of internal call GS. */
2154 static inline enum internal_fn
2155 gimple_call_internal_fn (const_gimple gs)
2157 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2158 return gs->gimple_call.u.internal_fn;
2162 /* Return the function type of the function called by GS. */
2164 static inline tree
2165 gimple_call_fntype (const_gimple gs)
2167 GIMPLE_CHECK (gs, GIMPLE_CALL);
2168 if (gimple_call_internal_p (gs))
2169 return NULL_TREE;
2170 return gs->gimple_call.u.fntype;
2173 /* Set the type of the function called by GS to FNTYPE. */
2175 static inline void
2176 gimple_call_set_fntype (gimple gs, tree fntype)
2178 GIMPLE_CHECK (gs, GIMPLE_CALL);
2179 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2180 gs->gimple_call.u.fntype = fntype;
2184 /* Return the tree node representing the function called by call
2185 statement GS. */
2187 static inline tree
2188 gimple_call_fn (const_gimple gs)
2190 GIMPLE_CHECK (gs, GIMPLE_CALL);
2191 return gimple_op (gs, 1);
2194 /* Return a pointer to the tree node representing the function called by call
2195 statement GS. */
2197 static inline tree *
2198 gimple_call_fn_ptr (const_gimple gs)
2200 GIMPLE_CHECK (gs, GIMPLE_CALL);
2201 return gimple_op_ptr (gs, 1);
2205 /* Set FN to be the function called by call statement GS. */
2207 static inline void
2208 gimple_call_set_fn (gimple gs, tree fn)
2210 GIMPLE_CHECK (gs, GIMPLE_CALL);
2211 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2212 gimple_set_op (gs, 1, fn);
2216 /* Set FNDECL to be the function called by call statement GS. */
2218 static inline void
2219 gimple_call_set_fndecl (gimple gs, tree decl)
2221 GIMPLE_CHECK (gs, GIMPLE_CALL);
2222 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2223 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
2227 /* Set internal function FN to be the function called by call statement GS. */
2229 static inline void
2230 gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
2232 GIMPLE_CHECK (gs, GIMPLE_CALL);
2233 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2234 gs->gimple_call.u.internal_fn = fn;
2238 /* Given a valid GIMPLE_CALL function address return the FUNCTION_DECL
2239 associated with the callee if known. Otherwise return NULL_TREE. */
2241 static inline tree
2242 gimple_call_addr_fndecl (const_tree fn)
2244 if (fn && TREE_CODE (fn) == ADDR_EXPR)
2246 tree fndecl = TREE_OPERAND (fn, 0);
2247 if (TREE_CODE (fndecl) == MEM_REF
2248 && TREE_CODE (TREE_OPERAND (fndecl, 0)) == ADDR_EXPR
2249 && integer_zerop (TREE_OPERAND (fndecl, 1)))
2250 fndecl = TREE_OPERAND (TREE_OPERAND (fndecl, 0), 0);
2251 if (TREE_CODE (fndecl) == FUNCTION_DECL)
2252 return fndecl;
2254 return NULL_TREE;
2257 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2258 Otherwise return NULL. This function is analogous to
2259 get_callee_fndecl in tree land. */
2261 static inline tree
2262 gimple_call_fndecl (const_gimple gs)
2264 return gimple_call_addr_fndecl (gimple_call_fn (gs));
2268 /* Return the type returned by call statement GS. */
2270 static inline tree
2271 gimple_call_return_type (const_gimple gs)
2273 tree type = gimple_call_fntype (gs);
2275 if (type == NULL_TREE)
2276 return TREE_TYPE (gimple_call_lhs (gs));
2278 /* The type returned by a function is the type of its
2279 function type. */
2280 return TREE_TYPE (type);
2284 /* Return the static chain for call statement GS. */
2286 static inline tree
2287 gimple_call_chain (const_gimple gs)
2289 GIMPLE_CHECK (gs, GIMPLE_CALL);
2290 return gimple_op (gs, 2);
2294 /* Return a pointer to the static chain for call statement GS. */
2296 static inline tree *
2297 gimple_call_chain_ptr (const_gimple gs)
2299 GIMPLE_CHECK (gs, GIMPLE_CALL);
2300 return gimple_op_ptr (gs, 2);
2303 /* Set CHAIN to be the static chain for call statement GS. */
2305 static inline void
2306 gimple_call_set_chain (gimple gs, tree chain)
2308 GIMPLE_CHECK (gs, GIMPLE_CALL);
2310 gimple_set_op (gs, 2, chain);
2314 /* Return the number of arguments used by call statement GS. */
2316 static inline unsigned
2317 gimple_call_num_args (const_gimple gs)
2319 unsigned num_ops;
2320 GIMPLE_CHECK (gs, GIMPLE_CALL);
2321 num_ops = gimple_num_ops (gs);
2322 return num_ops - 3;
2326 /* Return the argument at position INDEX for call statement GS. */
2328 static inline tree
2329 gimple_call_arg (const_gimple gs, unsigned index)
2331 GIMPLE_CHECK (gs, GIMPLE_CALL);
2332 return gimple_op (gs, index + 3);
2336 /* Return a pointer to the argument at position INDEX for call
2337 statement GS. */
2339 static inline tree *
2340 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2342 GIMPLE_CHECK (gs, GIMPLE_CALL);
2343 return gimple_op_ptr (gs, index + 3);
2347 /* Set ARG to be the argument at position INDEX for call statement GS. */
2349 static inline void
2350 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2352 GIMPLE_CHECK (gs, GIMPLE_CALL);
2353 gimple_set_op (gs, index + 3, arg);
2357 /* If TAIL_P is true, mark call statement S as being a tail call
2358 (i.e., a call just before the exit of a function). These calls are
2359 candidate for tail call optimization. */
2361 static inline void
2362 gimple_call_set_tail (gimple s, bool tail_p)
2364 GIMPLE_CHECK (s, GIMPLE_CALL);
2365 if (tail_p)
2366 s->gsbase.subcode |= GF_CALL_TAILCALL;
2367 else
2368 s->gsbase.subcode &= ~GF_CALL_TAILCALL;
2372 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2374 static inline bool
2375 gimple_call_tail_p (gimple s)
2377 GIMPLE_CHECK (s, GIMPLE_CALL);
2378 return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
2382 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2383 slot optimization. This transformation uses the target of the call
2384 expansion as the return slot for calls that return in memory. */
2386 static inline void
2387 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2389 GIMPLE_CHECK (s, GIMPLE_CALL);
2390 if (return_slot_opt_p)
2391 s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
2392 else
2393 s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2397 /* Return true if S is marked for return slot optimization. */
2399 static inline bool
2400 gimple_call_return_slot_opt_p (gimple s)
2402 GIMPLE_CHECK (s, GIMPLE_CALL);
2403 return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2407 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2408 thunk to the thunked-to function. */
2410 static inline void
2411 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2413 GIMPLE_CHECK (s, GIMPLE_CALL);
2414 if (from_thunk_p)
2415 s->gsbase.subcode |= GF_CALL_FROM_THUNK;
2416 else
2417 s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
2421 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2423 static inline bool
2424 gimple_call_from_thunk_p (gimple s)
2426 GIMPLE_CHECK (s, GIMPLE_CALL);
2427 return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
2431 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2432 argument pack in its argument list. */
2434 static inline void
2435 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2437 GIMPLE_CHECK (s, GIMPLE_CALL);
2438 if (pass_arg_pack_p)
2439 s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
2440 else
2441 s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
2445 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2446 argument pack in its argument list. */
2448 static inline bool
2449 gimple_call_va_arg_pack_p (gimple s)
2451 GIMPLE_CHECK (s, GIMPLE_CALL);
2452 return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
2456 /* Return true if S is a noreturn call. */
2458 static inline bool
2459 gimple_call_noreturn_p (gimple s)
2461 GIMPLE_CHECK (s, GIMPLE_CALL);
2462 return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2466 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2467 even if the called function can throw in other cases. */
2469 static inline void
2470 gimple_call_set_nothrow (gimple s, bool nothrow_p)
2472 GIMPLE_CHECK (s, GIMPLE_CALL);
2473 if (nothrow_p)
2474 s->gsbase.subcode |= GF_CALL_NOTHROW;
2475 else
2476 s->gsbase.subcode &= ~GF_CALL_NOTHROW;
2479 /* Return true if S is a nothrow call. */
2481 static inline bool
2482 gimple_call_nothrow_p (gimple s)
2484 GIMPLE_CHECK (s, GIMPLE_CALL);
2485 return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2488 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2489 is known to be emitted for VLA objects. Those are wrapped by
2490 stack_save/stack_restore calls and hence can't lead to unbounded
2491 stack growth even when they occur in loops. */
2493 static inline void
2494 gimple_call_set_alloca_for_var (gimple s, bool for_var)
2496 GIMPLE_CHECK (s, GIMPLE_CALL);
2497 if (for_var)
2498 s->gsbase.subcode |= GF_CALL_ALLOCA_FOR_VAR;
2499 else
2500 s->gsbase.subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
2503 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2505 static inline bool
2506 gimple_call_alloca_for_var_p (gimple s)
2508 GIMPLE_CHECK (s, GIMPLE_CALL);
2509 return (s->gsbase.subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
2512 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2514 static inline void
2515 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2517 GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2518 GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2519 dest_call->gsbase.subcode = orig_call->gsbase.subcode;
2523 /* Return a pointer to the points-to solution for the set of call-used
2524 variables of the call CALL. */
2526 static inline struct pt_solution *
2527 gimple_call_use_set (gimple call)
2529 GIMPLE_CHECK (call, GIMPLE_CALL);
2530 return &call->gimple_call.call_used;
2534 /* Return a pointer to the points-to solution for the set of call-used
2535 variables of the call CALL. */
2537 static inline struct pt_solution *
2538 gimple_call_clobber_set (gimple call)
2540 GIMPLE_CHECK (call, GIMPLE_CALL);
2541 return &call->gimple_call.call_clobbered;
2545 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2546 non-NULL lhs. */
2548 static inline bool
2549 gimple_has_lhs (gimple stmt)
2551 return (is_gimple_assign (stmt)
2552 || (is_gimple_call (stmt)
2553 && gimple_call_lhs (stmt) != NULL_TREE));
2557 /* Return the code of the predicate computed by conditional statement GS. */
2559 static inline enum tree_code
2560 gimple_cond_code (const_gimple gs)
2562 GIMPLE_CHECK (gs, GIMPLE_COND);
2563 return (enum tree_code) gs->gsbase.subcode;
2567 /* Set CODE to be the predicate code for the conditional statement GS. */
2569 static inline void
2570 gimple_cond_set_code (gimple gs, enum tree_code code)
2572 GIMPLE_CHECK (gs, GIMPLE_COND);
2573 gs->gsbase.subcode = code;
2577 /* Return the LHS of the predicate computed by conditional statement GS. */
2579 static inline tree
2580 gimple_cond_lhs (const_gimple gs)
2582 GIMPLE_CHECK (gs, GIMPLE_COND);
2583 return gimple_op (gs, 0);
2586 /* Return the pointer to the LHS of the predicate computed by conditional
2587 statement GS. */
2589 static inline tree *
2590 gimple_cond_lhs_ptr (const_gimple gs)
2592 GIMPLE_CHECK (gs, GIMPLE_COND);
2593 return gimple_op_ptr (gs, 0);
2596 /* Set LHS to be the LHS operand of the predicate computed by
2597 conditional statement GS. */
2599 static inline void
2600 gimple_cond_set_lhs (gimple gs, tree lhs)
2602 GIMPLE_CHECK (gs, GIMPLE_COND);
2603 gimple_set_op (gs, 0, lhs);
2607 /* Return the RHS operand of the predicate computed by conditional GS. */
2609 static inline tree
2610 gimple_cond_rhs (const_gimple gs)
2612 GIMPLE_CHECK (gs, GIMPLE_COND);
2613 return gimple_op (gs, 1);
2616 /* Return the pointer to the RHS operand of the predicate computed by
2617 conditional GS. */
2619 static inline tree *
2620 gimple_cond_rhs_ptr (const_gimple gs)
2622 GIMPLE_CHECK (gs, GIMPLE_COND);
2623 return gimple_op_ptr (gs, 1);
2627 /* Set RHS to be the RHS operand of the predicate computed by
2628 conditional statement GS. */
2630 static inline void
2631 gimple_cond_set_rhs (gimple gs, tree rhs)
2633 GIMPLE_CHECK (gs, GIMPLE_COND);
2634 gimple_set_op (gs, 1, rhs);
2638 /* Return the label used by conditional statement GS when its
2639 predicate evaluates to true. */
2641 static inline tree
2642 gimple_cond_true_label (const_gimple gs)
2644 GIMPLE_CHECK (gs, GIMPLE_COND);
2645 return gimple_op (gs, 2);
2649 /* Set LABEL to be the label used by conditional statement GS when its
2650 predicate evaluates to true. */
2652 static inline void
2653 gimple_cond_set_true_label (gimple gs, tree label)
2655 GIMPLE_CHECK (gs, GIMPLE_COND);
2656 gimple_set_op (gs, 2, label);
2660 /* Set LABEL to be the label used by conditional statement GS when its
2661 predicate evaluates to false. */
2663 static inline void
2664 gimple_cond_set_false_label (gimple gs, tree label)
2666 GIMPLE_CHECK (gs, GIMPLE_COND);
2667 gimple_set_op (gs, 3, label);
2671 /* Return the label used by conditional statement GS when its
2672 predicate evaluates to false. */
2674 static inline tree
2675 gimple_cond_false_label (const_gimple gs)
2677 GIMPLE_CHECK (gs, GIMPLE_COND);
2678 return gimple_op (gs, 3);
2682 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
2684 static inline void
2685 gimple_cond_make_false (gimple gs)
2687 gimple_cond_set_lhs (gs, boolean_true_node);
2688 gimple_cond_set_rhs (gs, boolean_false_node);
2689 gs->gsbase.subcode = EQ_EXPR;
2693 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
2695 static inline void
2696 gimple_cond_make_true (gimple gs)
2698 gimple_cond_set_lhs (gs, boolean_true_node);
2699 gimple_cond_set_rhs (gs, boolean_true_node);
2700 gs->gsbase.subcode = EQ_EXPR;
2703 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2704 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2706 static inline bool
2707 gimple_cond_true_p (const_gimple gs)
2709 tree lhs = gimple_cond_lhs (gs);
2710 tree rhs = gimple_cond_rhs (gs);
2711 enum tree_code code = gimple_cond_code (gs);
2713 if (lhs != boolean_true_node && lhs != boolean_false_node)
2714 return false;
2716 if (rhs != boolean_true_node && rhs != boolean_false_node)
2717 return false;
2719 if (code == NE_EXPR && lhs != rhs)
2720 return true;
2722 if (code == EQ_EXPR && lhs == rhs)
2723 return true;
2725 return false;
2728 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2729 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2731 static inline bool
2732 gimple_cond_false_p (const_gimple gs)
2734 tree lhs = gimple_cond_lhs (gs);
2735 tree rhs = gimple_cond_rhs (gs);
2736 enum tree_code code = gimple_cond_code (gs);
2738 if (lhs != boolean_true_node && lhs != boolean_false_node)
2739 return false;
2741 if (rhs != boolean_true_node && rhs != boolean_false_node)
2742 return false;
2744 if (code == NE_EXPR && lhs == rhs)
2745 return true;
2747 if (code == EQ_EXPR && lhs != rhs)
2748 return true;
2750 return false;
2753 /* Check if conditional statement GS is of the form 'if (var != 0)' or
2754 'if (var == 1)' */
2756 static inline bool
2757 gimple_cond_single_var_p (gimple gs)
2759 if (gimple_cond_code (gs) == NE_EXPR
2760 && gimple_cond_rhs (gs) == boolean_false_node)
2761 return true;
2763 if (gimple_cond_code (gs) == EQ_EXPR
2764 && gimple_cond_rhs (gs) == boolean_true_node)
2765 return true;
2767 return false;
2770 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
2772 static inline void
2773 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2775 gimple_cond_set_code (stmt, code);
2776 gimple_cond_set_lhs (stmt, lhs);
2777 gimple_cond_set_rhs (stmt, rhs);
2780 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
2782 static inline tree
2783 gimple_label_label (const_gimple gs)
2785 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2786 return gimple_op (gs, 0);
2790 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2791 GS. */
2793 static inline void
2794 gimple_label_set_label (gimple gs, tree label)
2796 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2797 gimple_set_op (gs, 0, label);
2801 /* Return the destination of the unconditional jump GS. */
2803 static inline tree
2804 gimple_goto_dest (const_gimple gs)
2806 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2807 return gimple_op (gs, 0);
2811 /* Set DEST to be the destination of the unconditonal jump GS. */
2813 static inline void
2814 gimple_goto_set_dest (gimple gs, tree dest)
2816 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2817 gimple_set_op (gs, 0, dest);
2821 /* Return the variables declared in the GIMPLE_BIND statement GS. */
2823 static inline tree
2824 gimple_bind_vars (const_gimple gs)
2826 GIMPLE_CHECK (gs, GIMPLE_BIND);
2827 return gs->gimple_bind.vars;
2831 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2832 statement GS. */
2834 static inline void
2835 gimple_bind_set_vars (gimple gs, tree vars)
2837 GIMPLE_CHECK (gs, GIMPLE_BIND);
2838 gs->gimple_bind.vars = vars;
2842 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2843 statement GS. */
2845 static inline void
2846 gimple_bind_append_vars (gimple gs, tree vars)
2848 GIMPLE_CHECK (gs, GIMPLE_BIND);
2849 gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
2853 static inline gimple_seq *
2854 gimple_bind_body_ptr (gimple gs)
2856 GIMPLE_CHECK (gs, GIMPLE_BIND);
2857 return &gs->gimple_bind.body;
2860 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
2862 static inline gimple_seq
2863 gimple_bind_body (gimple gs)
2865 return *gimple_bind_body_ptr (gs);
2869 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
2870 statement GS. */
2872 static inline void
2873 gimple_bind_set_body (gimple gs, gimple_seq seq)
2875 GIMPLE_CHECK (gs, GIMPLE_BIND);
2876 gs->gimple_bind.body = seq;
2880 /* Append a statement to the end of a GIMPLE_BIND's body. */
2882 static inline void
2883 gimple_bind_add_stmt (gimple gs, gimple stmt)
2885 GIMPLE_CHECK (gs, GIMPLE_BIND);
2886 gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
2890 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
2892 static inline void
2893 gimple_bind_add_seq (gimple gs, gimple_seq seq)
2895 GIMPLE_CHECK (gs, GIMPLE_BIND);
2896 gimple_seq_add_seq (&gs->gimple_bind.body, seq);
2900 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
2901 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
2903 static inline tree
2904 gimple_bind_block (const_gimple gs)
2906 GIMPLE_CHECK (gs, GIMPLE_BIND);
2907 return gs->gimple_bind.block;
2911 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
2912 statement GS. */
2914 static inline void
2915 gimple_bind_set_block (gimple gs, tree block)
2917 GIMPLE_CHECK (gs, GIMPLE_BIND);
2918 gcc_gimple_checking_assert (block == NULL_TREE
2919 || TREE_CODE (block) == BLOCK);
2920 gs->gimple_bind.block = block;
2924 /* Return the number of input operands for GIMPLE_ASM GS. */
2926 static inline unsigned
2927 gimple_asm_ninputs (const_gimple gs)
2929 GIMPLE_CHECK (gs, GIMPLE_ASM);
2930 return gs->gimple_asm.ni;
2934 /* Return the number of output operands for GIMPLE_ASM GS. */
2936 static inline unsigned
2937 gimple_asm_noutputs (const_gimple gs)
2939 GIMPLE_CHECK (gs, GIMPLE_ASM);
2940 return gs->gimple_asm.no;
2944 /* Return the number of clobber operands for GIMPLE_ASM GS. */
2946 static inline unsigned
2947 gimple_asm_nclobbers (const_gimple gs)
2949 GIMPLE_CHECK (gs, GIMPLE_ASM);
2950 return gs->gimple_asm.nc;
2953 /* Return the number of label operands for GIMPLE_ASM GS. */
2955 static inline unsigned
2956 gimple_asm_nlabels (const_gimple gs)
2958 GIMPLE_CHECK (gs, GIMPLE_ASM);
2959 return gs->gimple_asm.nl;
2962 /* Return input operand INDEX of GIMPLE_ASM GS. */
2964 static inline tree
2965 gimple_asm_input_op (const_gimple gs, unsigned index)
2967 GIMPLE_CHECK (gs, GIMPLE_ASM);
2968 gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
2969 return gimple_op (gs, index + gs->gimple_asm.no);
2972 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
2974 static inline tree *
2975 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
2977 GIMPLE_CHECK (gs, GIMPLE_ASM);
2978 gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
2979 return gimple_op_ptr (gs, index + gs->gimple_asm.no);
2983 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
2985 static inline void
2986 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
2988 GIMPLE_CHECK (gs, GIMPLE_ASM);
2989 gcc_gimple_checking_assert (index < gs->gimple_asm.ni
2990 && TREE_CODE (in_op) == TREE_LIST);
2991 gimple_set_op (gs, index + gs->gimple_asm.no, in_op);
2995 /* Return output operand INDEX of GIMPLE_ASM GS. */
2997 static inline tree
2998 gimple_asm_output_op (const_gimple gs, unsigned index)
3000 GIMPLE_CHECK (gs, GIMPLE_ASM);
3001 gcc_gimple_checking_assert (index < gs->gimple_asm.no);
3002 return gimple_op (gs, index);
3005 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
3007 static inline tree *
3008 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
3010 GIMPLE_CHECK (gs, GIMPLE_ASM);
3011 gcc_gimple_checking_assert (index < gs->gimple_asm.no);
3012 return gimple_op_ptr (gs, index);
3016 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
3018 static inline void
3019 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
3021 GIMPLE_CHECK (gs, GIMPLE_ASM);
3022 gcc_gimple_checking_assert (index < gs->gimple_asm.no
3023 && TREE_CODE (out_op) == TREE_LIST);
3024 gimple_set_op (gs, index, out_op);
3028 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3030 static inline tree
3031 gimple_asm_clobber_op (const_gimple gs, unsigned index)
3033 GIMPLE_CHECK (gs, GIMPLE_ASM);
3034 gcc_gimple_checking_assert (index < gs->gimple_asm.nc);
3035 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
3039 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3041 static inline void
3042 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
3044 GIMPLE_CHECK (gs, GIMPLE_ASM);
3045 gcc_gimple_checking_assert (index < gs->gimple_asm.nc
3046 && TREE_CODE (clobber_op) == TREE_LIST);
3047 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
3050 /* Return label operand INDEX of GIMPLE_ASM GS. */
3052 static inline tree
3053 gimple_asm_label_op (const_gimple gs, unsigned index)
3055 GIMPLE_CHECK (gs, GIMPLE_ASM);
3056 gcc_gimple_checking_assert (index < gs->gimple_asm.nl);
3057 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
3060 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3062 static inline void
3063 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
3065 GIMPLE_CHECK (gs, GIMPLE_ASM);
3066 gcc_gimple_checking_assert (index < gs->gimple_asm.nl
3067 && TREE_CODE (label_op) == TREE_LIST);
3068 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
3071 /* Return the string representing the assembly instruction in
3072 GIMPLE_ASM GS. */
3074 static inline const char *
3075 gimple_asm_string (const_gimple gs)
3077 GIMPLE_CHECK (gs, GIMPLE_ASM);
3078 return gs->gimple_asm.string;
3082 /* Return true if GS is an asm statement marked volatile. */
3084 static inline bool
3085 gimple_asm_volatile_p (const_gimple gs)
3087 GIMPLE_CHECK (gs, GIMPLE_ASM);
3088 return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
3092 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3094 static inline void
3095 gimple_asm_set_volatile (gimple gs, bool volatile_p)
3097 GIMPLE_CHECK (gs, GIMPLE_ASM);
3098 if (volatile_p)
3099 gs->gsbase.subcode |= GF_ASM_VOLATILE;
3100 else
3101 gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
3105 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3107 static inline void
3108 gimple_asm_set_input (gimple gs, bool input_p)
3110 GIMPLE_CHECK (gs, GIMPLE_ASM);
3111 if (input_p)
3112 gs->gsbase.subcode |= GF_ASM_INPUT;
3113 else
3114 gs->gsbase.subcode &= ~GF_ASM_INPUT;
3118 /* Return true if asm GS is an ASM_INPUT. */
3120 static inline bool
3121 gimple_asm_input_p (const_gimple gs)
3123 GIMPLE_CHECK (gs, GIMPLE_ASM);
3124 return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
3128 /* Return the types handled by GIMPLE_CATCH statement GS. */
3130 static inline tree
3131 gimple_catch_types (const_gimple gs)
3133 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3134 return gs->gimple_catch.types;
3138 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3140 static inline tree *
3141 gimple_catch_types_ptr (gimple gs)
3143 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3144 return &gs->gimple_catch.types;
3148 /* Return a pointer to the GIMPLE sequence representing the body of
3149 the handler of GIMPLE_CATCH statement GS. */
3151 static inline gimple_seq *
3152 gimple_catch_handler_ptr (gimple gs)
3154 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3155 return &gs->gimple_catch.handler;
3159 /* Return the GIMPLE sequence representing the body of the handler of
3160 GIMPLE_CATCH statement GS. */
3162 static inline gimple_seq
3163 gimple_catch_handler (gimple gs)
3165 return *gimple_catch_handler_ptr (gs);
3169 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3171 static inline void
3172 gimple_catch_set_types (gimple gs, tree t)
3174 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3175 gs->gimple_catch.types = t;
3179 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3181 static inline void
3182 gimple_catch_set_handler (gimple gs, gimple_seq handler)
3184 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3185 gs->gimple_catch.handler = handler;
3189 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3191 static inline tree
3192 gimple_eh_filter_types (const_gimple gs)
3194 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3195 return gs->gimple_eh_filter.types;
3199 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3200 GS. */
3202 static inline tree *
3203 gimple_eh_filter_types_ptr (gimple gs)
3205 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3206 return &gs->gimple_eh_filter.types;
3210 /* Return a pointer to the sequence of statement to execute when
3211 GIMPLE_EH_FILTER statement fails. */
3213 static inline gimple_seq *
3214 gimple_eh_filter_failure_ptr (gimple gs)
3216 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3217 return &gs->gimple_eh_filter.failure;
3221 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3222 statement fails. */
3224 static inline gimple_seq
3225 gimple_eh_filter_failure (gimple gs)
3227 return *gimple_eh_filter_failure_ptr (gs);
3231 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3233 static inline void
3234 gimple_eh_filter_set_types (gimple gs, tree types)
3236 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3237 gs->gimple_eh_filter.types = types;
3241 /* Set FAILURE to be the sequence of statements to execute on failure
3242 for GIMPLE_EH_FILTER GS. */
3244 static inline void
3245 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
3247 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3248 gs->gimple_eh_filter.failure = failure;
3251 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3253 static inline tree
3254 gimple_eh_must_not_throw_fndecl (gimple gs)
3256 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3257 return gs->gimple_eh_mnt.fndecl;
3260 /* Set the function decl to be called by GS to DECL. */
3262 static inline void
3263 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
3265 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3266 gs->gimple_eh_mnt.fndecl = decl;
3269 /* GIMPLE_EH_ELSE accessors. */
3271 static inline gimple_seq *
3272 gimple_eh_else_n_body_ptr (gimple gs)
3274 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3275 return &gs->gimple_eh_else.n_body;
3278 static inline gimple_seq
3279 gimple_eh_else_n_body (gimple gs)
3281 return *gimple_eh_else_n_body_ptr (gs);
3284 static inline gimple_seq *
3285 gimple_eh_else_e_body_ptr (gimple gs)
3287 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3288 return &gs->gimple_eh_else.e_body;
3291 static inline gimple_seq
3292 gimple_eh_else_e_body (gimple gs)
3294 return *gimple_eh_else_e_body_ptr (gs);
3297 static inline void
3298 gimple_eh_else_set_n_body (gimple gs, gimple_seq seq)
3300 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3301 gs->gimple_eh_else.n_body = seq;
3304 static inline void
3305 gimple_eh_else_set_e_body (gimple gs, gimple_seq seq)
3307 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3308 gs->gimple_eh_else.e_body = seq;
3311 /* GIMPLE_TRY accessors. */
3313 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3314 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3316 static inline enum gimple_try_flags
3317 gimple_try_kind (const_gimple gs)
3319 GIMPLE_CHECK (gs, GIMPLE_TRY);
3320 return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
3324 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3326 static inline void
3327 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
3329 GIMPLE_CHECK (gs, GIMPLE_TRY);
3330 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
3331 || kind == GIMPLE_TRY_FINALLY);
3332 if (gimple_try_kind (gs) != kind)
3333 gs->gsbase.subcode = (unsigned int) kind;
3337 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3339 static inline bool
3340 gimple_try_catch_is_cleanup (const_gimple gs)
3342 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
3343 return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3347 /* Return a pointer to the sequence of statements used as the
3348 body for GIMPLE_TRY GS. */
3350 static inline gimple_seq *
3351 gimple_try_eval_ptr (gimple gs)
3353 GIMPLE_CHECK (gs, GIMPLE_TRY);
3354 return &gs->gimple_try.eval;
3358 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3360 static inline gimple_seq
3361 gimple_try_eval (gimple gs)
3363 return *gimple_try_eval_ptr (gs);
3367 /* Return a pointer to the sequence of statements used as the cleanup body for
3368 GIMPLE_TRY GS. */
3370 static inline gimple_seq *
3371 gimple_try_cleanup_ptr (gimple gs)
3373 GIMPLE_CHECK (gs, GIMPLE_TRY);
3374 return &gs->gimple_try.cleanup;
3378 /* Return the sequence of statements used as the cleanup body for
3379 GIMPLE_TRY GS. */
3381 static inline gimple_seq
3382 gimple_try_cleanup (gimple gs)
3384 return *gimple_try_cleanup_ptr (gs);
3388 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3390 static inline void
3391 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3393 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3394 if (catch_is_cleanup)
3395 g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3396 else
3397 g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3401 /* Set EVAL to be the sequence of statements to use as the body for
3402 GIMPLE_TRY GS. */
3404 static inline void
3405 gimple_try_set_eval (gimple gs, gimple_seq eval)
3407 GIMPLE_CHECK (gs, GIMPLE_TRY);
3408 gs->gimple_try.eval = eval;
3412 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3413 body for GIMPLE_TRY GS. */
3415 static inline void
3416 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3418 GIMPLE_CHECK (gs, GIMPLE_TRY);
3419 gs->gimple_try.cleanup = cleanup;
3423 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3425 static inline gimple_seq *
3426 gimple_wce_cleanup_ptr (gimple gs)
3428 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3429 return &gs->gimple_wce.cleanup;
3433 /* Return the cleanup sequence for cleanup statement GS. */
3435 static inline gimple_seq
3436 gimple_wce_cleanup (gimple gs)
3438 return *gimple_wce_cleanup_ptr (gs);
3442 /* Set CLEANUP to be the cleanup sequence for GS. */
3444 static inline void
3445 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3447 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3448 gs->gimple_wce.cleanup = cleanup;
3452 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3454 static inline bool
3455 gimple_wce_cleanup_eh_only (const_gimple gs)
3457 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3458 return gs->gsbase.subcode != 0;
3462 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3464 static inline void
3465 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3467 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3468 gs->gsbase.subcode = (unsigned int) eh_only_p;
3472 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3474 static inline unsigned
3475 gimple_phi_capacity (const_gimple gs)
3477 GIMPLE_CHECK (gs, GIMPLE_PHI);
3478 return gs->gimple_phi.capacity;
3482 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3483 be exactly the number of incoming edges for the basic block holding
3484 GS. */
3486 static inline unsigned
3487 gimple_phi_num_args (const_gimple gs)
3489 GIMPLE_CHECK (gs, GIMPLE_PHI);
3490 return gs->gimple_phi.nargs;
3494 /* Return the SSA name created by GIMPLE_PHI GS. */
3496 static inline tree
3497 gimple_phi_result (const_gimple gs)
3499 GIMPLE_CHECK (gs, GIMPLE_PHI);
3500 return gs->gimple_phi.result;
3503 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3505 static inline tree *
3506 gimple_phi_result_ptr (gimple gs)
3508 GIMPLE_CHECK (gs, GIMPLE_PHI);
3509 return &gs->gimple_phi.result;
3512 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3514 static inline void
3515 gimple_phi_set_result (gimple gs, tree result)
3517 GIMPLE_CHECK (gs, GIMPLE_PHI);
3518 gs->gimple_phi.result = result;
3519 if (result && TREE_CODE (result) == SSA_NAME)
3520 SSA_NAME_DEF_STMT (result) = gs;
3524 /* Return the PHI argument corresponding to incoming edge INDEX for
3525 GIMPLE_PHI GS. */
3527 static inline struct phi_arg_d *
3528 gimple_phi_arg (gimple gs, unsigned index)
3530 GIMPLE_CHECK (gs, GIMPLE_PHI);
3531 gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
3532 return &(gs->gimple_phi.args[index]);
3535 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3536 for GIMPLE_PHI GS. */
3538 static inline void
3539 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3541 GIMPLE_CHECK (gs, GIMPLE_PHI);
3542 gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
3543 gs->gimple_phi.args[index] = *phiarg;
3546 /* Return the region number for GIMPLE_RESX GS. */
3548 static inline int
3549 gimple_resx_region (const_gimple gs)
3551 GIMPLE_CHECK (gs, GIMPLE_RESX);
3552 return gs->gimple_eh_ctrl.region;
3555 /* Set REGION to be the region number for GIMPLE_RESX GS. */
3557 static inline void
3558 gimple_resx_set_region (gimple gs, int region)
3560 GIMPLE_CHECK (gs, GIMPLE_RESX);
3561 gs->gimple_eh_ctrl.region = region;
3564 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
3566 static inline int
3567 gimple_eh_dispatch_region (const_gimple gs)
3569 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3570 return gs->gimple_eh_ctrl.region;
3573 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
3575 static inline void
3576 gimple_eh_dispatch_set_region (gimple gs, int region)
3578 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3579 gs->gimple_eh_ctrl.region = region;
3582 /* Return the number of labels associated with the switch statement GS. */
3584 static inline unsigned
3585 gimple_switch_num_labels (const_gimple gs)
3587 unsigned num_ops;
3588 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3589 num_ops = gimple_num_ops (gs);
3590 gcc_gimple_checking_assert (num_ops > 1);
3591 return num_ops - 1;
3595 /* Set NLABELS to be the number of labels for the switch statement GS. */
3597 static inline void
3598 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3600 GIMPLE_CHECK (g, GIMPLE_SWITCH);
3601 gimple_set_num_ops (g, nlabels + 1);
3605 /* Return the index variable used by the switch statement GS. */
3607 static inline tree
3608 gimple_switch_index (const_gimple gs)
3610 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3611 return gimple_op (gs, 0);
3615 /* Return a pointer to the index variable for the switch statement GS. */
3617 static inline tree *
3618 gimple_switch_index_ptr (const_gimple gs)
3620 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3621 return gimple_op_ptr (gs, 0);
3625 /* Set INDEX to be the index variable for switch statement GS. */
3627 static inline void
3628 gimple_switch_set_index (gimple gs, tree index)
3630 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3631 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3632 gimple_set_op (gs, 0, index);
3636 /* Return the label numbered INDEX. The default label is 0, followed by any
3637 labels in a switch statement. */
3639 static inline tree
3640 gimple_switch_label (const_gimple gs, unsigned index)
3642 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3643 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
3644 return gimple_op (gs, index + 1);
3647 /* Set the label number INDEX to LABEL. 0 is always the default label. */
3649 static inline void
3650 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3652 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3653 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
3654 && (label == NULL_TREE
3655 || TREE_CODE (label) == CASE_LABEL_EXPR));
3656 gimple_set_op (gs, index + 1, label);
3659 /* Return the default label for a switch statement. */
3661 static inline tree
3662 gimple_switch_default_label (const_gimple gs)
3664 tree label = gimple_switch_label (gs, 0);
3665 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3666 return label;
3669 /* Set the default label for a switch statement. */
3671 static inline void
3672 gimple_switch_set_default_label (gimple gs, tree label)
3674 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3675 gimple_switch_set_label (gs, 0, label);
3678 /* Return true if GS is a GIMPLE_DEBUG statement. */
3680 static inline bool
3681 is_gimple_debug (const_gimple gs)
3683 return gimple_code (gs) == GIMPLE_DEBUG;
3686 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
3688 static inline bool
3689 gimple_debug_bind_p (const_gimple s)
3691 if (is_gimple_debug (s))
3692 return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
3694 return false;
3697 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
3699 static inline tree
3700 gimple_debug_bind_get_var (gimple dbg)
3702 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3703 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3704 return gimple_op (dbg, 0);
3707 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3708 statement. */
3710 static inline tree
3711 gimple_debug_bind_get_value (gimple dbg)
3713 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3714 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3715 return gimple_op (dbg, 1);
3718 /* Return a pointer to the value bound to the variable in a
3719 GIMPLE_DEBUG bind statement. */
3721 static inline tree *
3722 gimple_debug_bind_get_value_ptr (gimple dbg)
3724 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3725 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3726 return gimple_op_ptr (dbg, 1);
3729 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
3731 static inline void
3732 gimple_debug_bind_set_var (gimple dbg, tree var)
3734 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3735 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3736 gimple_set_op (dbg, 0, var);
3739 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3740 statement. */
3742 static inline void
3743 gimple_debug_bind_set_value (gimple dbg, tree value)
3745 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3746 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3747 gimple_set_op (dbg, 1, value);
3750 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
3751 optimized away. */
3752 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
3754 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
3755 statement. */
3757 static inline void
3758 gimple_debug_bind_reset_value (gimple dbg)
3760 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3761 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3762 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
3765 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
3766 value. */
3768 static inline bool
3769 gimple_debug_bind_has_value_p (gimple dbg)
3771 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3772 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3773 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
3776 #undef GIMPLE_DEBUG_BIND_NOVALUE
3778 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
3780 static inline bool
3781 gimple_debug_source_bind_p (const_gimple s)
3783 if (is_gimple_debug (s))
3784 return s->gsbase.subcode == GIMPLE_DEBUG_SOURCE_BIND;
3786 return false;
3789 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
3791 static inline tree
3792 gimple_debug_source_bind_get_var (gimple dbg)
3794 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3795 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3796 return gimple_op (dbg, 0);
3799 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
3800 statement. */
3802 static inline tree
3803 gimple_debug_source_bind_get_value (gimple dbg)
3805 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3806 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3807 return gimple_op (dbg, 1);
3810 /* Return a pointer to the value bound to the variable in a
3811 GIMPLE_DEBUG source bind statement. */
3813 static inline tree *
3814 gimple_debug_source_bind_get_value_ptr (gimple dbg)
3816 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3817 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3818 return gimple_op_ptr (dbg, 1);
3821 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
3823 static inline void
3824 gimple_debug_source_bind_set_var (gimple dbg, tree var)
3826 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3827 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3828 gimple_set_op (dbg, 0, var);
3831 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
3832 statement. */
3834 static inline void
3835 gimple_debug_source_bind_set_value (gimple dbg, tree value)
3837 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3838 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3839 gimple_set_op (dbg, 1, value);
3842 /* Return a pointer to the body for the OMP statement GS. */
3844 static inline gimple_seq *
3845 gimple_omp_body_ptr (gimple gs)
3847 return &gs->omp.body;
3850 /* Return the body for the OMP statement GS. */
3852 static inline gimple_seq
3853 gimple_omp_body (gimple gs)
3855 return *gimple_omp_body_ptr (gs);
3858 /* Set BODY to be the body for the OMP statement GS. */
3860 static inline void
3861 gimple_omp_set_body (gimple gs, gimple_seq body)
3863 gs->omp.body = body;
3867 /* Return the name associated with OMP_CRITICAL statement GS. */
3869 static inline tree
3870 gimple_omp_critical_name (const_gimple gs)
3872 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3873 return gs->gimple_omp_critical.name;
3877 /* Return a pointer to the name associated with OMP critical statement GS. */
3879 static inline tree *
3880 gimple_omp_critical_name_ptr (gimple gs)
3882 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3883 return &gs->gimple_omp_critical.name;
3887 /* Set NAME to be the name associated with OMP critical statement GS. */
3889 static inline void
3890 gimple_omp_critical_set_name (gimple gs, tree name)
3892 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3893 gs->gimple_omp_critical.name = name;
3897 /* Return the clauses associated with OMP_FOR GS. */
3899 static inline tree
3900 gimple_omp_for_clauses (const_gimple gs)
3902 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3903 return gs->gimple_omp_for.clauses;
3907 /* Return a pointer to the OMP_FOR GS. */
3909 static inline tree *
3910 gimple_omp_for_clauses_ptr (gimple gs)
3912 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3913 return &gs->gimple_omp_for.clauses;
3917 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
3919 static inline void
3920 gimple_omp_for_set_clauses (gimple gs, tree clauses)
3922 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3923 gs->gimple_omp_for.clauses = clauses;
3927 /* Get the collapse count of OMP_FOR GS. */
3929 static inline size_t
3930 gimple_omp_for_collapse (gimple gs)
3932 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3933 return gs->gimple_omp_for.collapse;
3937 /* Return the index variable for OMP_FOR GS. */
3939 static inline tree
3940 gimple_omp_for_index (const_gimple gs, size_t i)
3942 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3943 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3944 return gs->gimple_omp_for.iter[i].index;
3948 /* Return a pointer to the index variable for OMP_FOR GS. */
3950 static inline tree *
3951 gimple_omp_for_index_ptr (gimple gs, size_t i)
3953 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3954 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3955 return &gs->gimple_omp_for.iter[i].index;
3959 /* Set INDEX to be the index variable for OMP_FOR GS. */
3961 static inline void
3962 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
3964 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3965 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3966 gs->gimple_omp_for.iter[i].index = index;
3970 /* Return the initial value for OMP_FOR GS. */
3972 static inline tree
3973 gimple_omp_for_initial (const_gimple gs, size_t i)
3975 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3976 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3977 return gs->gimple_omp_for.iter[i].initial;
3981 /* Return a pointer to the initial value for OMP_FOR GS. */
3983 static inline tree *
3984 gimple_omp_for_initial_ptr (gimple gs, size_t i)
3986 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3987 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3988 return &gs->gimple_omp_for.iter[i].initial;
3992 /* Set INITIAL to be the initial value for OMP_FOR GS. */
3994 static inline void
3995 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
3997 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3998 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3999 gs->gimple_omp_for.iter[i].initial = initial;
4003 /* Return the final value for OMP_FOR GS. */
4005 static inline tree
4006 gimple_omp_for_final (const_gimple gs, size_t i)
4008 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4009 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4010 return gs->gimple_omp_for.iter[i].final;
4014 /* Return a pointer to the final value for OMP_FOR GS. */
4016 static inline tree *
4017 gimple_omp_for_final_ptr (gimple gs, size_t i)
4019 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4020 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4021 return &gs->gimple_omp_for.iter[i].final;
4025 /* Set FINAL to be the final value for OMP_FOR GS. */
4027 static inline void
4028 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
4030 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4031 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4032 gs->gimple_omp_for.iter[i].final = final;
4036 /* Return the increment value for OMP_FOR GS. */
4038 static inline tree
4039 gimple_omp_for_incr (const_gimple gs, size_t i)
4041 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4042 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4043 return gs->gimple_omp_for.iter[i].incr;
4047 /* Return a pointer to the increment value for OMP_FOR GS. */
4049 static inline tree *
4050 gimple_omp_for_incr_ptr (gimple gs, size_t i)
4052 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4053 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4054 return &gs->gimple_omp_for.iter[i].incr;
4058 /* Set INCR to be the increment value for OMP_FOR GS. */
4060 static inline void
4061 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
4063 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4064 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4065 gs->gimple_omp_for.iter[i].incr = incr;
4069 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4070 statement GS starts. */
4072 static inline gimple_seq *
4073 gimple_omp_for_pre_body_ptr (gimple gs)
4075 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4076 return &gs->gimple_omp_for.pre_body;
4080 /* Return the sequence of statements to execute before the OMP_FOR
4081 statement GS starts. */
4083 static inline gimple_seq
4084 gimple_omp_for_pre_body (gimple gs)
4086 return *gimple_omp_for_pre_body_ptr (gs);
4090 /* Set PRE_BODY to be the sequence of statements to execute before the
4091 OMP_FOR statement GS starts. */
4093 static inline void
4094 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
4096 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4097 gs->gimple_omp_for.pre_body = pre_body;
4101 /* Return the clauses associated with OMP_PARALLEL GS. */
4103 static inline tree
4104 gimple_omp_parallel_clauses (const_gimple gs)
4106 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4107 return gs->gimple_omp_parallel.clauses;
4111 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4113 static inline tree *
4114 gimple_omp_parallel_clauses_ptr (gimple gs)
4116 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4117 return &gs->gimple_omp_parallel.clauses;
4121 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4122 GS. */
4124 static inline void
4125 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
4127 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4128 gs->gimple_omp_parallel.clauses = clauses;
4132 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4134 static inline tree
4135 gimple_omp_parallel_child_fn (const_gimple gs)
4137 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4138 return gs->gimple_omp_parallel.child_fn;
4141 /* Return a pointer to the child function used to hold the body of
4142 OMP_PARALLEL GS. */
4144 static inline tree *
4145 gimple_omp_parallel_child_fn_ptr (gimple gs)
4147 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4148 return &gs->gimple_omp_parallel.child_fn;
4152 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4154 static inline void
4155 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
4157 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4158 gs->gimple_omp_parallel.child_fn = child_fn;
4162 /* Return the artificial argument used to send variables and values
4163 from the parent to the children threads in OMP_PARALLEL GS. */
4165 static inline tree
4166 gimple_omp_parallel_data_arg (const_gimple gs)
4168 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4169 return gs->gimple_omp_parallel.data_arg;
4173 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4175 static inline tree *
4176 gimple_omp_parallel_data_arg_ptr (gimple gs)
4178 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4179 return &gs->gimple_omp_parallel.data_arg;
4183 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4185 static inline void
4186 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
4188 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4189 gs->gimple_omp_parallel.data_arg = data_arg;
4193 /* Return the clauses associated with OMP_TASK GS. */
4195 static inline tree
4196 gimple_omp_task_clauses (const_gimple gs)
4198 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4199 return gs->gimple_omp_parallel.clauses;
4203 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4205 static inline tree *
4206 gimple_omp_task_clauses_ptr (gimple gs)
4208 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4209 return &gs->gimple_omp_parallel.clauses;
4213 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4214 GS. */
4216 static inline void
4217 gimple_omp_task_set_clauses (gimple gs, tree clauses)
4219 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4220 gs->gimple_omp_parallel.clauses = clauses;
4224 /* Return the child function used to hold the body of OMP_TASK GS. */
4226 static inline tree
4227 gimple_omp_task_child_fn (const_gimple gs)
4229 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4230 return gs->gimple_omp_parallel.child_fn;
4233 /* Return a pointer to the child function used to hold the body of
4234 OMP_TASK GS. */
4236 static inline tree *
4237 gimple_omp_task_child_fn_ptr (gimple gs)
4239 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4240 return &gs->gimple_omp_parallel.child_fn;
4244 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4246 static inline void
4247 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
4249 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4250 gs->gimple_omp_parallel.child_fn = child_fn;
4254 /* Return the artificial argument used to send variables and values
4255 from the parent to the children threads in OMP_TASK GS. */
4257 static inline tree
4258 gimple_omp_task_data_arg (const_gimple gs)
4260 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4261 return gs->gimple_omp_parallel.data_arg;
4265 /* Return a pointer to the data argument for OMP_TASK GS. */
4267 static inline tree *
4268 gimple_omp_task_data_arg_ptr (gimple gs)
4270 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4271 return &gs->gimple_omp_parallel.data_arg;
4275 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4277 static inline void
4278 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
4280 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4281 gs->gimple_omp_parallel.data_arg = data_arg;
4285 /* Return the clauses associated with OMP_TASK GS. */
4287 static inline tree
4288 gimple_omp_taskreg_clauses (const_gimple gs)
4290 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4291 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4292 return gs->gimple_omp_parallel.clauses;
4296 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4298 static inline tree *
4299 gimple_omp_taskreg_clauses_ptr (gimple gs)
4301 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4302 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4303 return &gs->gimple_omp_parallel.clauses;
4307 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4308 GS. */
4310 static inline void
4311 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
4313 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4314 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4315 gs->gimple_omp_parallel.clauses = clauses;
4319 /* Return the child function used to hold the body of OMP_TASK GS. */
4321 static inline tree
4322 gimple_omp_taskreg_child_fn (const_gimple gs)
4324 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4325 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4326 return gs->gimple_omp_parallel.child_fn;
4329 /* Return a pointer to the child function used to hold the body of
4330 OMP_TASK GS. */
4332 static inline tree *
4333 gimple_omp_taskreg_child_fn_ptr (gimple gs)
4335 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4336 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4337 return &gs->gimple_omp_parallel.child_fn;
4341 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4343 static inline void
4344 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
4346 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4347 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4348 gs->gimple_omp_parallel.child_fn = child_fn;
4352 /* Return the artificial argument used to send variables and values
4353 from the parent to the children threads in OMP_TASK GS. */
4355 static inline tree
4356 gimple_omp_taskreg_data_arg (const_gimple gs)
4358 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4359 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4360 return gs->gimple_omp_parallel.data_arg;
4364 /* Return a pointer to the data argument for OMP_TASK GS. */
4366 static inline tree *
4367 gimple_omp_taskreg_data_arg_ptr (gimple gs)
4369 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4370 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4371 return &gs->gimple_omp_parallel.data_arg;
4375 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4377 static inline void
4378 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
4380 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4381 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4382 gs->gimple_omp_parallel.data_arg = data_arg;
4386 /* Return the copy function used to hold the body of OMP_TASK GS. */
4388 static inline tree
4389 gimple_omp_task_copy_fn (const_gimple gs)
4391 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4392 return gs->gimple_omp_task.copy_fn;
4395 /* Return a pointer to the copy function used to hold the body of
4396 OMP_TASK GS. */
4398 static inline tree *
4399 gimple_omp_task_copy_fn_ptr (gimple gs)
4401 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4402 return &gs->gimple_omp_task.copy_fn;
4406 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
4408 static inline void
4409 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
4411 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4412 gs->gimple_omp_task.copy_fn = copy_fn;
4416 /* Return size of the data block in bytes in OMP_TASK GS. */
4418 static inline tree
4419 gimple_omp_task_arg_size (const_gimple gs)
4421 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4422 return gs->gimple_omp_task.arg_size;
4426 /* Return a pointer to the data block size for OMP_TASK GS. */
4428 static inline tree *
4429 gimple_omp_task_arg_size_ptr (gimple gs)
4431 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4432 return &gs->gimple_omp_task.arg_size;
4436 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
4438 static inline void
4439 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
4441 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4442 gs->gimple_omp_task.arg_size = arg_size;
4446 /* Return align of the data block in bytes in OMP_TASK GS. */
4448 static inline tree
4449 gimple_omp_task_arg_align (const_gimple gs)
4451 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4452 return gs->gimple_omp_task.arg_align;
4456 /* Return a pointer to the data block align for OMP_TASK GS. */
4458 static inline tree *
4459 gimple_omp_task_arg_align_ptr (gimple gs)
4461 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4462 return &gs->gimple_omp_task.arg_align;
4466 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
4468 static inline void
4469 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4471 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4472 gs->gimple_omp_task.arg_align = arg_align;
4476 /* Return the clauses associated with OMP_SINGLE GS. */
4478 static inline tree
4479 gimple_omp_single_clauses (const_gimple gs)
4481 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4482 return gs->gimple_omp_single.clauses;
4486 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
4488 static inline tree *
4489 gimple_omp_single_clauses_ptr (gimple gs)
4491 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4492 return &gs->gimple_omp_single.clauses;
4496 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
4498 static inline void
4499 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4501 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4502 gs->gimple_omp_single.clauses = clauses;
4506 /* Return the clauses associated with OMP_SECTIONS GS. */
4508 static inline tree
4509 gimple_omp_sections_clauses (const_gimple gs)
4511 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4512 return gs->gimple_omp_sections.clauses;
4516 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
4518 static inline tree *
4519 gimple_omp_sections_clauses_ptr (gimple gs)
4521 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4522 return &gs->gimple_omp_sections.clauses;
4526 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
4527 GS. */
4529 static inline void
4530 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
4532 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4533 gs->gimple_omp_sections.clauses = clauses;
4537 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
4538 in GS. */
4540 static inline tree
4541 gimple_omp_sections_control (const_gimple gs)
4543 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4544 return gs->gimple_omp_sections.control;
4548 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
4549 GS. */
4551 static inline tree *
4552 gimple_omp_sections_control_ptr (gimple gs)
4554 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4555 return &gs->gimple_omp_sections.control;
4559 /* Set CONTROL to be the set of clauses associated with the
4560 GIMPLE_OMP_SECTIONS in GS. */
4562 static inline void
4563 gimple_omp_sections_set_control (gimple gs, tree control)
4565 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4566 gs->gimple_omp_sections.control = control;
4570 /* Set COND to be the condition code for OMP_FOR GS. */
4572 static inline void
4573 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
4575 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4576 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
4577 && i < gs->gimple_omp_for.collapse);
4578 gs->gimple_omp_for.iter[i].cond = cond;
4582 /* Return the condition code associated with OMP_FOR GS. */
4584 static inline enum tree_code
4585 gimple_omp_for_cond (const_gimple gs, size_t i)
4587 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4588 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4589 return gs->gimple_omp_for.iter[i].cond;
4593 /* Set the value being stored in an atomic store. */
4595 static inline void
4596 gimple_omp_atomic_store_set_val (gimple g, tree val)
4598 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4599 g->gimple_omp_atomic_store.val = val;
4603 /* Return the value being stored in an atomic store. */
4605 static inline tree
4606 gimple_omp_atomic_store_val (const_gimple g)
4608 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4609 return g->gimple_omp_atomic_store.val;
4613 /* Return a pointer to the value being stored in an atomic store. */
4615 static inline tree *
4616 gimple_omp_atomic_store_val_ptr (gimple g)
4618 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4619 return &g->gimple_omp_atomic_store.val;
4623 /* Set the LHS of an atomic load. */
4625 static inline void
4626 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
4628 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4629 g->gimple_omp_atomic_load.lhs = lhs;
4633 /* Get the LHS of an atomic load. */
4635 static inline tree
4636 gimple_omp_atomic_load_lhs (const_gimple g)
4638 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4639 return g->gimple_omp_atomic_load.lhs;
4643 /* Return a pointer to the LHS of an atomic load. */
4645 static inline tree *
4646 gimple_omp_atomic_load_lhs_ptr (gimple g)
4648 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4649 return &g->gimple_omp_atomic_load.lhs;
4653 /* Set the RHS of an atomic load. */
4655 static inline void
4656 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
4658 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4659 g->gimple_omp_atomic_load.rhs = rhs;
4663 /* Get the RHS of an atomic load. */
4665 static inline tree
4666 gimple_omp_atomic_load_rhs (const_gimple g)
4668 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4669 return g->gimple_omp_atomic_load.rhs;
4673 /* Return a pointer to the RHS of an atomic load. */
4675 static inline tree *
4676 gimple_omp_atomic_load_rhs_ptr (gimple g)
4678 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4679 return &g->gimple_omp_atomic_load.rhs;
4683 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4685 static inline tree
4686 gimple_omp_continue_control_def (const_gimple g)
4688 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4689 return g->gimple_omp_continue.control_def;
4692 /* The same as above, but return the address. */
4694 static inline tree *
4695 gimple_omp_continue_control_def_ptr (gimple g)
4697 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4698 return &g->gimple_omp_continue.control_def;
4701 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4703 static inline void
4704 gimple_omp_continue_set_control_def (gimple g, tree def)
4706 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4707 g->gimple_omp_continue.control_def = def;
4711 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4713 static inline tree
4714 gimple_omp_continue_control_use (const_gimple g)
4716 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4717 return g->gimple_omp_continue.control_use;
4721 /* The same as above, but return the address. */
4723 static inline tree *
4724 gimple_omp_continue_control_use_ptr (gimple g)
4726 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4727 return &g->gimple_omp_continue.control_use;
4731 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4733 static inline void
4734 gimple_omp_continue_set_control_use (gimple g, tree use)
4736 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4737 g->gimple_omp_continue.control_use = use;
4740 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
4742 static inline gimple_seq *
4743 gimple_transaction_body_ptr (gimple gs)
4745 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4746 return &gs->gimple_transaction.body;
4749 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
4751 static inline gimple_seq
4752 gimple_transaction_body (gimple gs)
4754 return *gimple_transaction_body_ptr (gs);
4757 /* Return the label associated with a GIMPLE_TRANSACTION. */
4759 static inline tree
4760 gimple_transaction_label (const_gimple gs)
4762 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4763 return gs->gimple_transaction.label;
4766 static inline tree *
4767 gimple_transaction_label_ptr (gimple gs)
4769 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4770 return &gs->gimple_transaction.label;
4773 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
4775 static inline unsigned int
4776 gimple_transaction_subcode (const_gimple gs)
4778 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4779 return gs->gsbase.subcode;
4782 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
4784 static inline void
4785 gimple_transaction_set_body (gimple gs, gimple_seq body)
4787 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4788 gs->gimple_transaction.body = body;
4791 /* Set the label associated with a GIMPLE_TRANSACTION. */
4793 static inline void
4794 gimple_transaction_set_label (gimple gs, tree label)
4796 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4797 gs->gimple_transaction.label = label;
4800 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
4802 static inline void
4803 gimple_transaction_set_subcode (gimple gs, unsigned int subcode)
4805 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4806 gs->gsbase.subcode = subcode;
4810 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
4812 static inline tree *
4813 gimple_return_retval_ptr (const_gimple gs)
4815 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4816 return gimple_op_ptr (gs, 0);
4819 /* Return the return value for GIMPLE_RETURN GS. */
4821 static inline tree
4822 gimple_return_retval (const_gimple gs)
4824 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4825 return gimple_op (gs, 0);
4829 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
4831 static inline void
4832 gimple_return_set_retval (gimple gs, tree retval)
4834 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4835 gimple_set_op (gs, 0, retval);
4839 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
4841 #define CASE_GIMPLE_OMP \
4842 case GIMPLE_OMP_PARALLEL: \
4843 case GIMPLE_OMP_TASK: \
4844 case GIMPLE_OMP_FOR: \
4845 case GIMPLE_OMP_SECTIONS: \
4846 case GIMPLE_OMP_SECTIONS_SWITCH: \
4847 case GIMPLE_OMP_SINGLE: \
4848 case GIMPLE_OMP_SECTION: \
4849 case GIMPLE_OMP_MASTER: \
4850 case GIMPLE_OMP_ORDERED: \
4851 case GIMPLE_OMP_CRITICAL: \
4852 case GIMPLE_OMP_RETURN: \
4853 case GIMPLE_OMP_ATOMIC_LOAD: \
4854 case GIMPLE_OMP_ATOMIC_STORE: \
4855 case GIMPLE_OMP_CONTINUE
4857 static inline bool
4858 is_gimple_omp (const_gimple stmt)
4860 switch (gimple_code (stmt))
4862 CASE_GIMPLE_OMP:
4863 return true;
4864 default:
4865 return false;
4870 /* Returns TRUE if statement G is a GIMPLE_NOP. */
4872 static inline bool
4873 gimple_nop_p (const_gimple g)
4875 return gimple_code (g) == GIMPLE_NOP;
4879 /* Return true if GS is a GIMPLE_RESX. */
4881 static inline bool
4882 is_gimple_resx (const_gimple gs)
4884 return gimple_code (gs) == GIMPLE_RESX;
4887 /* Return the predictor of GIMPLE_PREDICT statement GS. */
4889 static inline enum br_predictor
4890 gimple_predict_predictor (gimple gs)
4892 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4893 return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
4897 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
4899 static inline void
4900 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
4902 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4903 gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
4904 | (unsigned) predictor;
4908 /* Return the outcome of GIMPLE_PREDICT statement GS. */
4910 static inline enum prediction
4911 gimple_predict_outcome (gimple gs)
4913 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4914 return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
4918 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
4920 static inline void
4921 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
4923 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4924 if (outcome == TAKEN)
4925 gs->gsbase.subcode |= GF_PREDICT_TAKEN;
4926 else
4927 gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
4931 /* Return the type of the main expression computed by STMT. Return
4932 void_type_node if the statement computes nothing. */
4934 static inline tree
4935 gimple_expr_type (const_gimple stmt)
4937 enum gimple_code code = gimple_code (stmt);
4939 if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
4941 tree type;
4942 /* In general we want to pass out a type that can be substituted
4943 for both the RHS and the LHS types if there is a possibly
4944 useless conversion involved. That means returning the
4945 original RHS type as far as we can reconstruct it. */
4946 if (code == GIMPLE_CALL)
4947 type = gimple_call_return_type (stmt);
4948 else
4949 switch (gimple_assign_rhs_code (stmt))
4951 case POINTER_PLUS_EXPR:
4952 type = TREE_TYPE (gimple_assign_rhs1 (stmt));
4953 break;
4955 default:
4956 /* As fallback use the type of the LHS. */
4957 type = TREE_TYPE (gimple_get_lhs (stmt));
4958 break;
4960 return type;
4962 else if (code == GIMPLE_COND)
4963 return boolean_type_node;
4964 else
4965 return void_type_node;
4968 /* Return true if TYPE is a suitable type for a scalar register variable. */
4970 static inline bool
4971 is_gimple_reg_type (tree type)
4973 return !AGGREGATE_TYPE_P (type);
4976 /* Return a new iterator pointing to GIMPLE_SEQ's first statement. */
4978 static inline gimple_stmt_iterator
4979 gsi_start_1 (gimple_seq *seq)
4981 gimple_stmt_iterator i;
4983 i.ptr = gimple_seq_first (*seq);
4984 i.seq = seq;
4985 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
4987 return i;
4990 #define gsi_start(x) gsi_start_1(&(x))
4992 static inline gimple_stmt_iterator
4993 gsi_none (void)
4995 gimple_stmt_iterator i;
4996 i.ptr = NULL;
4997 i.seq = NULL;
4998 i.bb = NULL;
4999 return i;
5002 /* Return a new iterator pointing to the first statement in basic block BB. */
5004 static inline gimple_stmt_iterator
5005 gsi_start_bb (basic_block bb)
5007 gimple_stmt_iterator i;
5008 gimple_seq *seq;
5010 seq = bb_seq_addr (bb);
5011 i.ptr = gimple_seq_first (*seq);
5012 i.seq = seq;
5013 i.bb = bb;
5015 return i;
5019 /* Return a new iterator initially pointing to GIMPLE_SEQ's last statement. */
5021 static inline gimple_stmt_iterator
5022 gsi_last_1 (gimple_seq *seq)
5024 gimple_stmt_iterator i;
5026 i.ptr = gimple_seq_last (*seq);
5027 i.seq = seq;
5028 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
5030 return i;
5033 #define gsi_last(x) gsi_last_1(&(x))
5035 /* Return a new iterator pointing to the last statement in basic block BB. */
5037 static inline gimple_stmt_iterator
5038 gsi_last_bb (basic_block bb)
5040 gimple_stmt_iterator i;
5041 gimple_seq *seq;
5043 seq = bb_seq_addr (bb);
5044 i.ptr = gimple_seq_last (*seq);
5045 i.seq = seq;
5046 i.bb = bb;
5048 return i;
5052 /* Return true if I is at the end of its sequence. */
5054 static inline bool
5055 gsi_end_p (gimple_stmt_iterator i)
5057 return i.ptr == NULL;
5061 /* Return true if I is one statement before the end of its sequence. */
5063 static inline bool
5064 gsi_one_before_end_p (gimple_stmt_iterator i)
5066 return i.ptr != NULL && i.ptr->gsbase.next == NULL;
5070 /* Advance the iterator to the next gimple statement. */
5072 static inline void
5073 gsi_next (gimple_stmt_iterator *i)
5075 i->ptr = i->ptr->gsbase.next;
5078 /* Advance the iterator to the previous gimple statement. */
5080 static inline void
5081 gsi_prev (gimple_stmt_iterator *i)
5083 gimple prev = i->ptr->gsbase.prev;
5084 if (prev->gsbase.next)
5085 i->ptr = prev;
5086 else
5087 i->ptr = NULL;
5090 /* Return the current stmt. */
5092 static inline gimple
5093 gsi_stmt (gimple_stmt_iterator i)
5095 return i.ptr;
5098 /* Return a block statement iterator that points to the first non-label
5099 statement in block BB. */
5101 static inline gimple_stmt_iterator
5102 gsi_after_labels (basic_block bb)
5104 gimple_stmt_iterator gsi = gsi_start_bb (bb);
5106 while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
5107 gsi_next (&gsi);
5109 return gsi;
5112 /* Advance the iterator to the next non-debug gimple statement. */
5114 static inline void
5115 gsi_next_nondebug (gimple_stmt_iterator *i)
5119 gsi_next (i);
5121 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5124 /* Advance the iterator to the next non-debug gimple statement. */
5126 static inline void
5127 gsi_prev_nondebug (gimple_stmt_iterator *i)
5131 gsi_prev (i);
5133 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5136 /* Return a new iterator pointing to the first non-debug statement in
5137 basic block BB. */
5139 static inline gimple_stmt_iterator
5140 gsi_start_nondebug_bb (basic_block bb)
5142 gimple_stmt_iterator i = gsi_start_bb (bb);
5144 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5145 gsi_next_nondebug (&i);
5147 return i;
5150 /* Return a new iterator pointing to the last non-debug statement in
5151 basic block BB. */
5153 static inline gimple_stmt_iterator
5154 gsi_last_nondebug_bb (basic_block bb)
5156 gimple_stmt_iterator i = gsi_last_bb (bb);
5158 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5159 gsi_prev_nondebug (&i);
5161 return i;
5165 /* Return the basic block associated with this iterator. */
5167 static inline basic_block
5168 gsi_bb (gimple_stmt_iterator i)
5170 return i.bb;
5174 /* Return the sequence associated with this iterator. */
5176 static inline gimple_seq
5177 gsi_seq (gimple_stmt_iterator i)
5179 return *i.seq;
5183 enum gsi_iterator_update
5185 GSI_NEW_STMT, /* Only valid when single statement is added, move
5186 iterator to it. */
5187 GSI_SAME_STMT, /* Leave the iterator at the same statement. */
5188 GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable
5189 for linking other statements in the same
5190 direction. */
5193 /* In gimple-iterator.c */
5194 gimple_stmt_iterator gsi_start_phis (basic_block);
5195 gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
5196 void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
5197 void gsi_set_stmt (gimple_stmt_iterator *, gimple);
5198 void gsi_replace (gimple_stmt_iterator *, gimple, bool);
5199 void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
5200 void gsi_insert_before (gimple_stmt_iterator *, gimple,
5201 enum gsi_iterator_update);
5202 void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
5203 enum gsi_iterator_update);
5204 void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
5205 enum gsi_iterator_update);
5206 void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
5207 enum gsi_iterator_update);
5208 void gsi_insert_after (gimple_stmt_iterator *, gimple,
5209 enum gsi_iterator_update);
5210 void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
5211 enum gsi_iterator_update);
5212 void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
5213 enum gsi_iterator_update);
5214 void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
5215 enum gsi_iterator_update);
5216 bool gsi_remove (gimple_stmt_iterator *, bool);
5217 gimple_stmt_iterator gsi_for_stmt (gimple);
5218 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
5219 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
5220 void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
5221 void gsi_insert_on_edge (edge, gimple);
5222 void gsi_insert_seq_on_edge (edge, gimple_seq);
5223 basic_block gsi_insert_on_edge_immediate (edge, gimple);
5224 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
5225 void gsi_commit_one_edge_insert (edge, basic_block *);
5226 void gsi_commit_edge_inserts (void);
5227 gimple gimple_call_copy_skip_args (gimple, bitmap);
5230 /* Convenience routines to walk all statements of a gimple function.
5231 Note that this is useful exclusively before the code is converted
5232 into SSA form. Once the program is in SSA form, the standard
5233 operand interface should be used to analyze/modify statements. */
5234 struct walk_stmt_info
5236 /* Points to the current statement being walked. */
5237 gimple_stmt_iterator gsi;
5239 /* Additional data that the callback functions may want to carry
5240 through the recursion. */
5241 void *info;
5243 /* Pointer map used to mark visited tree nodes when calling
5244 walk_tree on each operand. If set to NULL, duplicate tree nodes
5245 will be visited more than once. */
5246 struct pointer_set_t *pset;
5248 /* Operand returned by the callbacks. This is set when calling
5249 walk_gimple_seq. If the walk_stmt_fn or walk_tree_fn callback
5250 returns non-NULL, this field will contain the tree returned by
5251 the last callback. */
5252 tree callback_result;
5254 /* Indicates whether the operand being examined may be replaced
5255 with something that matches is_gimple_val (if true) or something
5256 slightly more complicated (if false). "Something" technically
5257 means the common subset of is_gimple_lvalue and is_gimple_rhs,
5258 but we never try to form anything more complicated than that, so
5259 we don't bother checking.
5261 Also note that CALLBACK should update this flag while walking the
5262 sub-expressions of a statement. For instance, when walking the
5263 statement 'foo (&var)', the flag VAL_ONLY will initially be set
5264 to true, however, when walking &var, the operand of that
5265 ADDR_EXPR does not need to be a GIMPLE value. */
5266 BOOL_BITFIELD val_only : 1;
5268 /* True if we are currently walking the LHS of an assignment. */
5269 BOOL_BITFIELD is_lhs : 1;
5271 /* Optional. Set to true by the callback functions if they made any
5272 changes. */
5273 BOOL_BITFIELD changed : 1;
5275 /* True if we're interested in location information. */
5276 BOOL_BITFIELD want_locations : 1;
5278 /* True if we've removed the statement that was processed. */
5279 BOOL_BITFIELD removed_stmt : 1;
5282 /* Callback for walk_gimple_stmt. Called for every statement found
5283 during traversal. The first argument points to the statement to
5284 walk. The second argument is a flag that the callback sets to
5285 'true' if it the callback handled all the operands and
5286 sub-statements of the statement (the default value of this flag is
5287 'false'). The third argument is an anonymous pointer to data
5288 to be used by the callback. */
5289 typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
5290 struct walk_stmt_info *);
5292 gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
5293 struct walk_stmt_info *);
5294 gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
5295 struct walk_stmt_info *);
5296 tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
5297 struct walk_stmt_info *);
5298 tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
5300 /* Enum and arrays used for allocation stats. Keep in sync with
5301 gimple.c:gimple_alloc_kind_names. */
5302 enum gimple_alloc_kind
5304 gimple_alloc_kind_assign, /* Assignments. */
5305 gimple_alloc_kind_phi, /* PHI nodes. */
5306 gimple_alloc_kind_cond, /* Conditionals. */
5307 gimple_alloc_kind_rest, /* Everything else. */
5308 gimple_alloc_kind_all
5311 extern int gimple_alloc_counts[];
5312 extern int gimple_alloc_sizes[];
5314 /* Return the allocation kind for a given stmt CODE. */
5315 static inline enum gimple_alloc_kind
5316 gimple_alloc_kind (enum gimple_code code)
5318 switch (code)
5320 case GIMPLE_ASSIGN:
5321 return gimple_alloc_kind_assign;
5322 case GIMPLE_PHI:
5323 return gimple_alloc_kind_phi;
5324 case GIMPLE_COND:
5325 return gimple_alloc_kind_cond;
5326 default:
5327 return gimple_alloc_kind_rest;
5331 extern void dump_gimple_statistics (void);
5333 /* In gimple-fold.c. */
5334 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
5335 tree gimple_fold_builtin (gimple);
5336 bool fold_stmt (gimple_stmt_iterator *);
5337 bool fold_stmt_inplace (gimple_stmt_iterator *);
5338 tree get_symbol_constant_value (tree);
5339 tree canonicalize_constructor_val (tree, tree);
5340 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree,
5341 enum tree_code, tree, tree);
5342 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
5343 enum tree_code, tree, tree);
5345 bool gimple_val_nonnegative_real_p (tree);
5346 #endif /* GCC_GIMPLE_H */