* cpplib.pot: Regenerate.
[official-gcc.git] / gcc / gimple.h
blob193590dbe74c3250c1290fbf9d5d8d15ecd93df5
1 /* Gimple IR definitions.
3 Copyright 2007, 2008, 2009, 2010, 2011, 2012 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 "vecprim.h"
28 #include "vecir.h"
29 #include "ggc.h"
30 #include "basic-block.h"
31 #include "tree-ssa-operands.h"
32 #include "tree-ssa-alias.h"
33 #include "internal-fn.h"
35 typedef gimple gimple_seq_node;
37 /* For each block, the PHI nodes that need to be rewritten are stored into
38 these vectors. */
39 typedef VEC(gimple, heap) *gimple_vec;
40 DEF_VEC_P (gimple_vec);
41 DEF_VEC_ALLOC_P (gimple_vec, heap);
43 enum gimple_code {
44 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
45 #include "gimple.def"
46 #undef DEFGSCODE
47 LAST_AND_UNUSED_GIMPLE_CODE
50 extern const char *const gimple_code_name[];
51 extern const unsigned char gimple_rhs_class_table[];
53 /* Error out if a gimple tuple is addressed incorrectly. */
54 #if defined ENABLE_GIMPLE_CHECKING
55 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
56 extern void gimple_check_failed (const_gimple, const char *, int, \
57 const char *, enum gimple_code, \
58 enum tree_code) ATTRIBUTE_NORETURN;
60 #define GIMPLE_CHECK(GS, CODE) \
61 do { \
62 const_gimple __gs = (GS); \
63 if (gimple_code (__gs) != (CODE)) \
64 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
65 (CODE), ERROR_MARK); \
66 } while (0)
67 #else /* not ENABLE_GIMPLE_CHECKING */
68 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
69 #define GIMPLE_CHECK(GS, CODE) (void)0
70 #endif
72 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
73 get_gimple_rhs_class. */
74 enum gimple_rhs_class
76 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
77 GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
78 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
79 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
80 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
81 name, a _DECL, a _REF, etc. */
84 /* Specific flags for individual GIMPLE statements. These flags are
85 always stored in gimple_statement_base.subcode and they may only be
86 defined for statement codes that do not use sub-codes.
88 Values for the masks can overlap as long as the overlapping values
89 are never used in the same statement class.
91 The maximum mask value that can be defined is 1 << 15 (i.e., each
92 statement code can hold up to 16 bitflags).
94 Keep this list sorted. */
95 enum gf_mask {
96 GF_ASM_INPUT = 1 << 0,
97 GF_ASM_VOLATILE = 1 << 1,
98 GF_CALL_FROM_THUNK = 1 << 0,
99 GF_CALL_RETURN_SLOT_OPT = 1 << 1,
100 GF_CALL_TAILCALL = 1 << 2,
101 GF_CALL_VA_ARG_PACK = 1 << 3,
102 GF_CALL_NOTHROW = 1 << 4,
103 GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
104 GF_CALL_INTERNAL = 1 << 6,
105 GF_OMP_PARALLEL_COMBINED = 1 << 0,
107 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
108 a thread synchronization via some sort of barrier. The exact barrier
109 that would otherwise be emitted is dependent on the OMP statement with
110 which this return is associated. */
111 GF_OMP_RETURN_NOWAIT = 1 << 0,
113 GF_OMP_SECTION_LAST = 1 << 0,
114 GF_OMP_ATOMIC_NEED_VALUE = 1 << 0,
115 GF_PREDICT_TAKEN = 1 << 15
118 /* Currently, there are only two types of gimple debug stmt. Others are
119 envisioned, for example, to enable the generation of is_stmt notes
120 in line number information, to mark sequence points, etc. This
121 subcode is to be used to tell them apart. */
122 enum gimple_debug_subcode {
123 GIMPLE_DEBUG_BIND = 0,
124 GIMPLE_DEBUG_SOURCE_BIND = 1
127 /* Masks for selecting a pass local flag (PLF) to work on. These
128 masks are used by gimple_set_plf and gimple_plf. */
129 enum plf_mask {
130 GF_PLF_1 = 1 << 0,
131 GF_PLF_2 = 1 << 1
134 /* Iterator object for GIMPLE statement sequences. */
136 typedef struct
138 /* Sequence node holding the current statement. */
139 gimple_seq_node ptr;
141 /* Sequence and basic block holding the statement. These fields
142 are necessary to handle edge cases such as when statement is
143 added to an empty basic block or when the last statement of a
144 block/sequence is removed. */
145 gimple_seq *seq;
146 basic_block bb;
147 } gimple_stmt_iterator;
150 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
151 are for 64 bit hosts. */
153 struct GTY(()) gimple_statement_base {
154 /* [ WORD 1 ]
155 Main identifying code for a tuple. */
156 ENUM_BITFIELD(gimple_code) code : 8;
158 /* Nonzero if a warning should not be emitted on this tuple. */
159 unsigned int no_warning : 1;
161 /* Nonzero if this tuple has been visited. Passes are responsible
162 for clearing this bit before using it. */
163 unsigned int visited : 1;
165 /* Nonzero if this tuple represents a non-temporal move. */
166 unsigned int nontemporal_move : 1;
168 /* Pass local flags. These flags are free for any pass to use as
169 they see fit. Passes should not assume that these flags contain
170 any useful value when the pass starts. Any initial state that
171 the pass requires should be set on entry to the pass. See
172 gimple_set_plf and gimple_plf for usage. */
173 unsigned int plf : 2;
175 /* Nonzero if this statement has been modified and needs to have its
176 operands rescanned. */
177 unsigned modified : 1;
179 /* Nonzero if this statement contains volatile operands. */
180 unsigned has_volatile_ops : 1;
182 /* The SUBCODE field can be used for tuple-specific flags for tuples
183 that do not require subcodes. Note that SUBCODE should be at
184 least as wide as tree codes, as several tuples store tree codes
185 in there. */
186 unsigned int subcode : 16;
188 /* UID of this statement. This is used by passes that want to
189 assign IDs to statements. It must be assigned and used by each
190 pass. By default it should be assumed to contain garbage. */
191 unsigned uid;
193 /* [ WORD 2 ]
194 Locus information for debug info. */
195 location_t location;
197 /* Number of operands in this tuple. */
198 unsigned num_ops;
200 /* [ WORD 3 ]
201 Basic block holding this statement. */
202 struct basic_block_def *bb;
204 /* [ WORD 4-5 ]
205 Linked lists of gimple statements. The next pointers form
206 a NULL terminated list, the prev pointers are a cyclic list.
207 A gimple statement is hence also a double-ended list of
208 statements, with the pointer itself being the first element,
209 and the prev pointer being the last. */
210 gimple next;
211 gimple GTY((skip)) prev;
213 /* [ WORD 6 ]
214 Lexical block holding this statement. */
215 tree block;
219 /* Base structure for tuples with operands. */
221 struct GTY(()) gimple_statement_with_ops_base
223 /* [ WORD 1-6 ] */
224 struct gimple_statement_base gsbase;
226 /* [ WORD 7-8 ]
227 SSA operand vectors. NOTE: It should be possible to
228 amalgamate these vectors with the operand vector OP. However,
229 the SSA operand vectors are organized differently and contain
230 more information (like immediate use chaining). */
231 struct def_optype_d GTY((skip (""))) *def_ops;
232 struct use_optype_d GTY((skip (""))) *use_ops;
236 /* Statements that take register operands. */
238 struct GTY(()) gimple_statement_with_ops
240 /* [ WORD 1-8 ] */
241 struct gimple_statement_with_ops_base opbase;
243 /* [ WORD 9 ]
244 Operand vector. NOTE! This must always be the last field
245 of this structure. In particular, this means that this
246 structure cannot be embedded inside another one. */
247 tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
251 /* Base for statements that take both memory and register operands. */
253 struct GTY(()) gimple_statement_with_memory_ops_base
255 /* [ WORD 1-8 ] */
256 struct gimple_statement_with_ops_base opbase;
258 /* [ WORD 9-10 ]
259 Virtual operands for this statement. The GC will pick them
260 up via the ssa_names array. */
261 tree GTY((skip (""))) vdef;
262 tree GTY((skip (""))) vuse;
266 /* Statements that take both memory and register operands. */
268 struct GTY(()) gimple_statement_with_memory_ops
270 /* [ WORD 1-10 ] */
271 struct gimple_statement_with_memory_ops_base membase;
273 /* [ WORD 11 ]
274 Operand vector. NOTE! This must always be the last field
275 of this structure. In particular, this means that this
276 structure cannot be embedded inside another one. */
277 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
281 /* Call statements that take both memory and register operands. */
283 struct GTY(()) gimple_statement_call
285 /* [ WORD 1-10 ] */
286 struct gimple_statement_with_memory_ops_base membase;
288 /* [ WORD 11-14 ] */
289 struct pt_solution call_used;
290 struct pt_solution call_clobbered;
292 /* [ WORD 15 ] */
293 union GTY ((desc ("%1.membase.opbase.gsbase.subcode & GF_CALL_INTERNAL"))) {
294 tree GTY ((tag ("0"))) fntype;
295 enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
296 } u;
298 /* [ WORD 16 ]
299 Operand vector. NOTE! This must always be the last field
300 of this structure. In particular, this means that this
301 structure cannot be embedded inside another one. */
302 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
306 /* OpenMP statements (#pragma omp). */
308 struct GTY(()) gimple_statement_omp {
309 /* [ WORD 1-6 ] */
310 struct gimple_statement_base gsbase;
312 /* [ WORD 7 ] */
313 gimple_seq body;
317 /* GIMPLE_BIND */
319 struct GTY(()) gimple_statement_bind {
320 /* [ WORD 1-6 ] */
321 struct gimple_statement_base gsbase;
323 /* [ WORD 7 ]
324 Variables declared in this scope. */
325 tree vars;
327 /* [ WORD 8 ]
328 This is different than the BLOCK field in gimple_statement_base,
329 which is analogous to TREE_BLOCK (i.e., the lexical block holding
330 this statement). This field is the equivalent of BIND_EXPR_BLOCK
331 in tree land (i.e., the lexical scope defined by this bind). See
332 gimple-low.c. */
333 tree block;
335 /* [ WORD 9 ] */
336 gimple_seq body;
340 /* GIMPLE_CATCH */
342 struct GTY(()) gimple_statement_catch {
343 /* [ WORD 1-6 ] */
344 struct gimple_statement_base gsbase;
346 /* [ WORD 7 ] */
347 tree types;
349 /* [ WORD 8 ] */
350 gimple_seq handler;
354 /* GIMPLE_EH_FILTER */
356 struct GTY(()) gimple_statement_eh_filter {
357 /* [ WORD 1-6 ] */
358 struct gimple_statement_base gsbase;
360 /* [ WORD 7 ]
361 Filter types. */
362 tree types;
364 /* [ WORD 8 ]
365 Failure actions. */
366 gimple_seq failure;
369 /* GIMPLE_EH_ELSE */
371 struct GTY(()) gimple_statement_eh_else {
372 /* [ WORD 1-6 ] */
373 struct gimple_statement_base gsbase;
375 /* [ WORD 7,8 ] */
376 gimple_seq n_body, e_body;
379 /* GIMPLE_EH_MUST_NOT_THROW */
381 struct GTY(()) gimple_statement_eh_mnt {
382 /* [ WORD 1-6 ] */
383 struct gimple_statement_base gsbase;
385 /* [ WORD 7 ] Abort function decl. */
386 tree fndecl;
389 /* GIMPLE_PHI */
391 struct GTY(()) gimple_statement_phi {
392 /* [ WORD 1-6 ] */
393 struct gimple_statement_base gsbase;
395 /* [ WORD 7 ] */
396 unsigned capacity;
397 unsigned nargs;
399 /* [ WORD 8 ] */
400 tree result;
402 /* [ WORD 9 ] */
403 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
407 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
409 struct GTY(()) gimple_statement_eh_ctrl
411 /* [ WORD 1-6 ] */
412 struct gimple_statement_base gsbase;
414 /* [ WORD 7 ]
415 Exception region number. */
416 int region;
420 /* GIMPLE_TRY */
422 struct GTY(()) gimple_statement_try {
423 /* [ WORD 1-6 ] */
424 struct gimple_statement_base gsbase;
426 /* [ WORD 7 ]
427 Expression to evaluate. */
428 gimple_seq eval;
430 /* [ WORD 8 ]
431 Cleanup expression. */
432 gimple_seq cleanup;
435 /* Kind of GIMPLE_TRY statements. */
436 enum gimple_try_flags
438 /* A try/catch. */
439 GIMPLE_TRY_CATCH = 1 << 0,
441 /* A try/finally. */
442 GIMPLE_TRY_FINALLY = 1 << 1,
443 GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
445 /* Analogous to TRY_CATCH_IS_CLEANUP. */
446 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
449 /* GIMPLE_WITH_CLEANUP_EXPR */
451 struct GTY(()) gimple_statement_wce {
452 /* [ WORD 1-6 ] */
453 struct gimple_statement_base gsbase;
455 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
456 executed if an exception is thrown, not on normal exit of its
457 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
458 in TARGET_EXPRs. */
460 /* [ WORD 7 ]
461 Cleanup expression. */
462 gimple_seq cleanup;
466 /* GIMPLE_ASM */
468 struct GTY(()) gimple_statement_asm
470 /* [ WORD 1-10 ] */
471 struct gimple_statement_with_memory_ops_base membase;
473 /* [ WORD 11 ]
474 __asm__ statement. */
475 const char *string;
477 /* [ WORD 12 ]
478 Number of inputs, outputs, clobbers, labels. */
479 unsigned char ni;
480 unsigned char no;
481 unsigned char nc;
482 unsigned char nl;
484 /* [ WORD 13 ]
485 Operand vector. NOTE! This must always be the last field
486 of this structure. In particular, this means that this
487 structure cannot be embedded inside another one. */
488 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
491 /* GIMPLE_OMP_CRITICAL */
493 struct GTY(()) gimple_statement_omp_critical {
494 /* [ WORD 1-7 ] */
495 struct gimple_statement_omp omp;
497 /* [ WORD 8 ]
498 Critical section name. */
499 tree name;
503 struct GTY(()) gimple_omp_for_iter {
504 /* Condition code. */
505 enum tree_code cond;
507 /* Index variable. */
508 tree index;
510 /* Initial value. */
511 tree initial;
513 /* Final value. */
514 tree final;
516 /* Increment. */
517 tree incr;
520 /* GIMPLE_OMP_FOR */
522 struct GTY(()) gimple_statement_omp_for {
523 /* [ WORD 1-7 ] */
524 struct gimple_statement_omp omp;
526 /* [ WORD 8 ] */
527 tree clauses;
529 /* [ WORD 9 ]
530 Number of elements in iter array. */
531 size_t collapse;
533 /* [ WORD 10 ] */
534 struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
536 /* [ WORD 11 ]
537 Pre-body evaluated before the loop body begins. */
538 gimple_seq pre_body;
542 /* GIMPLE_OMP_PARALLEL */
544 struct GTY(()) gimple_statement_omp_parallel {
545 /* [ WORD 1-7 ] */
546 struct gimple_statement_omp omp;
548 /* [ WORD 8 ]
549 Clauses. */
550 tree clauses;
552 /* [ WORD 9 ]
553 Child function holding the body of the parallel region. */
554 tree child_fn;
556 /* [ WORD 10 ]
557 Shared data argument. */
558 tree data_arg;
562 /* GIMPLE_OMP_TASK */
564 struct GTY(()) gimple_statement_omp_task {
565 /* [ WORD 1-10 ] */
566 struct gimple_statement_omp_parallel par;
568 /* [ WORD 11 ]
569 Child function holding firstprivate initialization if needed. */
570 tree copy_fn;
572 /* [ WORD 12-13 ]
573 Size and alignment in bytes of the argument data block. */
574 tree arg_size;
575 tree arg_align;
579 /* GIMPLE_OMP_SECTION */
580 /* Uses struct gimple_statement_omp. */
583 /* GIMPLE_OMP_SECTIONS */
585 struct GTY(()) gimple_statement_omp_sections {
586 /* [ WORD 1-7 ] */
587 struct gimple_statement_omp omp;
589 /* [ WORD 8 ] */
590 tree clauses;
592 /* [ WORD 9 ]
593 The control variable used for deciding which of the sections to
594 execute. */
595 tree control;
598 /* GIMPLE_OMP_CONTINUE.
600 Note: This does not inherit from gimple_statement_omp, because we
601 do not need the body field. */
603 struct GTY(()) gimple_statement_omp_continue {
604 /* [ WORD 1-6 ] */
605 struct gimple_statement_base gsbase;
607 /* [ WORD 7 ] */
608 tree control_def;
610 /* [ WORD 8 ] */
611 tree control_use;
614 /* GIMPLE_OMP_SINGLE */
616 struct GTY(()) gimple_statement_omp_single {
617 /* [ WORD 1-7 ] */
618 struct gimple_statement_omp omp;
620 /* [ WORD 7 ] */
621 tree clauses;
625 /* GIMPLE_OMP_ATOMIC_LOAD.
626 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
627 contains a sequence, which we don't need here. */
629 struct GTY(()) gimple_statement_omp_atomic_load {
630 /* [ WORD 1-6 ] */
631 struct gimple_statement_base gsbase;
633 /* [ WORD 7-8 ] */
634 tree rhs, lhs;
637 /* GIMPLE_OMP_ATOMIC_STORE.
638 See note on GIMPLE_OMP_ATOMIC_LOAD. */
640 struct GTY(()) gimple_statement_omp_atomic_store {
641 /* [ WORD 1-6 ] */
642 struct gimple_statement_base gsbase;
644 /* [ WORD 7 ] */
645 tree val;
648 /* GIMPLE_TRANSACTION. */
650 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
652 /* The __transaction_atomic was declared [[outer]] or it is
653 __transaction_relaxed. */
654 #define GTMA_IS_OUTER (1u << 0)
655 #define GTMA_IS_RELAXED (1u << 1)
656 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
658 /* The transaction is seen to not have an abort. */
659 #define GTMA_HAVE_ABORT (1u << 2)
660 /* The transaction is seen to have loads or stores. */
661 #define GTMA_HAVE_LOAD (1u << 3)
662 #define GTMA_HAVE_STORE (1u << 4)
663 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
664 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
665 /* The transaction WILL enter serial irrevocable mode.
666 An irrevocable block post-dominates the entire transaction, such
667 that all invocations of the transaction will go serial-irrevocable.
668 In such case, we don't bother instrumenting the transaction, and
669 tell the runtime that it should begin the transaction in
670 serial-irrevocable mode. */
671 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
673 struct GTY(()) gimple_statement_transaction
675 /* [ WORD 1-10 ] */
676 struct gimple_statement_with_memory_ops_base gsbase;
678 /* [ WORD 11 ] */
679 gimple_seq body;
681 /* [ WORD 12 ] */
682 tree label;
685 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
686 enum gimple_statement_structure_enum {
687 #include "gsstruct.def"
688 LAST_GSS_ENUM
690 #undef DEFGSSTRUCT
693 /* Define the overall contents of a gimple tuple. It may be any of the
694 structures declared above for various types of tuples. */
696 union GTY ((desc ("gimple_statement_structure (&%h)"),
697 chain_next ("%h.gsbase.next"), variable_size)) gimple_statement_d {
698 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
699 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
700 struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
701 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
702 struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
703 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
704 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
705 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
706 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
707 struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
708 struct gimple_statement_eh_else GTY ((tag ("GSS_EH_ELSE"))) gimple_eh_else;
709 struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
710 struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
711 struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
712 struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
713 struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
714 struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
715 struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
716 struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
717 struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
718 struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
719 struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
720 struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
721 struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
722 struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
723 struct gimple_statement_transaction GTY((tag ("GSS_TRANSACTION"))) gimple_transaction;
726 /* In gimple.c. */
728 /* Offset in bytes to the location of the operand vector.
729 Zero if there is no operand vector for this tuple structure. */
730 extern size_t const gimple_ops_offset_[];
732 /* Map GIMPLE codes to GSS codes. */
733 extern enum gimple_statement_structure_enum const gss_for_code_[];
735 /* This variable holds the currently expanded gimple statement for purposes
736 of comminucating the profile info to the builtin expanders. */
737 extern gimple currently_expanding_gimple_stmt;
739 gimple gimple_build_return (tree);
741 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
742 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
744 void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *, tree *);
746 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree,
747 tree, tree MEM_STAT_DECL);
748 #define gimple_build_assign_with_ops(c,o1,o2,o3) \
749 gimple_build_assign_with_ops_stat (c, o1, o2, o3, NULL_TREE MEM_STAT_INFO)
750 #define gimple_build_assign_with_ops3(c,o1,o2,o3,o4) \
751 gimple_build_assign_with_ops_stat (c, o1, o2, o3, o4 MEM_STAT_INFO)
753 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
754 #define gimple_build_debug_bind(var,val,stmt) \
755 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
756 gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
757 #define gimple_build_debug_source_bind(var,val,stmt) \
758 gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
760 gimple gimple_build_call_vec (tree, VEC(tree, heap) *);
761 gimple gimple_build_call (tree, unsigned, ...);
762 gimple gimple_build_call_valist (tree, unsigned, va_list);
763 gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
764 gimple gimple_build_call_internal_vec (enum internal_fn, VEC(tree, heap) *);
765 gimple gimple_build_call_from_tree (tree);
766 gimple gimplify_assign (tree, tree, gimple_seq *);
767 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
768 gimple gimple_build_label (tree label);
769 gimple gimple_build_goto (tree dest);
770 gimple gimple_build_nop (void);
771 gimple gimple_build_bind (tree, gimple_seq, tree);
772 gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *,
773 VEC(tree,gc) *, VEC(tree,gc) *);
774 gimple gimple_build_catch (tree, gimple_seq);
775 gimple gimple_build_eh_filter (tree, gimple_seq);
776 gimple gimple_build_eh_must_not_throw (tree);
777 gimple gimple_build_eh_else (gimple_seq, gimple_seq);
778 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
779 gimple gimple_build_wce (gimple_seq);
780 gimple gimple_build_resx (int);
781 gimple gimple_build_eh_dispatch (int);
782 gimple gimple_build_switch_nlabels (unsigned, tree, tree);
783 gimple gimple_build_switch (unsigned, tree, tree, ...);
784 gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *);
785 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
786 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
787 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq);
788 gimple gimple_build_omp_critical (gimple_seq, tree);
789 gimple gimple_build_omp_section (gimple_seq);
790 gimple gimple_build_omp_continue (tree, tree);
791 gimple gimple_build_omp_master (gimple_seq);
792 gimple gimple_build_omp_return (bool);
793 gimple gimple_build_omp_ordered (gimple_seq);
794 gimple gimple_build_omp_sections (gimple_seq, tree);
795 gimple gimple_build_omp_sections_switch (void);
796 gimple gimple_build_omp_single (gimple_seq, tree);
797 gimple gimple_build_cdt (tree, tree);
798 gimple gimple_build_omp_atomic_load (tree, tree);
799 gimple gimple_build_omp_atomic_store (tree);
800 gimple gimple_build_transaction (gimple_seq, tree);
801 gimple gimple_build_predict (enum br_predictor, enum prediction);
802 enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
803 void sort_case_labels (VEC(tree,heap) *);
804 void preprocess_case_label_vec_for_gimple (VEC(tree,heap) *, tree, tree *);
805 void gimple_set_body (tree, gimple_seq);
806 gimple_seq gimple_body (tree);
807 bool gimple_has_body_p (tree);
808 gimple_seq gimple_seq_alloc (void);
809 void gimple_seq_free (gimple_seq);
810 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
811 gimple_seq gimple_seq_copy (gimple_seq);
812 bool gimple_call_same_target_p (const_gimple, const_gimple);
813 int gimple_call_flags (const_gimple);
814 int gimple_call_return_flags (const_gimple);
815 int gimple_call_arg_flags (const_gimple, unsigned);
816 void gimple_call_reset_alias_info (gimple);
817 bool gimple_assign_copy_p (gimple);
818 bool gimple_assign_ssa_name_copy_p (gimple);
819 bool gimple_assign_unary_nop_p (gimple);
820 void gimple_set_bb (gimple, struct basic_block_def *);
821 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
822 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
823 tree, tree, tree);
824 tree gimple_get_lhs (const_gimple);
825 void gimple_set_lhs (gimple, tree);
826 void gimple_replace_lhs (gimple, tree);
827 gimple gimple_copy (gimple);
828 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
829 gimple gimple_build_cond_from_tree (tree, tree, tree);
830 void gimple_cond_set_condition_from_tree (gimple, tree);
831 bool gimple_has_side_effects (const_gimple);
832 bool gimple_could_trap_p (gimple);
833 bool gimple_could_trap_p_1 (gimple, bool, bool);
834 bool gimple_assign_rhs_could_trap_p (gimple);
835 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
836 bool empty_body_p (gimple_seq);
837 unsigned get_gimple_rhs_num_ops (enum tree_code);
838 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
839 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
840 const char *gimple_decl_printable_name (tree, int);
841 tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree);
842 tree gimple_extract_devirt_binfo_from_cst (tree);
844 /* Returns true iff T is a scalar register variable. */
845 extern bool is_gimple_reg (tree);
846 /* Returns true iff T is any sort of variable. */
847 extern bool is_gimple_variable (tree);
848 /* Returns true iff T is any sort of symbol. */
849 extern bool is_gimple_id (tree);
850 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */
851 extern bool is_gimple_min_lval (tree);
852 /* Returns true iff T is something whose address can be taken. */
853 extern bool is_gimple_addressable (tree);
854 /* Returns true iff T is any valid GIMPLE lvalue. */
855 extern bool is_gimple_lvalue (tree);
857 /* Returns true iff T is a GIMPLE address. */
858 bool is_gimple_address (const_tree);
859 /* Returns true iff T is a GIMPLE invariant address. */
860 bool is_gimple_invariant_address (const_tree);
861 /* Returns true iff T is a GIMPLE invariant address at interprocedural
862 level. */
863 bool is_gimple_ip_invariant_address (const_tree);
864 /* Returns true iff T is a valid GIMPLE constant. */
865 bool is_gimple_constant (const_tree);
866 /* Returns true iff T is a GIMPLE restricted function invariant. */
867 extern bool is_gimple_min_invariant (const_tree);
868 /* Returns true iff T is a GIMPLE restricted interprecodural invariant. */
869 extern bool is_gimple_ip_invariant (const_tree);
870 /* Returns true iff T is a GIMPLE rvalue. */
871 extern bool is_gimple_val (tree);
872 /* Returns true iff T is a GIMPLE asm statement input. */
873 extern bool is_gimple_asm_val (tree);
874 /* Returns true iff T is a valid address operand of a MEM_REF. */
875 bool is_gimple_mem_ref_addr (tree);
877 /* Returns true iff T is a valid if-statement condition. */
878 extern bool is_gimple_condexpr (tree);
880 /* Returns true iff T is a valid call address expression. */
881 extern bool is_gimple_call_addr (tree);
883 extern void recalculate_side_effects (tree);
884 extern bool gimple_compare_field_offset (tree, tree);
885 extern tree gimple_register_type (tree);
886 extern tree gimple_register_canonical_type (tree);
887 extern void print_gimple_types_stats (void);
888 extern void free_gimple_type_tables (void);
889 extern tree gimple_unsigned_type (tree);
890 extern tree gimple_signed_type (tree);
891 extern alias_set_type gimple_get_alias_set (tree);
892 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
893 unsigned *);
894 extern bool walk_stmt_load_store_addr_ops (gimple, void *,
895 bool (*)(gimple, tree, void *),
896 bool (*)(gimple, tree, void *),
897 bool (*)(gimple, tree, void *));
898 extern bool walk_stmt_load_store_ops (gimple, void *,
899 bool (*)(gimple, tree, void *),
900 bool (*)(gimple, tree, void *));
901 extern bool gimple_ior_addresses_taken (bitmap, gimple);
902 extern bool gimple_call_builtin_p (gimple, enum built_in_function);
903 extern bool gimple_asm_clobbers_memory_p (const_gimple);
905 /* In gimplify.c */
906 extern tree create_tmp_var_raw (tree, const char *);
907 extern tree create_tmp_var_name (const char *);
908 extern tree create_tmp_var (tree, const char *);
909 extern tree create_tmp_reg (tree, const char *);
910 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
911 extern tree get_formal_tmp_var (tree, gimple_seq *);
912 extern void declare_vars (tree, gimple, bool);
913 extern void annotate_all_with_location (gimple_seq, location_t);
915 /* Validation of GIMPLE expressions. Note that these predicates only check
916 the basic form of the expression, they don't recurse to make sure that
917 underlying nodes are also of the right form. */
918 typedef bool (*gimple_predicate)(tree);
921 /* FIXME we should deduce this from the predicate. */
922 enum fallback {
923 fb_none = 0, /* Do not generate a temporary. */
925 fb_rvalue = 1, /* Generate an rvalue to hold the result of a
926 gimplified expression. */
928 fb_lvalue = 2, /* Generate an lvalue to hold the result of a
929 gimplified expression. */
931 fb_mayfail = 4, /* Gimplification may fail. Error issued
932 afterwards. */
933 fb_either= fb_rvalue | fb_lvalue
936 typedef int fallback_t;
938 enum gimplify_status {
939 GS_ERROR = -2, /* Something Bad Seen. */
940 GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
941 GS_OK = 0, /* We did something, maybe more to do. */
942 GS_ALL_DONE = 1 /* The expression is fully gimplified. */
945 struct gimplify_ctx
947 struct gimplify_ctx *prev_context;
949 VEC(gimple,heap) *bind_expr_stack;
950 tree temps;
951 gimple_seq conditional_cleanups;
952 tree exit_label;
953 tree return_temp;
955 VEC(tree,heap) *case_labels;
956 /* The formal temporary table. Should this be persistent? */
957 htab_t temp_htab;
959 int conditions;
960 bool save_stack;
961 bool into_ssa;
962 bool allow_rhs_cond_expr;
963 bool in_cleanup_point_expr;
966 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
967 bool (*) (tree), fallback_t);
968 extern void gimplify_type_sizes (tree, gimple_seq *);
969 extern void gimplify_one_sizepos (tree *, gimple_seq *);
970 extern bool gimplify_stmt (tree *, gimple_seq *);
971 extern gimple gimplify_body (tree, bool);
972 extern void push_gimplify_context (struct gimplify_ctx *);
973 extern void pop_gimplify_context (gimple);
974 extern void gimplify_and_add (tree, gimple_seq *);
976 /* Miscellaneous helpers. */
977 extern void gimple_add_tmp_var (tree);
978 extern gimple gimple_current_bind_expr (void);
979 extern VEC(gimple, heap) *gimple_bind_expr_stack (void);
980 extern tree voidify_wrapper_expr (tree, tree);
981 extern tree build_and_jump (tree *);
982 extern tree force_labels_r (tree *, int *, void *);
983 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
984 gimple_seq *);
985 struct gimplify_omp_ctx;
986 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
987 extern tree gimple_boolify (tree);
988 extern gimple_predicate rhs_predicate_for (tree);
989 extern tree canonicalize_cond_expr_cond (tree);
991 /* In omp-low.c. */
992 extern tree omp_reduction_init (tree, tree);
994 /* In trans-mem.c. */
995 extern void diagnose_tm_safe_errors (tree);
996 extern void compute_transaction_bits (void);
998 /* In tree-nested.c. */
999 extern void lower_nested_functions (tree);
1000 extern void insert_field_into_struct (tree, tree);
1002 /* In gimplify.c. */
1003 extern void gimplify_function_tree (tree);
1005 /* In cfgexpand.c. */
1006 extern tree gimple_assign_rhs_to_tree (gimple);
1008 /* In builtins.c */
1009 extern bool validate_gimple_arglist (const_gimple, ...);
1011 /* In tree-ssa.c */
1012 extern bool tree_ssa_useless_type_conversion (tree);
1013 extern tree tree_ssa_strip_useless_type_conversions (tree);
1014 extern bool useless_type_conversion_p (tree, tree);
1015 extern bool types_compatible_p (tree, tree);
1017 /* Return the first node in GIMPLE sequence S. */
1019 static inline gimple_seq_node
1020 gimple_seq_first (gimple_seq s)
1022 return s;
1026 /* Return the first statement in GIMPLE sequence S. */
1028 static inline gimple
1029 gimple_seq_first_stmt (gimple_seq s)
1031 gimple_seq_node n = gimple_seq_first (s);
1032 return n;
1036 /* Return the last node in GIMPLE sequence S. */
1038 static inline gimple_seq_node
1039 gimple_seq_last (gimple_seq s)
1041 return s ? s->gsbase.prev : NULL;
1045 /* Return the last statement in GIMPLE sequence S. */
1047 static inline gimple
1048 gimple_seq_last_stmt (gimple_seq s)
1050 gimple_seq_node n = gimple_seq_last (s);
1051 return n;
1055 /* Set the last node in GIMPLE sequence *PS to LAST. */
1057 static inline void
1058 gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1060 (*ps)->gsbase.prev = last;
1064 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1066 static inline void
1067 gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1069 *ps = first;
1073 /* Return true if GIMPLE sequence S is empty. */
1075 static inline bool
1076 gimple_seq_empty_p (gimple_seq s)
1078 return s == NULL;
1082 void gimple_seq_add_stmt (gimple_seq *, gimple);
1084 /* Link gimple statement GS to the end of the sequence *SEQ_P. If
1085 *SEQ_P is NULL, a new sequence is allocated. This function is
1086 similar to gimple_seq_add_stmt, but does not scan the operands.
1087 During gimplification, we need to manipulate statement sequences
1088 before the def/use vectors have been constructed. */
1089 void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
1091 /* Allocate a new sequence and initialize its first element with STMT. */
1093 static inline gimple_seq
1094 gimple_seq_alloc_with_stmt (gimple stmt)
1096 gimple_seq seq = NULL;
1097 gimple_seq_add_stmt (&seq, stmt);
1098 return seq;
1102 /* Returns the sequence of statements in BB. */
1104 static inline gimple_seq
1105 bb_seq (const_basic_block bb)
1107 return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1110 static inline gimple_seq *
1111 bb_seq_addr (basic_block bb)
1113 return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1116 /* Sets the sequence of statements in BB to SEQ. */
1118 static inline void
1119 set_bb_seq (basic_block bb, gimple_seq seq)
1121 gcc_checking_assert (!(bb->flags & BB_RTL));
1122 bb->il.gimple.seq = seq;
1126 /* Return the code for GIMPLE statement G. */
1128 static inline enum gimple_code
1129 gimple_code (const_gimple g)
1131 return g->gsbase.code;
1135 /* Return the GSS code used by a GIMPLE code. */
1137 static inline enum gimple_statement_structure_enum
1138 gss_for_code (enum gimple_code code)
1140 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1141 return gss_for_code_[code];
1145 /* Return which GSS code is used by GS. */
1147 static inline enum gimple_statement_structure_enum
1148 gimple_statement_structure (gimple gs)
1150 return gss_for_code (gimple_code (gs));
1154 /* Return true if statement G has sub-statements. This is only true for
1155 High GIMPLE statements. */
1157 static inline bool
1158 gimple_has_substatements (gimple g)
1160 switch (gimple_code (g))
1162 case GIMPLE_BIND:
1163 case GIMPLE_CATCH:
1164 case GIMPLE_EH_FILTER:
1165 case GIMPLE_EH_ELSE:
1166 case GIMPLE_TRY:
1167 case GIMPLE_OMP_FOR:
1168 case GIMPLE_OMP_MASTER:
1169 case GIMPLE_OMP_ORDERED:
1170 case GIMPLE_OMP_SECTION:
1171 case GIMPLE_OMP_PARALLEL:
1172 case GIMPLE_OMP_TASK:
1173 case GIMPLE_OMP_SECTIONS:
1174 case GIMPLE_OMP_SINGLE:
1175 case GIMPLE_OMP_CRITICAL:
1176 case GIMPLE_WITH_CLEANUP_EXPR:
1177 case GIMPLE_TRANSACTION:
1178 return true;
1180 default:
1181 return false;
1186 /* Return the basic block holding statement G. */
1188 static inline struct basic_block_def *
1189 gimple_bb (const_gimple g)
1191 return g->gsbase.bb;
1195 /* Return the lexical scope block holding statement G. */
1197 static inline tree
1198 gimple_block (const_gimple g)
1200 return g->gsbase.block;
1204 /* Set BLOCK to be the lexical scope block holding statement G. */
1206 static inline void
1207 gimple_set_block (gimple g, tree block)
1209 g->gsbase.block = block;
1213 /* Return location information for statement G. */
1215 static inline location_t
1216 gimple_location (const_gimple g)
1218 return g->gsbase.location;
1221 /* Return pointer to location information for statement G. */
1223 static inline const location_t *
1224 gimple_location_ptr (const_gimple g)
1226 return &g->gsbase.location;
1230 /* Set location information for statement G. */
1232 static inline void
1233 gimple_set_location (gimple g, location_t location)
1235 g->gsbase.location = location;
1239 /* Return true if G contains location information. */
1241 static inline bool
1242 gimple_has_location (const_gimple g)
1244 return gimple_location (g) != UNKNOWN_LOCATION;
1248 /* Return the file name of the location of STMT. */
1250 static inline const char *
1251 gimple_filename (const_gimple stmt)
1253 return LOCATION_FILE (gimple_location (stmt));
1257 /* Return the line number of the location of STMT. */
1259 static inline int
1260 gimple_lineno (const_gimple stmt)
1262 return LOCATION_LINE (gimple_location (stmt));
1266 /* Determine whether SEQ is a singleton. */
1268 static inline bool
1269 gimple_seq_singleton_p (gimple_seq seq)
1271 return ((gimple_seq_first (seq) != NULL)
1272 && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1275 /* Return true if no warnings should be emitted for statement STMT. */
1277 static inline bool
1278 gimple_no_warning_p (const_gimple stmt)
1280 return stmt->gsbase.no_warning;
1283 /* Set the no_warning flag of STMT to NO_WARNING. */
1285 static inline void
1286 gimple_set_no_warning (gimple stmt, bool no_warning)
1288 stmt->gsbase.no_warning = (unsigned) no_warning;
1291 /* Set the visited status on statement STMT to VISITED_P. */
1293 static inline void
1294 gimple_set_visited (gimple stmt, bool visited_p)
1296 stmt->gsbase.visited = (unsigned) visited_p;
1300 /* Return the visited status for statement STMT. */
1302 static inline bool
1303 gimple_visited_p (gimple stmt)
1305 return stmt->gsbase.visited;
1309 /* Set pass local flag PLF on statement STMT to VAL_P. */
1311 static inline void
1312 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1314 if (val_p)
1315 stmt->gsbase.plf |= (unsigned int) plf;
1316 else
1317 stmt->gsbase.plf &= ~((unsigned int) plf);
1321 /* Return the value of pass local flag PLF on statement STMT. */
1323 static inline unsigned int
1324 gimple_plf (gimple stmt, enum plf_mask plf)
1326 return stmt->gsbase.plf & ((unsigned int) plf);
1330 /* Set the UID of statement. */
1332 static inline void
1333 gimple_set_uid (gimple g, unsigned uid)
1335 g->gsbase.uid = uid;
1339 /* Return the UID of statement. */
1341 static inline unsigned
1342 gimple_uid (const_gimple g)
1344 return g->gsbase.uid;
1348 /* Make statement G a singleton sequence. */
1350 static inline void
1351 gimple_init_singleton (gimple g)
1353 g->gsbase.next = NULL;
1354 g->gsbase.prev = g;
1358 /* Return true if GIMPLE statement G has register or memory operands. */
1360 static inline bool
1361 gimple_has_ops (const_gimple g)
1363 return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1367 /* Return true if GIMPLE statement G has memory operands. */
1369 static inline bool
1370 gimple_has_mem_ops (const_gimple g)
1372 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1376 /* Return the set of DEF operands for statement G. */
1378 static inline struct def_optype_d *
1379 gimple_def_ops (const_gimple g)
1381 if (!gimple_has_ops (g))
1382 return NULL;
1383 return g->gsops.opbase.def_ops;
1387 /* Set DEF to be the set of DEF operands for statement G. */
1389 static inline void
1390 gimple_set_def_ops (gimple g, struct def_optype_d *def)
1392 gcc_gimple_checking_assert (gimple_has_ops (g));
1393 g->gsops.opbase.def_ops = def;
1397 /* Return the set of USE operands for statement G. */
1399 static inline struct use_optype_d *
1400 gimple_use_ops (const_gimple g)
1402 if (!gimple_has_ops (g))
1403 return NULL;
1404 return g->gsops.opbase.use_ops;
1408 /* Set USE to be the set of USE operands for statement G. */
1410 static inline void
1411 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1413 gcc_gimple_checking_assert (gimple_has_ops (g));
1414 g->gsops.opbase.use_ops = use;
1418 /* Return the set of VUSE operand for statement G. */
1420 static inline use_operand_p
1421 gimple_vuse_op (const_gimple g)
1423 struct use_optype_d *ops;
1424 if (!gimple_has_mem_ops (g))
1425 return NULL_USE_OPERAND_P;
1426 ops = g->gsops.opbase.use_ops;
1427 if (ops
1428 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
1429 return USE_OP_PTR (ops);
1430 return NULL_USE_OPERAND_P;
1433 /* Return the set of VDEF operand for statement G. */
1435 static inline def_operand_p
1436 gimple_vdef_op (const_gimple g)
1438 struct def_optype_d *ops;
1439 if (!gimple_has_mem_ops (g))
1440 return NULL_DEF_OPERAND_P;
1441 ops = g->gsops.opbase.def_ops;
1442 if (ops
1443 && DEF_OP_PTR (ops) == &g->gsmembase.vdef)
1444 return DEF_OP_PTR (ops);
1445 return NULL_DEF_OPERAND_P;
1449 /* Return the single VUSE operand of the statement G. */
1451 static inline tree
1452 gimple_vuse (const_gimple g)
1454 if (!gimple_has_mem_ops (g))
1455 return NULL_TREE;
1456 return g->gsmembase.vuse;
1459 /* Return the single VDEF operand of the statement G. */
1461 static inline tree
1462 gimple_vdef (const_gimple g)
1464 if (!gimple_has_mem_ops (g))
1465 return NULL_TREE;
1466 return g->gsmembase.vdef;
1469 /* Return the single VUSE operand of the statement G. */
1471 static inline tree *
1472 gimple_vuse_ptr (gimple g)
1474 if (!gimple_has_mem_ops (g))
1475 return NULL;
1476 return &g->gsmembase.vuse;
1479 /* Return the single VDEF operand of the statement G. */
1481 static inline tree *
1482 gimple_vdef_ptr (gimple g)
1484 if (!gimple_has_mem_ops (g))
1485 return NULL;
1486 return &g->gsmembase.vdef;
1489 /* Set the single VUSE operand of the statement G. */
1491 static inline void
1492 gimple_set_vuse (gimple g, tree vuse)
1494 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1495 g->gsmembase.vuse = vuse;
1498 /* Set the single VDEF operand of the statement G. */
1500 static inline void
1501 gimple_set_vdef (gimple g, tree vdef)
1503 gcc_gimple_checking_assert (gimple_has_mem_ops (g));
1504 g->gsmembase.vdef = vdef;
1508 /* Return true if statement G has operands and the modified field has
1509 been set. */
1511 static inline bool
1512 gimple_modified_p (const_gimple g)
1514 return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
1518 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1519 a MODIFIED field. */
1521 static inline void
1522 gimple_set_modified (gimple s, bool modifiedp)
1524 if (gimple_has_ops (s))
1525 s->gsbase.modified = (unsigned) modifiedp;
1529 /* Return the tree code for the expression computed by STMT. This is
1530 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1531 GIMPLE_CALL, return CALL_EXPR as the expression code for
1532 consistency. This is useful when the caller needs to deal with the
1533 three kinds of computation that GIMPLE supports. */
1535 static inline enum tree_code
1536 gimple_expr_code (const_gimple stmt)
1538 enum gimple_code code = gimple_code (stmt);
1539 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1540 return (enum tree_code) stmt->gsbase.subcode;
1541 else
1543 gcc_gimple_checking_assert (code == GIMPLE_CALL);
1544 return CALL_EXPR;
1549 /* Mark statement S as modified, and update it. */
1551 static inline void
1552 update_stmt (gimple s)
1554 if (gimple_has_ops (s))
1556 gimple_set_modified (s, true);
1557 update_stmt_operands (s);
1561 /* Update statement S if it has been optimized. */
1563 static inline void
1564 update_stmt_if_modified (gimple s)
1566 if (gimple_modified_p (s))
1567 update_stmt_operands (s);
1570 /* Return true if statement STMT contains volatile operands. */
1572 static inline bool
1573 gimple_has_volatile_ops (const_gimple stmt)
1575 if (gimple_has_mem_ops (stmt))
1576 return stmt->gsbase.has_volatile_ops;
1577 else
1578 return false;
1582 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1584 static inline void
1585 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1587 if (gimple_has_mem_ops (stmt))
1588 stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
1591 /* Return true if BB is in a transaction. */
1593 static inline bool
1594 block_in_transaction (basic_block bb)
1596 return flag_tm && bb->flags & BB_IN_TRANSACTION;
1599 /* Return true if STMT is in a transaction. */
1601 static inline bool
1602 gimple_in_transaction (gimple stmt)
1604 return block_in_transaction (gimple_bb (stmt));
1607 /* Return true if statement STMT may access memory. */
1609 static inline bool
1610 gimple_references_memory_p (gimple stmt)
1612 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1616 /* Return the subcode for OMP statement S. */
1618 static inline unsigned
1619 gimple_omp_subcode (const_gimple s)
1621 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1622 && gimple_code (s) <= GIMPLE_OMP_SINGLE);
1623 return s->gsbase.subcode;
1626 /* Set the subcode for OMP statement S to SUBCODE. */
1628 static inline void
1629 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1631 /* We only have 16 bits for the subcode. Assert that we are not
1632 overflowing it. */
1633 gcc_gimple_checking_assert (subcode < (1 << 16));
1634 s->gsbase.subcode = subcode;
1637 /* Set the nowait flag on OMP_RETURN statement S. */
1639 static inline void
1640 gimple_omp_return_set_nowait (gimple s)
1642 GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1643 s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
1647 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1648 flag set. */
1650 static inline bool
1651 gimple_omp_return_nowait_p (const_gimple g)
1653 GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1654 return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1658 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1659 flag set. */
1661 static inline bool
1662 gimple_omp_section_last_p (const_gimple g)
1664 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1665 return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1669 /* Set the GF_OMP_SECTION_LAST flag on G. */
1671 static inline void
1672 gimple_omp_section_set_last (gimple g)
1674 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1675 g->gsbase.subcode |= GF_OMP_SECTION_LAST;
1679 /* Return true if OMP parallel statement G has the
1680 GF_OMP_PARALLEL_COMBINED flag set. */
1682 static inline bool
1683 gimple_omp_parallel_combined_p (const_gimple g)
1685 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1686 return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1690 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1691 value of COMBINED_P. */
1693 static inline void
1694 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1696 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1697 if (combined_p)
1698 g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
1699 else
1700 g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
1704 /* Return true if OMP atomic load/store statement G has the
1705 GF_OMP_ATOMIC_NEED_VALUE flag set. */
1707 static inline bool
1708 gimple_omp_atomic_need_value_p (const_gimple g)
1710 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1711 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1712 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
1716 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
1718 static inline void
1719 gimple_omp_atomic_set_need_value (gimple g)
1721 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1722 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1723 g->gsbase.subcode |= GF_OMP_ATOMIC_NEED_VALUE;
1727 /* Return the number of operands for statement GS. */
1729 static inline unsigned
1730 gimple_num_ops (const_gimple gs)
1732 return gs->gsbase.num_ops;
1736 /* Set the number of operands for statement GS. */
1738 static inline void
1739 gimple_set_num_ops (gimple gs, unsigned num_ops)
1741 gs->gsbase.num_ops = num_ops;
1745 /* Return the array of operands for statement GS. */
1747 static inline tree *
1748 gimple_ops (gimple gs)
1750 size_t off;
1752 /* All the tuples have their operand vector at the very bottom
1753 of the structure. Note that those structures that do not
1754 have an operand vector have a zero offset. */
1755 off = gimple_ops_offset_[gimple_statement_structure (gs)];
1756 gcc_gimple_checking_assert (off != 0);
1758 return (tree *) ((char *) gs + off);
1762 /* Return operand I for statement GS. */
1764 static inline tree
1765 gimple_op (const_gimple gs, unsigned i)
1767 if (gimple_has_ops (gs))
1769 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1770 return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1772 else
1773 return NULL_TREE;
1776 /* Return a pointer to operand I for statement GS. */
1778 static inline tree *
1779 gimple_op_ptr (const_gimple gs, unsigned i)
1781 if (gimple_has_ops (gs))
1783 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1784 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1786 else
1787 return NULL;
1790 /* Set operand I of statement GS to OP. */
1792 static inline void
1793 gimple_set_op (gimple gs, unsigned i, tree op)
1795 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1797 /* Note. It may be tempting to assert that OP matches
1798 is_gimple_operand, but that would be wrong. Different tuples
1799 accept slightly different sets of tree operands. Each caller
1800 should perform its own validation. */
1801 gimple_ops (gs)[i] = op;
1804 /* Return true if GS is a GIMPLE_ASSIGN. */
1806 static inline bool
1807 is_gimple_assign (const_gimple gs)
1809 return gimple_code (gs) == GIMPLE_ASSIGN;
1812 /* Determine if expression CODE is one of the valid expressions that can
1813 be used on the RHS of GIMPLE assignments. */
1815 static inline enum gimple_rhs_class
1816 get_gimple_rhs_class (enum tree_code code)
1818 return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1821 /* Return the LHS of assignment statement GS. */
1823 static inline tree
1824 gimple_assign_lhs (const_gimple gs)
1826 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1827 return gimple_op (gs, 0);
1831 /* Return a pointer to the LHS of assignment statement GS. */
1833 static inline tree *
1834 gimple_assign_lhs_ptr (const_gimple gs)
1836 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1837 return gimple_op_ptr (gs, 0);
1841 /* Set LHS to be the LHS operand of assignment statement GS. */
1843 static inline void
1844 gimple_assign_set_lhs (gimple gs, tree lhs)
1846 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1847 gimple_set_op (gs, 0, lhs);
1849 if (lhs && TREE_CODE (lhs) == SSA_NAME)
1850 SSA_NAME_DEF_STMT (lhs) = gs;
1854 /* Return the first operand on the RHS of assignment statement GS. */
1856 static inline tree
1857 gimple_assign_rhs1 (const_gimple gs)
1859 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1860 return gimple_op (gs, 1);
1864 /* Return a pointer to the first operand on the RHS of assignment
1865 statement GS. */
1867 static inline tree *
1868 gimple_assign_rhs1_ptr (const_gimple gs)
1870 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1871 return gimple_op_ptr (gs, 1);
1874 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
1876 static inline void
1877 gimple_assign_set_rhs1 (gimple gs, tree rhs)
1879 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1881 gimple_set_op (gs, 1, rhs);
1885 /* Return the second operand on the RHS of assignment statement GS.
1886 If GS does not have two operands, NULL is returned instead. */
1888 static inline tree
1889 gimple_assign_rhs2 (const_gimple gs)
1891 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1893 if (gimple_num_ops (gs) >= 3)
1894 return gimple_op (gs, 2);
1895 else
1896 return NULL_TREE;
1900 /* Return a pointer to the second operand on the RHS of assignment
1901 statement GS. */
1903 static inline tree *
1904 gimple_assign_rhs2_ptr (const_gimple gs)
1906 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1907 return gimple_op_ptr (gs, 2);
1911 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
1913 static inline void
1914 gimple_assign_set_rhs2 (gimple gs, tree rhs)
1916 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1918 gimple_set_op (gs, 2, rhs);
1921 /* Return the third operand on the RHS of assignment statement GS.
1922 If GS does not have two operands, NULL is returned instead. */
1924 static inline tree
1925 gimple_assign_rhs3 (const_gimple gs)
1927 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1929 if (gimple_num_ops (gs) >= 4)
1930 return gimple_op (gs, 3);
1931 else
1932 return NULL_TREE;
1935 /* Return a pointer to the third operand on the RHS of assignment
1936 statement GS. */
1938 static inline tree *
1939 gimple_assign_rhs3_ptr (const_gimple gs)
1941 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1942 return gimple_op_ptr (gs, 3);
1946 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
1948 static inline void
1949 gimple_assign_set_rhs3 (gimple gs, tree rhs)
1951 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1953 gimple_set_op (gs, 3, rhs);
1956 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
1957 to see only a maximum of two operands. */
1959 static inline void
1960 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
1961 tree op1, tree op2)
1963 gimple_assign_set_rhs_with_ops_1 (gsi, code, op1, op2, NULL);
1966 /* A wrapper around extract_ops_from_tree_1, for callers which expect
1967 to see only a maximum of two operands. */
1969 static inline void
1970 extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0,
1971 tree *op1)
1973 tree op2;
1974 extract_ops_from_tree_1 (expr, code, op0, op1, &op2);
1975 gcc_assert (op2 == NULL_TREE);
1978 /* Returns true if GS is a nontemporal move. */
1980 static inline bool
1981 gimple_assign_nontemporal_move_p (const_gimple gs)
1983 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1984 return gs->gsbase.nontemporal_move;
1987 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
1989 static inline void
1990 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
1992 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1993 gs->gsbase.nontemporal_move = nontemporal;
1997 /* Return the code of the expression computed on the rhs of assignment
1998 statement GS. In case that the RHS is a single object, returns the
1999 tree code of the object. */
2001 static inline enum tree_code
2002 gimple_assign_rhs_code (const_gimple gs)
2004 enum tree_code code;
2005 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2007 code = (enum tree_code) gs->gsbase.subcode;
2008 /* While we initially set subcode to the TREE_CODE of the rhs for
2009 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2010 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2011 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2012 code = TREE_CODE (gimple_assign_rhs1 (gs));
2014 return code;
2018 /* Set CODE to be the code for the expression computed on the RHS of
2019 assignment S. */
2021 static inline void
2022 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
2024 GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2025 s->gsbase.subcode = code;
2029 /* Return the gimple rhs class of the code of the expression computed on
2030 the rhs of assignment statement GS.
2031 This will never return GIMPLE_INVALID_RHS. */
2033 static inline enum gimple_rhs_class
2034 gimple_assign_rhs_class (const_gimple gs)
2036 return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2039 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2040 there is no operator associated with the assignment itself.
2041 Unlike gimple_assign_copy_p, this predicate returns true for
2042 any RHS operand, including those that perform an operation
2043 and do not have the semantics of a copy, such as COND_EXPR. */
2045 static inline bool
2046 gimple_assign_single_p (gimple gs)
2048 return (is_gimple_assign (gs)
2049 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2053 /* Return true if S is a type-cast assignment. */
2055 static inline bool
2056 gimple_assign_cast_p (gimple s)
2058 if (is_gimple_assign (s))
2060 enum tree_code sc = gimple_assign_rhs_code (s);
2061 return CONVERT_EXPR_CODE_P (sc)
2062 || sc == VIEW_CONVERT_EXPR
2063 || sc == FIX_TRUNC_EXPR;
2066 return false;
2069 /* Return true if S is a clobber statement. */
2071 static inline bool
2072 gimple_clobber_p (gimple s)
2074 return gimple_assign_single_p (s)
2075 && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2078 /* Return true if GS is a GIMPLE_CALL. */
2080 static inline bool
2081 is_gimple_call (const_gimple gs)
2083 return gimple_code (gs) == GIMPLE_CALL;
2086 /* Return the LHS of call statement GS. */
2088 static inline tree
2089 gimple_call_lhs (const_gimple gs)
2091 GIMPLE_CHECK (gs, GIMPLE_CALL);
2092 return gimple_op (gs, 0);
2096 /* Return a pointer to the LHS of call statement GS. */
2098 static inline tree *
2099 gimple_call_lhs_ptr (const_gimple gs)
2101 GIMPLE_CHECK (gs, GIMPLE_CALL);
2102 return gimple_op_ptr (gs, 0);
2106 /* Set LHS to be the LHS operand of call statement GS. */
2108 static inline void
2109 gimple_call_set_lhs (gimple gs, tree lhs)
2111 GIMPLE_CHECK (gs, GIMPLE_CALL);
2112 gimple_set_op (gs, 0, lhs);
2113 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2114 SSA_NAME_DEF_STMT (lhs) = gs;
2118 /* Return true if call GS calls an internal-only function, as enumerated
2119 by internal_fn. */
2121 static inline bool
2122 gimple_call_internal_p (const_gimple gs)
2124 GIMPLE_CHECK (gs, GIMPLE_CALL);
2125 return (gs->gsbase.subcode & GF_CALL_INTERNAL) != 0;
2129 /* Return the target of internal call GS. */
2131 static inline enum internal_fn
2132 gimple_call_internal_fn (const_gimple gs)
2134 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2135 return gs->gimple_call.u.internal_fn;
2139 /* Return the function type of the function called by GS. */
2141 static inline tree
2142 gimple_call_fntype (const_gimple gs)
2144 GIMPLE_CHECK (gs, GIMPLE_CALL);
2145 if (gimple_call_internal_p (gs))
2146 return NULL_TREE;
2147 return gs->gimple_call.u.fntype;
2150 /* Set the type of the function called by GS to FNTYPE. */
2152 static inline void
2153 gimple_call_set_fntype (gimple gs, tree fntype)
2155 GIMPLE_CHECK (gs, GIMPLE_CALL);
2156 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2157 gs->gimple_call.u.fntype = fntype;
2161 /* Return the tree node representing the function called by call
2162 statement GS. */
2164 static inline tree
2165 gimple_call_fn (const_gimple gs)
2167 GIMPLE_CHECK (gs, GIMPLE_CALL);
2168 return gimple_op (gs, 1);
2171 /* Return a pointer to the tree node representing the function called by call
2172 statement GS. */
2174 static inline tree *
2175 gimple_call_fn_ptr (const_gimple gs)
2177 GIMPLE_CHECK (gs, GIMPLE_CALL);
2178 return gimple_op_ptr (gs, 1);
2182 /* Set FN to be the function called by call statement GS. */
2184 static inline void
2185 gimple_call_set_fn (gimple gs, tree fn)
2187 GIMPLE_CHECK (gs, GIMPLE_CALL);
2188 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2189 gimple_set_op (gs, 1, fn);
2193 /* Set FNDECL to be the function called by call statement GS. */
2195 static inline void
2196 gimple_call_set_fndecl (gimple gs, tree decl)
2198 GIMPLE_CHECK (gs, GIMPLE_CALL);
2199 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2200 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
2204 /* Set internal function FN to be the function called by call statement GS. */
2206 static inline void
2207 gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
2209 GIMPLE_CHECK (gs, GIMPLE_CALL);
2210 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2211 gs->gimple_call.u.internal_fn = fn;
2215 /* Given a valid GIMPLE_CALL function address return the FUNCTION_DECL
2216 associated with the callee if known. Otherwise return NULL_TREE. */
2218 static inline tree
2219 gimple_call_addr_fndecl (const_tree fn)
2221 if (fn && TREE_CODE (fn) == ADDR_EXPR)
2223 tree fndecl = TREE_OPERAND (fn, 0);
2224 if (TREE_CODE (fndecl) == MEM_REF
2225 && TREE_CODE (TREE_OPERAND (fndecl, 0)) == ADDR_EXPR
2226 && integer_zerop (TREE_OPERAND (fndecl, 1)))
2227 fndecl = TREE_OPERAND (TREE_OPERAND (fndecl, 0), 0);
2228 if (TREE_CODE (fndecl) == FUNCTION_DECL)
2229 return fndecl;
2231 return NULL_TREE;
2234 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2235 Otherwise return NULL. This function is analogous to
2236 get_callee_fndecl in tree land. */
2238 static inline tree
2239 gimple_call_fndecl (const_gimple gs)
2241 return gimple_call_addr_fndecl (gimple_call_fn (gs));
2245 /* Return the type returned by call statement GS. */
2247 static inline tree
2248 gimple_call_return_type (const_gimple gs)
2250 tree type = gimple_call_fntype (gs);
2252 if (type == NULL_TREE)
2253 return TREE_TYPE (gimple_call_lhs (gs));
2255 /* The type returned by a function is the type of its
2256 function type. */
2257 return TREE_TYPE (type);
2261 /* Return the static chain for call statement GS. */
2263 static inline tree
2264 gimple_call_chain (const_gimple gs)
2266 GIMPLE_CHECK (gs, GIMPLE_CALL);
2267 return gimple_op (gs, 2);
2271 /* Return a pointer to the static chain for call statement GS. */
2273 static inline tree *
2274 gimple_call_chain_ptr (const_gimple gs)
2276 GIMPLE_CHECK (gs, GIMPLE_CALL);
2277 return gimple_op_ptr (gs, 2);
2280 /* Set CHAIN to be the static chain for call statement GS. */
2282 static inline void
2283 gimple_call_set_chain (gimple gs, tree chain)
2285 GIMPLE_CHECK (gs, GIMPLE_CALL);
2287 gimple_set_op (gs, 2, chain);
2291 /* Return the number of arguments used by call statement GS. */
2293 static inline unsigned
2294 gimple_call_num_args (const_gimple gs)
2296 unsigned num_ops;
2297 GIMPLE_CHECK (gs, GIMPLE_CALL);
2298 num_ops = gimple_num_ops (gs);
2299 return num_ops - 3;
2303 /* Return the argument at position INDEX for call statement GS. */
2305 static inline tree
2306 gimple_call_arg (const_gimple gs, unsigned index)
2308 GIMPLE_CHECK (gs, GIMPLE_CALL);
2309 return gimple_op (gs, index + 3);
2313 /* Return a pointer to the argument at position INDEX for call
2314 statement GS. */
2316 static inline tree *
2317 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2319 GIMPLE_CHECK (gs, GIMPLE_CALL);
2320 return gimple_op_ptr (gs, index + 3);
2324 /* Set ARG to be the argument at position INDEX for call statement GS. */
2326 static inline void
2327 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2329 GIMPLE_CHECK (gs, GIMPLE_CALL);
2330 gimple_set_op (gs, index + 3, arg);
2334 /* If TAIL_P is true, mark call statement S as being a tail call
2335 (i.e., a call just before the exit of a function). These calls are
2336 candidate for tail call optimization. */
2338 static inline void
2339 gimple_call_set_tail (gimple s, bool tail_p)
2341 GIMPLE_CHECK (s, GIMPLE_CALL);
2342 if (tail_p)
2343 s->gsbase.subcode |= GF_CALL_TAILCALL;
2344 else
2345 s->gsbase.subcode &= ~GF_CALL_TAILCALL;
2349 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2351 static inline bool
2352 gimple_call_tail_p (gimple s)
2354 GIMPLE_CHECK (s, GIMPLE_CALL);
2355 return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
2359 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2360 slot optimization. This transformation uses the target of the call
2361 expansion as the return slot for calls that return in memory. */
2363 static inline void
2364 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2366 GIMPLE_CHECK (s, GIMPLE_CALL);
2367 if (return_slot_opt_p)
2368 s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
2369 else
2370 s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2374 /* Return true if S is marked for return slot optimization. */
2376 static inline bool
2377 gimple_call_return_slot_opt_p (gimple s)
2379 GIMPLE_CHECK (s, GIMPLE_CALL);
2380 return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2384 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2385 thunk to the thunked-to function. */
2387 static inline void
2388 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2390 GIMPLE_CHECK (s, GIMPLE_CALL);
2391 if (from_thunk_p)
2392 s->gsbase.subcode |= GF_CALL_FROM_THUNK;
2393 else
2394 s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
2398 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2400 static inline bool
2401 gimple_call_from_thunk_p (gimple s)
2403 GIMPLE_CHECK (s, GIMPLE_CALL);
2404 return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
2408 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2409 argument pack in its argument list. */
2411 static inline void
2412 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2414 GIMPLE_CHECK (s, GIMPLE_CALL);
2415 if (pass_arg_pack_p)
2416 s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
2417 else
2418 s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
2422 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2423 argument pack in its argument list. */
2425 static inline bool
2426 gimple_call_va_arg_pack_p (gimple s)
2428 GIMPLE_CHECK (s, GIMPLE_CALL);
2429 return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
2433 /* Return true if S is a noreturn call. */
2435 static inline bool
2436 gimple_call_noreturn_p (gimple s)
2438 GIMPLE_CHECK (s, GIMPLE_CALL);
2439 return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2443 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2444 even if the called function can throw in other cases. */
2446 static inline void
2447 gimple_call_set_nothrow (gimple s, bool nothrow_p)
2449 GIMPLE_CHECK (s, GIMPLE_CALL);
2450 if (nothrow_p)
2451 s->gsbase.subcode |= GF_CALL_NOTHROW;
2452 else
2453 s->gsbase.subcode &= ~GF_CALL_NOTHROW;
2456 /* Return true if S is a nothrow call. */
2458 static inline bool
2459 gimple_call_nothrow_p (gimple s)
2461 GIMPLE_CHECK (s, GIMPLE_CALL);
2462 return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2465 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2466 is known to be emitted for VLA objects. Those are wrapped by
2467 stack_save/stack_restore calls and hence can't lead to unbounded
2468 stack growth even when they occur in loops. */
2470 static inline void
2471 gimple_call_set_alloca_for_var (gimple s, bool for_var)
2473 GIMPLE_CHECK (s, GIMPLE_CALL);
2474 if (for_var)
2475 s->gsbase.subcode |= GF_CALL_ALLOCA_FOR_VAR;
2476 else
2477 s->gsbase.subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
2480 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2482 static inline bool
2483 gimple_call_alloca_for_var_p (gimple s)
2485 GIMPLE_CHECK (s, GIMPLE_CALL);
2486 return (s->gsbase.subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
2489 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2491 static inline void
2492 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2494 GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2495 GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2496 dest_call->gsbase.subcode = orig_call->gsbase.subcode;
2500 /* Return a pointer to the points-to solution for the set of call-used
2501 variables of the call CALL. */
2503 static inline struct pt_solution *
2504 gimple_call_use_set (gimple call)
2506 GIMPLE_CHECK (call, GIMPLE_CALL);
2507 return &call->gimple_call.call_used;
2511 /* Return a pointer to the points-to solution for the set of call-used
2512 variables of the call CALL. */
2514 static inline struct pt_solution *
2515 gimple_call_clobber_set (gimple call)
2517 GIMPLE_CHECK (call, GIMPLE_CALL);
2518 return &call->gimple_call.call_clobbered;
2522 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2523 non-NULL lhs. */
2525 static inline bool
2526 gimple_has_lhs (gimple stmt)
2528 return (is_gimple_assign (stmt)
2529 || (is_gimple_call (stmt)
2530 && gimple_call_lhs (stmt) != NULL_TREE));
2534 /* Return the code of the predicate computed by conditional statement GS. */
2536 static inline enum tree_code
2537 gimple_cond_code (const_gimple gs)
2539 GIMPLE_CHECK (gs, GIMPLE_COND);
2540 return (enum tree_code) gs->gsbase.subcode;
2544 /* Set CODE to be the predicate code for the conditional statement GS. */
2546 static inline void
2547 gimple_cond_set_code (gimple gs, enum tree_code code)
2549 GIMPLE_CHECK (gs, GIMPLE_COND);
2550 gs->gsbase.subcode = code;
2554 /* Return the LHS of the predicate computed by conditional statement GS. */
2556 static inline tree
2557 gimple_cond_lhs (const_gimple gs)
2559 GIMPLE_CHECK (gs, GIMPLE_COND);
2560 return gimple_op (gs, 0);
2563 /* Return the pointer to the LHS of the predicate computed by conditional
2564 statement GS. */
2566 static inline tree *
2567 gimple_cond_lhs_ptr (const_gimple gs)
2569 GIMPLE_CHECK (gs, GIMPLE_COND);
2570 return gimple_op_ptr (gs, 0);
2573 /* Set LHS to be the LHS operand of the predicate computed by
2574 conditional statement GS. */
2576 static inline void
2577 gimple_cond_set_lhs (gimple gs, tree lhs)
2579 GIMPLE_CHECK (gs, GIMPLE_COND);
2580 gimple_set_op (gs, 0, lhs);
2584 /* Return the RHS operand of the predicate computed by conditional GS. */
2586 static inline tree
2587 gimple_cond_rhs (const_gimple gs)
2589 GIMPLE_CHECK (gs, GIMPLE_COND);
2590 return gimple_op (gs, 1);
2593 /* Return the pointer to the RHS operand of the predicate computed by
2594 conditional GS. */
2596 static inline tree *
2597 gimple_cond_rhs_ptr (const_gimple gs)
2599 GIMPLE_CHECK (gs, GIMPLE_COND);
2600 return gimple_op_ptr (gs, 1);
2604 /* Set RHS to be the RHS operand of the predicate computed by
2605 conditional statement GS. */
2607 static inline void
2608 gimple_cond_set_rhs (gimple gs, tree rhs)
2610 GIMPLE_CHECK (gs, GIMPLE_COND);
2611 gimple_set_op (gs, 1, rhs);
2615 /* Return the label used by conditional statement GS when its
2616 predicate evaluates to true. */
2618 static inline tree
2619 gimple_cond_true_label (const_gimple gs)
2621 GIMPLE_CHECK (gs, GIMPLE_COND);
2622 return gimple_op (gs, 2);
2626 /* Set LABEL to be the label used by conditional statement GS when its
2627 predicate evaluates to true. */
2629 static inline void
2630 gimple_cond_set_true_label (gimple gs, tree label)
2632 GIMPLE_CHECK (gs, GIMPLE_COND);
2633 gimple_set_op (gs, 2, label);
2637 /* Set LABEL to be the label used by conditional statement GS when its
2638 predicate evaluates to false. */
2640 static inline void
2641 gimple_cond_set_false_label (gimple gs, tree label)
2643 GIMPLE_CHECK (gs, GIMPLE_COND);
2644 gimple_set_op (gs, 3, label);
2648 /* Return the label used by conditional statement GS when its
2649 predicate evaluates to false. */
2651 static inline tree
2652 gimple_cond_false_label (const_gimple gs)
2654 GIMPLE_CHECK (gs, GIMPLE_COND);
2655 return gimple_op (gs, 3);
2659 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
2661 static inline void
2662 gimple_cond_make_false (gimple gs)
2664 gimple_cond_set_lhs (gs, boolean_true_node);
2665 gimple_cond_set_rhs (gs, boolean_false_node);
2666 gs->gsbase.subcode = EQ_EXPR;
2670 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
2672 static inline void
2673 gimple_cond_make_true (gimple gs)
2675 gimple_cond_set_lhs (gs, boolean_true_node);
2676 gimple_cond_set_rhs (gs, boolean_true_node);
2677 gs->gsbase.subcode = EQ_EXPR;
2680 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2681 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2683 static inline bool
2684 gimple_cond_true_p (const_gimple gs)
2686 tree lhs = gimple_cond_lhs (gs);
2687 tree rhs = gimple_cond_rhs (gs);
2688 enum tree_code code = gimple_cond_code (gs);
2690 if (lhs != boolean_true_node && lhs != boolean_false_node)
2691 return false;
2693 if (rhs != boolean_true_node && rhs != boolean_false_node)
2694 return false;
2696 if (code == NE_EXPR && lhs != rhs)
2697 return true;
2699 if (code == EQ_EXPR && lhs == rhs)
2700 return true;
2702 return false;
2705 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2706 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2708 static inline bool
2709 gimple_cond_false_p (const_gimple gs)
2711 tree lhs = gimple_cond_lhs (gs);
2712 tree rhs = gimple_cond_rhs (gs);
2713 enum tree_code code = gimple_cond_code (gs);
2715 if (lhs != boolean_true_node && lhs != boolean_false_node)
2716 return false;
2718 if (rhs != boolean_true_node && rhs != boolean_false_node)
2719 return false;
2721 if (code == NE_EXPR && lhs == rhs)
2722 return true;
2724 if (code == EQ_EXPR && lhs != rhs)
2725 return true;
2727 return false;
2730 /* Check if conditional statement GS is of the form 'if (var != 0)' or
2731 'if (var == 1)' */
2733 static inline bool
2734 gimple_cond_single_var_p (gimple gs)
2736 if (gimple_cond_code (gs) == NE_EXPR
2737 && gimple_cond_rhs (gs) == boolean_false_node)
2738 return true;
2740 if (gimple_cond_code (gs) == EQ_EXPR
2741 && gimple_cond_rhs (gs) == boolean_true_node)
2742 return true;
2744 return false;
2747 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
2749 static inline void
2750 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2752 gimple_cond_set_code (stmt, code);
2753 gimple_cond_set_lhs (stmt, lhs);
2754 gimple_cond_set_rhs (stmt, rhs);
2757 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
2759 static inline tree
2760 gimple_label_label (const_gimple gs)
2762 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2763 return gimple_op (gs, 0);
2767 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2768 GS. */
2770 static inline void
2771 gimple_label_set_label (gimple gs, tree label)
2773 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2774 gimple_set_op (gs, 0, label);
2778 /* Return the destination of the unconditional jump GS. */
2780 static inline tree
2781 gimple_goto_dest (const_gimple gs)
2783 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2784 return gimple_op (gs, 0);
2788 /* Set DEST to be the destination of the unconditonal jump GS. */
2790 static inline void
2791 gimple_goto_set_dest (gimple gs, tree dest)
2793 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2794 gimple_set_op (gs, 0, dest);
2798 /* Return the variables declared in the GIMPLE_BIND statement GS. */
2800 static inline tree
2801 gimple_bind_vars (const_gimple gs)
2803 GIMPLE_CHECK (gs, GIMPLE_BIND);
2804 return gs->gimple_bind.vars;
2808 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2809 statement GS. */
2811 static inline void
2812 gimple_bind_set_vars (gimple gs, tree vars)
2814 GIMPLE_CHECK (gs, GIMPLE_BIND);
2815 gs->gimple_bind.vars = vars;
2819 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2820 statement GS. */
2822 static inline void
2823 gimple_bind_append_vars (gimple gs, tree vars)
2825 GIMPLE_CHECK (gs, GIMPLE_BIND);
2826 gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
2830 static inline gimple_seq *
2831 gimple_bind_body_ptr (gimple gs)
2833 GIMPLE_CHECK (gs, GIMPLE_BIND);
2834 return &gs->gimple_bind.body;
2837 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
2839 static inline gimple_seq
2840 gimple_bind_body (gimple gs)
2842 return *gimple_bind_body_ptr (gs);
2846 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
2847 statement GS. */
2849 static inline void
2850 gimple_bind_set_body (gimple gs, gimple_seq seq)
2852 GIMPLE_CHECK (gs, GIMPLE_BIND);
2853 gs->gimple_bind.body = seq;
2857 /* Append a statement to the end of a GIMPLE_BIND's body. */
2859 static inline void
2860 gimple_bind_add_stmt (gimple gs, gimple stmt)
2862 GIMPLE_CHECK (gs, GIMPLE_BIND);
2863 gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
2867 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
2869 static inline void
2870 gimple_bind_add_seq (gimple gs, gimple_seq seq)
2872 GIMPLE_CHECK (gs, GIMPLE_BIND);
2873 gimple_seq_add_seq (&gs->gimple_bind.body, seq);
2877 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
2878 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
2880 static inline tree
2881 gimple_bind_block (const_gimple gs)
2883 GIMPLE_CHECK (gs, GIMPLE_BIND);
2884 return gs->gimple_bind.block;
2888 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
2889 statement GS. */
2891 static inline void
2892 gimple_bind_set_block (gimple gs, tree block)
2894 GIMPLE_CHECK (gs, GIMPLE_BIND);
2895 gcc_gimple_checking_assert (block == NULL_TREE
2896 || TREE_CODE (block) == BLOCK);
2897 gs->gimple_bind.block = block;
2901 /* Return the number of input operands for GIMPLE_ASM GS. */
2903 static inline unsigned
2904 gimple_asm_ninputs (const_gimple gs)
2906 GIMPLE_CHECK (gs, GIMPLE_ASM);
2907 return gs->gimple_asm.ni;
2911 /* Return the number of output operands for GIMPLE_ASM GS. */
2913 static inline unsigned
2914 gimple_asm_noutputs (const_gimple gs)
2916 GIMPLE_CHECK (gs, GIMPLE_ASM);
2917 return gs->gimple_asm.no;
2921 /* Return the number of clobber operands for GIMPLE_ASM GS. */
2923 static inline unsigned
2924 gimple_asm_nclobbers (const_gimple gs)
2926 GIMPLE_CHECK (gs, GIMPLE_ASM);
2927 return gs->gimple_asm.nc;
2930 /* Return the number of label operands for GIMPLE_ASM GS. */
2932 static inline unsigned
2933 gimple_asm_nlabels (const_gimple gs)
2935 GIMPLE_CHECK (gs, GIMPLE_ASM);
2936 return gs->gimple_asm.nl;
2939 /* Return input operand INDEX of GIMPLE_ASM GS. */
2941 static inline tree
2942 gimple_asm_input_op (const_gimple gs, unsigned index)
2944 GIMPLE_CHECK (gs, GIMPLE_ASM);
2945 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
2946 return gimple_op (gs, index);
2949 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
2951 static inline tree *
2952 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
2954 GIMPLE_CHECK (gs, GIMPLE_ASM);
2955 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
2956 return gimple_op_ptr (gs, index);
2960 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
2962 static inline void
2963 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
2965 GIMPLE_CHECK (gs, GIMPLE_ASM);
2966 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni
2967 && TREE_CODE (in_op) == TREE_LIST);
2968 gimple_set_op (gs, index, in_op);
2972 /* Return output operand INDEX of GIMPLE_ASM GS. */
2974 static inline tree
2975 gimple_asm_output_op (const_gimple gs, unsigned index)
2977 GIMPLE_CHECK (gs, GIMPLE_ASM);
2978 gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
2979 return gimple_op (gs, index + gs->gimple_asm.ni);
2982 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
2984 static inline tree *
2985 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
2987 GIMPLE_CHECK (gs, GIMPLE_ASM);
2988 gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
2989 return gimple_op_ptr (gs, index + gs->gimple_asm.ni);
2993 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
2995 static inline void
2996 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
2998 GIMPLE_CHECK (gs, GIMPLE_ASM);
2999 gcc_gimple_checking_assert (index <= gs->gimple_asm.no
3000 && TREE_CODE (out_op) == TREE_LIST);
3001 gimple_set_op (gs, index + gs->gimple_asm.ni, out_op);
3005 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3007 static inline tree
3008 gimple_asm_clobber_op (const_gimple gs, unsigned index)
3010 GIMPLE_CHECK (gs, GIMPLE_ASM);
3011 gcc_gimple_checking_assert (index <= gs->gimple_asm.nc);
3012 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
3016 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3018 static inline void
3019 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
3021 GIMPLE_CHECK (gs, GIMPLE_ASM);
3022 gcc_gimple_checking_assert (index <= gs->gimple_asm.nc
3023 && TREE_CODE (clobber_op) == TREE_LIST);
3024 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
3027 /* Return label operand INDEX of GIMPLE_ASM GS. */
3029 static inline tree
3030 gimple_asm_label_op (const_gimple gs, unsigned index)
3032 GIMPLE_CHECK (gs, GIMPLE_ASM);
3033 gcc_gimple_checking_assert (index <= gs->gimple_asm.nl);
3034 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
3037 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3039 static inline void
3040 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
3042 GIMPLE_CHECK (gs, GIMPLE_ASM);
3043 gcc_gimple_checking_assert (index <= gs->gimple_asm.nl
3044 && TREE_CODE (label_op) == TREE_LIST);
3045 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
3048 /* Return the string representing the assembly instruction in
3049 GIMPLE_ASM GS. */
3051 static inline const char *
3052 gimple_asm_string (const_gimple gs)
3054 GIMPLE_CHECK (gs, GIMPLE_ASM);
3055 return gs->gimple_asm.string;
3059 /* Return true if GS is an asm statement marked volatile. */
3061 static inline bool
3062 gimple_asm_volatile_p (const_gimple gs)
3064 GIMPLE_CHECK (gs, GIMPLE_ASM);
3065 return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
3069 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3071 static inline void
3072 gimple_asm_set_volatile (gimple gs, bool volatile_p)
3074 GIMPLE_CHECK (gs, GIMPLE_ASM);
3075 if (volatile_p)
3076 gs->gsbase.subcode |= GF_ASM_VOLATILE;
3077 else
3078 gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
3082 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3084 static inline void
3085 gimple_asm_set_input (gimple gs, bool input_p)
3087 GIMPLE_CHECK (gs, GIMPLE_ASM);
3088 if (input_p)
3089 gs->gsbase.subcode |= GF_ASM_INPUT;
3090 else
3091 gs->gsbase.subcode &= ~GF_ASM_INPUT;
3095 /* Return true if asm GS is an ASM_INPUT. */
3097 static inline bool
3098 gimple_asm_input_p (const_gimple gs)
3100 GIMPLE_CHECK (gs, GIMPLE_ASM);
3101 return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
3105 /* Return the types handled by GIMPLE_CATCH statement GS. */
3107 static inline tree
3108 gimple_catch_types (const_gimple gs)
3110 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3111 return gs->gimple_catch.types;
3115 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3117 static inline tree *
3118 gimple_catch_types_ptr (gimple gs)
3120 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3121 return &gs->gimple_catch.types;
3125 /* Return a pointer to the GIMPLE sequence representing the body of
3126 the handler of GIMPLE_CATCH statement GS. */
3128 static inline gimple_seq *
3129 gimple_catch_handler_ptr (gimple gs)
3131 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3132 return &gs->gimple_catch.handler;
3136 /* Return the GIMPLE sequence representing the body of the handler of
3137 GIMPLE_CATCH statement GS. */
3139 static inline gimple_seq
3140 gimple_catch_handler (gimple gs)
3142 return *gimple_catch_handler_ptr (gs);
3146 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3148 static inline void
3149 gimple_catch_set_types (gimple gs, tree t)
3151 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3152 gs->gimple_catch.types = t;
3156 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3158 static inline void
3159 gimple_catch_set_handler (gimple gs, gimple_seq handler)
3161 GIMPLE_CHECK (gs, GIMPLE_CATCH);
3162 gs->gimple_catch.handler = handler;
3166 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3168 static inline tree
3169 gimple_eh_filter_types (const_gimple gs)
3171 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3172 return gs->gimple_eh_filter.types;
3176 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3177 GS. */
3179 static inline tree *
3180 gimple_eh_filter_types_ptr (gimple gs)
3182 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3183 return &gs->gimple_eh_filter.types;
3187 /* Return a pointer to the sequence of statement to execute when
3188 GIMPLE_EH_FILTER statement fails. */
3190 static inline gimple_seq *
3191 gimple_eh_filter_failure_ptr (gimple gs)
3193 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3194 return &gs->gimple_eh_filter.failure;
3198 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3199 statement fails. */
3201 static inline gimple_seq
3202 gimple_eh_filter_failure (gimple gs)
3204 return *gimple_eh_filter_failure_ptr (gs);
3208 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3210 static inline void
3211 gimple_eh_filter_set_types (gimple gs, tree types)
3213 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3214 gs->gimple_eh_filter.types = types;
3218 /* Set FAILURE to be the sequence of statements to execute on failure
3219 for GIMPLE_EH_FILTER GS. */
3221 static inline void
3222 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
3224 GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
3225 gs->gimple_eh_filter.failure = failure;
3228 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3230 static inline tree
3231 gimple_eh_must_not_throw_fndecl (gimple gs)
3233 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3234 return gs->gimple_eh_mnt.fndecl;
3237 /* Set the function decl to be called by GS to DECL. */
3239 static inline void
3240 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
3242 GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
3243 gs->gimple_eh_mnt.fndecl = decl;
3246 /* GIMPLE_EH_ELSE accessors. */
3248 static inline gimple_seq *
3249 gimple_eh_else_n_body_ptr (gimple gs)
3251 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3252 return &gs->gimple_eh_else.n_body;
3255 static inline gimple_seq
3256 gimple_eh_else_n_body (gimple gs)
3258 return *gimple_eh_else_n_body_ptr (gs);
3261 static inline gimple_seq *
3262 gimple_eh_else_e_body_ptr (gimple gs)
3264 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3265 return &gs->gimple_eh_else.e_body;
3268 static inline gimple_seq
3269 gimple_eh_else_e_body (gimple gs)
3271 return *gimple_eh_else_e_body_ptr (gs);
3274 static inline void
3275 gimple_eh_else_set_n_body (gimple gs, gimple_seq seq)
3277 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3278 gs->gimple_eh_else.n_body = seq;
3281 static inline void
3282 gimple_eh_else_set_e_body (gimple gs, gimple_seq seq)
3284 GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
3285 gs->gimple_eh_else.e_body = seq;
3288 /* GIMPLE_TRY accessors. */
3290 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3291 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3293 static inline enum gimple_try_flags
3294 gimple_try_kind (const_gimple gs)
3296 GIMPLE_CHECK (gs, GIMPLE_TRY);
3297 return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
3301 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3303 static inline void
3304 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
3306 GIMPLE_CHECK (gs, GIMPLE_TRY);
3307 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
3308 || kind == GIMPLE_TRY_FINALLY);
3309 if (gimple_try_kind (gs) != kind)
3310 gs->gsbase.subcode = (unsigned int) kind;
3314 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3316 static inline bool
3317 gimple_try_catch_is_cleanup (const_gimple gs)
3319 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
3320 return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3324 /* Return a pointer to the sequence of statements used as the
3325 body for GIMPLE_TRY GS. */
3327 static inline gimple_seq *
3328 gimple_try_eval_ptr (gimple gs)
3330 GIMPLE_CHECK (gs, GIMPLE_TRY);
3331 return &gs->gimple_try.eval;
3335 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3337 static inline gimple_seq
3338 gimple_try_eval (gimple gs)
3340 return *gimple_try_eval_ptr (gs);
3344 /* Return a pointer to the sequence of statements used as the cleanup body for
3345 GIMPLE_TRY GS. */
3347 static inline gimple_seq *
3348 gimple_try_cleanup_ptr (gimple gs)
3350 GIMPLE_CHECK (gs, GIMPLE_TRY);
3351 return &gs->gimple_try.cleanup;
3355 /* Return the sequence of statements used as the cleanup body for
3356 GIMPLE_TRY GS. */
3358 static inline gimple_seq
3359 gimple_try_cleanup (gimple gs)
3361 return *gimple_try_cleanup_ptr (gs);
3365 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3367 static inline void
3368 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3370 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3371 if (catch_is_cleanup)
3372 g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3373 else
3374 g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3378 /* Set EVAL to be the sequence of statements to use as the body for
3379 GIMPLE_TRY GS. */
3381 static inline void
3382 gimple_try_set_eval (gimple gs, gimple_seq eval)
3384 GIMPLE_CHECK (gs, GIMPLE_TRY);
3385 gs->gimple_try.eval = eval;
3389 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3390 body for GIMPLE_TRY GS. */
3392 static inline void
3393 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3395 GIMPLE_CHECK (gs, GIMPLE_TRY);
3396 gs->gimple_try.cleanup = cleanup;
3400 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3402 static inline gimple_seq *
3403 gimple_wce_cleanup_ptr (gimple gs)
3405 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3406 return &gs->gimple_wce.cleanup;
3410 /* Return the cleanup sequence for cleanup statement GS. */
3412 static inline gimple_seq
3413 gimple_wce_cleanup (gimple gs)
3415 return *gimple_wce_cleanup_ptr (gs);
3419 /* Set CLEANUP to be the cleanup sequence for GS. */
3421 static inline void
3422 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3424 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3425 gs->gimple_wce.cleanup = cleanup;
3429 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3431 static inline bool
3432 gimple_wce_cleanup_eh_only (const_gimple gs)
3434 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3435 return gs->gsbase.subcode != 0;
3439 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3441 static inline void
3442 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3444 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3445 gs->gsbase.subcode = (unsigned int) eh_only_p;
3449 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3451 static inline unsigned
3452 gimple_phi_capacity (const_gimple gs)
3454 GIMPLE_CHECK (gs, GIMPLE_PHI);
3455 return gs->gimple_phi.capacity;
3459 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3460 be exactly the number of incoming edges for the basic block holding
3461 GS. */
3463 static inline unsigned
3464 gimple_phi_num_args (const_gimple gs)
3466 GIMPLE_CHECK (gs, GIMPLE_PHI);
3467 return gs->gimple_phi.nargs;
3471 /* Return the SSA name created by GIMPLE_PHI GS. */
3473 static inline tree
3474 gimple_phi_result (const_gimple gs)
3476 GIMPLE_CHECK (gs, GIMPLE_PHI);
3477 return gs->gimple_phi.result;
3480 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3482 static inline tree *
3483 gimple_phi_result_ptr (gimple gs)
3485 GIMPLE_CHECK (gs, GIMPLE_PHI);
3486 return &gs->gimple_phi.result;
3489 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3491 static inline void
3492 gimple_phi_set_result (gimple gs, tree result)
3494 GIMPLE_CHECK (gs, GIMPLE_PHI);
3495 gs->gimple_phi.result = result;
3499 /* Return the PHI argument corresponding to incoming edge INDEX for
3500 GIMPLE_PHI GS. */
3502 static inline struct phi_arg_d *
3503 gimple_phi_arg (gimple gs, unsigned index)
3505 GIMPLE_CHECK (gs, GIMPLE_PHI);
3506 gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
3507 return &(gs->gimple_phi.args[index]);
3510 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3511 for GIMPLE_PHI GS. */
3513 static inline void
3514 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3516 GIMPLE_CHECK (gs, GIMPLE_PHI);
3517 gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
3518 gs->gimple_phi.args[index] = *phiarg;
3521 /* Return the region number for GIMPLE_RESX GS. */
3523 static inline int
3524 gimple_resx_region (const_gimple gs)
3526 GIMPLE_CHECK (gs, GIMPLE_RESX);
3527 return gs->gimple_eh_ctrl.region;
3530 /* Set REGION to be the region number for GIMPLE_RESX GS. */
3532 static inline void
3533 gimple_resx_set_region (gimple gs, int region)
3535 GIMPLE_CHECK (gs, GIMPLE_RESX);
3536 gs->gimple_eh_ctrl.region = region;
3539 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
3541 static inline int
3542 gimple_eh_dispatch_region (const_gimple gs)
3544 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3545 return gs->gimple_eh_ctrl.region;
3548 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
3550 static inline void
3551 gimple_eh_dispatch_set_region (gimple gs, int region)
3553 GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3554 gs->gimple_eh_ctrl.region = region;
3557 /* Return the number of labels associated with the switch statement GS. */
3559 static inline unsigned
3560 gimple_switch_num_labels (const_gimple gs)
3562 unsigned num_ops;
3563 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3564 num_ops = gimple_num_ops (gs);
3565 gcc_gimple_checking_assert (num_ops > 1);
3566 return num_ops - 1;
3570 /* Set NLABELS to be the number of labels for the switch statement GS. */
3572 static inline void
3573 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3575 GIMPLE_CHECK (g, GIMPLE_SWITCH);
3576 gimple_set_num_ops (g, nlabels + 1);
3580 /* Return the index variable used by the switch statement GS. */
3582 static inline tree
3583 gimple_switch_index (const_gimple gs)
3585 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3586 return gimple_op (gs, 0);
3590 /* Return a pointer to the index variable for the switch statement GS. */
3592 static inline tree *
3593 gimple_switch_index_ptr (const_gimple gs)
3595 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3596 return gimple_op_ptr (gs, 0);
3600 /* Set INDEX to be the index variable for switch statement GS. */
3602 static inline void
3603 gimple_switch_set_index (gimple gs, tree index)
3605 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3606 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3607 gimple_set_op (gs, 0, index);
3611 /* Return the label numbered INDEX. The default label is 0, followed by any
3612 labels in a switch statement. */
3614 static inline tree
3615 gimple_switch_label (const_gimple gs, unsigned index)
3617 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3618 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
3619 return gimple_op (gs, index + 1);
3622 /* Set the label number INDEX to LABEL. 0 is always the default label. */
3624 static inline void
3625 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3627 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3628 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
3629 && (label == NULL_TREE
3630 || TREE_CODE (label) == CASE_LABEL_EXPR));
3631 gimple_set_op (gs, index + 1, label);
3634 /* Return the default label for a switch statement. */
3636 static inline tree
3637 gimple_switch_default_label (const_gimple gs)
3639 return gimple_switch_label (gs, 0);
3642 /* Set the default label for a switch statement. */
3644 static inline void
3645 gimple_switch_set_default_label (gimple gs, tree label)
3647 gimple_switch_set_label (gs, 0, label);
3650 /* Return true if GS is a GIMPLE_DEBUG statement. */
3652 static inline bool
3653 is_gimple_debug (const_gimple gs)
3655 return gimple_code (gs) == GIMPLE_DEBUG;
3658 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
3660 static inline bool
3661 gimple_debug_bind_p (const_gimple s)
3663 if (is_gimple_debug (s))
3664 return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
3666 return false;
3669 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
3671 static inline tree
3672 gimple_debug_bind_get_var (gimple dbg)
3674 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3675 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3676 return gimple_op (dbg, 0);
3679 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3680 statement. */
3682 static inline tree
3683 gimple_debug_bind_get_value (gimple dbg)
3685 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3686 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3687 return gimple_op (dbg, 1);
3690 /* Return a pointer to the value bound to the variable in a
3691 GIMPLE_DEBUG bind statement. */
3693 static inline tree *
3694 gimple_debug_bind_get_value_ptr (gimple dbg)
3696 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3697 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3698 return gimple_op_ptr (dbg, 1);
3701 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
3703 static inline void
3704 gimple_debug_bind_set_var (gimple dbg, tree var)
3706 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3707 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3708 gimple_set_op (dbg, 0, var);
3711 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3712 statement. */
3714 static inline void
3715 gimple_debug_bind_set_value (gimple dbg, tree value)
3717 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3718 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3719 gimple_set_op (dbg, 1, value);
3722 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
3723 optimized away. */
3724 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
3726 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
3727 statement. */
3729 static inline void
3730 gimple_debug_bind_reset_value (gimple dbg)
3732 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3733 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3734 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
3737 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
3738 value. */
3740 static inline bool
3741 gimple_debug_bind_has_value_p (gimple dbg)
3743 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3744 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3745 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
3748 #undef GIMPLE_DEBUG_BIND_NOVALUE
3750 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
3752 static inline bool
3753 gimple_debug_source_bind_p (const_gimple s)
3755 if (is_gimple_debug (s))
3756 return s->gsbase.subcode == GIMPLE_DEBUG_SOURCE_BIND;
3758 return false;
3761 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
3763 static inline tree
3764 gimple_debug_source_bind_get_var (gimple dbg)
3766 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3767 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3768 return gimple_op (dbg, 0);
3771 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
3772 statement. */
3774 static inline tree
3775 gimple_debug_source_bind_get_value (gimple dbg)
3777 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3778 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3779 return gimple_op (dbg, 1);
3782 /* Return a pointer to the value bound to the variable in a
3783 GIMPLE_DEBUG source bind statement. */
3785 static inline tree *
3786 gimple_debug_source_bind_get_value_ptr (gimple dbg)
3788 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3789 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3790 return gimple_op_ptr (dbg, 1);
3793 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
3795 static inline void
3796 gimple_debug_source_bind_set_var (gimple dbg, tree var)
3798 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3799 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3800 gimple_set_op (dbg, 0, var);
3803 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
3804 statement. */
3806 static inline void
3807 gimple_debug_source_bind_set_value (gimple dbg, tree value)
3809 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3810 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
3811 gimple_set_op (dbg, 1, value);
3814 /* Return a pointer to the body for the OMP statement GS. */
3816 static inline gimple_seq *
3817 gimple_omp_body_ptr (gimple gs)
3819 return &gs->omp.body;
3822 /* Return the body for the OMP statement GS. */
3824 static inline gimple_seq
3825 gimple_omp_body (gimple gs)
3827 return *gimple_omp_body_ptr (gs);
3830 /* Set BODY to be the body for the OMP statement GS. */
3832 static inline void
3833 gimple_omp_set_body (gimple gs, gimple_seq body)
3835 gs->omp.body = body;
3839 /* Return the name associated with OMP_CRITICAL statement GS. */
3841 static inline tree
3842 gimple_omp_critical_name (const_gimple gs)
3844 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3845 return gs->gimple_omp_critical.name;
3849 /* Return a pointer to the name associated with OMP critical statement GS. */
3851 static inline tree *
3852 gimple_omp_critical_name_ptr (gimple gs)
3854 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3855 return &gs->gimple_omp_critical.name;
3859 /* Set NAME to be the name associated with OMP critical statement GS. */
3861 static inline void
3862 gimple_omp_critical_set_name (gimple gs, tree name)
3864 GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3865 gs->gimple_omp_critical.name = name;
3869 /* Return the clauses associated with OMP_FOR GS. */
3871 static inline tree
3872 gimple_omp_for_clauses (const_gimple gs)
3874 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3875 return gs->gimple_omp_for.clauses;
3879 /* Return a pointer to the OMP_FOR GS. */
3881 static inline tree *
3882 gimple_omp_for_clauses_ptr (gimple gs)
3884 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3885 return &gs->gimple_omp_for.clauses;
3889 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
3891 static inline void
3892 gimple_omp_for_set_clauses (gimple gs, tree clauses)
3894 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3895 gs->gimple_omp_for.clauses = clauses;
3899 /* Get the collapse count of OMP_FOR GS. */
3901 static inline size_t
3902 gimple_omp_for_collapse (gimple gs)
3904 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3905 return gs->gimple_omp_for.collapse;
3909 /* Return the index variable for OMP_FOR GS. */
3911 static inline tree
3912 gimple_omp_for_index (const_gimple gs, size_t i)
3914 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3915 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3916 return gs->gimple_omp_for.iter[i].index;
3920 /* Return a pointer to the index variable for OMP_FOR GS. */
3922 static inline tree *
3923 gimple_omp_for_index_ptr (gimple gs, size_t i)
3925 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3926 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3927 return &gs->gimple_omp_for.iter[i].index;
3931 /* Set INDEX to be the index variable for OMP_FOR GS. */
3933 static inline void
3934 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
3936 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3937 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3938 gs->gimple_omp_for.iter[i].index = index;
3942 /* Return the initial value for OMP_FOR GS. */
3944 static inline tree
3945 gimple_omp_for_initial (const_gimple gs, size_t i)
3947 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3948 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3949 return gs->gimple_omp_for.iter[i].initial;
3953 /* Return a pointer to the initial value for OMP_FOR GS. */
3955 static inline tree *
3956 gimple_omp_for_initial_ptr (gimple gs, size_t i)
3958 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3959 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3960 return &gs->gimple_omp_for.iter[i].initial;
3964 /* Set INITIAL to be the initial value for OMP_FOR GS. */
3966 static inline void
3967 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
3969 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3970 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3971 gs->gimple_omp_for.iter[i].initial = initial;
3975 /* Return the final value for OMP_FOR GS. */
3977 static inline tree
3978 gimple_omp_for_final (const_gimple gs, size_t i)
3980 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3981 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3982 return gs->gimple_omp_for.iter[i].final;
3986 /* Return a pointer to the final value for OMP_FOR GS. */
3988 static inline tree *
3989 gimple_omp_for_final_ptr (gimple gs, size_t i)
3991 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3992 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
3993 return &gs->gimple_omp_for.iter[i].final;
3997 /* Set FINAL to be the final value for OMP_FOR GS. */
3999 static inline void
4000 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
4002 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4003 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4004 gs->gimple_omp_for.iter[i].final = final;
4008 /* Return the increment value for OMP_FOR GS. */
4010 static inline tree
4011 gimple_omp_for_incr (const_gimple gs, size_t i)
4013 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4014 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4015 return gs->gimple_omp_for.iter[i].incr;
4019 /* Return a pointer to the increment value for OMP_FOR GS. */
4021 static inline tree *
4022 gimple_omp_for_incr_ptr (gimple gs, size_t i)
4024 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4025 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4026 return &gs->gimple_omp_for.iter[i].incr;
4030 /* Set INCR to be the increment value for OMP_FOR GS. */
4032 static inline void
4033 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
4035 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4036 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4037 gs->gimple_omp_for.iter[i].incr = incr;
4041 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4042 statement GS starts. */
4044 static inline gimple_seq *
4045 gimple_omp_for_pre_body_ptr (gimple gs)
4047 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4048 return &gs->gimple_omp_for.pre_body;
4052 /* Return the sequence of statements to execute before the OMP_FOR
4053 statement GS starts. */
4055 static inline gimple_seq
4056 gimple_omp_for_pre_body (gimple gs)
4058 return *gimple_omp_for_pre_body_ptr (gs);
4062 /* Set PRE_BODY to be the sequence of statements to execute before the
4063 OMP_FOR statement GS starts. */
4065 static inline void
4066 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
4068 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4069 gs->gimple_omp_for.pre_body = pre_body;
4073 /* Return the clauses associated with OMP_PARALLEL GS. */
4075 static inline tree
4076 gimple_omp_parallel_clauses (const_gimple gs)
4078 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4079 return gs->gimple_omp_parallel.clauses;
4083 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4085 static inline tree *
4086 gimple_omp_parallel_clauses_ptr (gimple gs)
4088 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4089 return &gs->gimple_omp_parallel.clauses;
4093 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4094 GS. */
4096 static inline void
4097 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
4099 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4100 gs->gimple_omp_parallel.clauses = clauses;
4104 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4106 static inline tree
4107 gimple_omp_parallel_child_fn (const_gimple gs)
4109 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4110 return gs->gimple_omp_parallel.child_fn;
4113 /* Return a pointer to the child function used to hold the body of
4114 OMP_PARALLEL GS. */
4116 static inline tree *
4117 gimple_omp_parallel_child_fn_ptr (gimple gs)
4119 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4120 return &gs->gimple_omp_parallel.child_fn;
4124 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4126 static inline void
4127 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
4129 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4130 gs->gimple_omp_parallel.child_fn = child_fn;
4134 /* Return the artificial argument used to send variables and values
4135 from the parent to the children threads in OMP_PARALLEL GS. */
4137 static inline tree
4138 gimple_omp_parallel_data_arg (const_gimple gs)
4140 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4141 return gs->gimple_omp_parallel.data_arg;
4145 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4147 static inline tree *
4148 gimple_omp_parallel_data_arg_ptr (gimple gs)
4150 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4151 return &gs->gimple_omp_parallel.data_arg;
4155 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4157 static inline void
4158 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
4160 GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
4161 gs->gimple_omp_parallel.data_arg = data_arg;
4165 /* Return the clauses associated with OMP_TASK GS. */
4167 static inline tree
4168 gimple_omp_task_clauses (const_gimple gs)
4170 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4171 return gs->gimple_omp_parallel.clauses;
4175 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4177 static inline tree *
4178 gimple_omp_task_clauses_ptr (gimple gs)
4180 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4181 return &gs->gimple_omp_parallel.clauses;
4185 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4186 GS. */
4188 static inline void
4189 gimple_omp_task_set_clauses (gimple gs, tree clauses)
4191 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4192 gs->gimple_omp_parallel.clauses = clauses;
4196 /* Return the child function used to hold the body of OMP_TASK GS. */
4198 static inline tree
4199 gimple_omp_task_child_fn (const_gimple gs)
4201 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4202 return gs->gimple_omp_parallel.child_fn;
4205 /* Return a pointer to the child function used to hold the body of
4206 OMP_TASK GS. */
4208 static inline tree *
4209 gimple_omp_task_child_fn_ptr (gimple gs)
4211 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4212 return &gs->gimple_omp_parallel.child_fn;
4216 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4218 static inline void
4219 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
4221 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4222 gs->gimple_omp_parallel.child_fn = child_fn;
4226 /* Return the artificial argument used to send variables and values
4227 from the parent to the children threads in OMP_TASK GS. */
4229 static inline tree
4230 gimple_omp_task_data_arg (const_gimple gs)
4232 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4233 return gs->gimple_omp_parallel.data_arg;
4237 /* Return a pointer to the data argument for OMP_TASK GS. */
4239 static inline tree *
4240 gimple_omp_task_data_arg_ptr (gimple gs)
4242 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4243 return &gs->gimple_omp_parallel.data_arg;
4247 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4249 static inline void
4250 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
4252 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4253 gs->gimple_omp_parallel.data_arg = data_arg;
4257 /* Return the clauses associated with OMP_TASK GS. */
4259 static inline tree
4260 gimple_omp_taskreg_clauses (const_gimple gs)
4262 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4263 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4264 return gs->gimple_omp_parallel.clauses;
4268 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4270 static inline tree *
4271 gimple_omp_taskreg_clauses_ptr (gimple gs)
4273 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4274 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4275 return &gs->gimple_omp_parallel.clauses;
4279 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4280 GS. */
4282 static inline void
4283 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
4285 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4286 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4287 gs->gimple_omp_parallel.clauses = clauses;
4291 /* Return the child function used to hold the body of OMP_TASK GS. */
4293 static inline tree
4294 gimple_omp_taskreg_child_fn (const_gimple gs)
4296 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4297 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4298 return gs->gimple_omp_parallel.child_fn;
4301 /* Return a pointer to the child function used to hold the body of
4302 OMP_TASK GS. */
4304 static inline tree *
4305 gimple_omp_taskreg_child_fn_ptr (gimple gs)
4307 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4308 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4309 return &gs->gimple_omp_parallel.child_fn;
4313 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4315 static inline void
4316 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
4318 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4319 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4320 gs->gimple_omp_parallel.child_fn = child_fn;
4324 /* Return the artificial argument used to send variables and values
4325 from the parent to the children threads in OMP_TASK GS. */
4327 static inline tree
4328 gimple_omp_taskreg_data_arg (const_gimple gs)
4330 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4331 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4332 return gs->gimple_omp_parallel.data_arg;
4336 /* Return a pointer to the data argument for OMP_TASK GS. */
4338 static inline tree *
4339 gimple_omp_taskreg_data_arg_ptr (gimple gs)
4341 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4342 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4343 return &gs->gimple_omp_parallel.data_arg;
4347 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4349 static inline void
4350 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
4352 if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
4353 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4354 gs->gimple_omp_parallel.data_arg = data_arg;
4358 /* Return the copy function used to hold the body of OMP_TASK GS. */
4360 static inline tree
4361 gimple_omp_task_copy_fn (const_gimple gs)
4363 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4364 return gs->gimple_omp_task.copy_fn;
4367 /* Return a pointer to the copy function used to hold the body of
4368 OMP_TASK GS. */
4370 static inline tree *
4371 gimple_omp_task_copy_fn_ptr (gimple gs)
4373 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4374 return &gs->gimple_omp_task.copy_fn;
4378 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
4380 static inline void
4381 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
4383 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4384 gs->gimple_omp_task.copy_fn = copy_fn;
4388 /* Return size of the data block in bytes in OMP_TASK GS. */
4390 static inline tree
4391 gimple_omp_task_arg_size (const_gimple gs)
4393 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4394 return gs->gimple_omp_task.arg_size;
4398 /* Return a pointer to the data block size for OMP_TASK GS. */
4400 static inline tree *
4401 gimple_omp_task_arg_size_ptr (gimple gs)
4403 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4404 return &gs->gimple_omp_task.arg_size;
4408 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
4410 static inline void
4411 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
4413 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4414 gs->gimple_omp_task.arg_size = arg_size;
4418 /* Return align of the data block in bytes in OMP_TASK GS. */
4420 static inline tree
4421 gimple_omp_task_arg_align (const_gimple gs)
4423 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4424 return gs->gimple_omp_task.arg_align;
4428 /* Return a pointer to the data block align for OMP_TASK GS. */
4430 static inline tree *
4431 gimple_omp_task_arg_align_ptr (gimple gs)
4433 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4434 return &gs->gimple_omp_task.arg_align;
4438 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
4440 static inline void
4441 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4443 GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4444 gs->gimple_omp_task.arg_align = arg_align;
4448 /* Return the clauses associated with OMP_SINGLE GS. */
4450 static inline tree
4451 gimple_omp_single_clauses (const_gimple gs)
4453 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4454 return gs->gimple_omp_single.clauses;
4458 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
4460 static inline tree *
4461 gimple_omp_single_clauses_ptr (gimple gs)
4463 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4464 return &gs->gimple_omp_single.clauses;
4468 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
4470 static inline void
4471 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4473 GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4474 gs->gimple_omp_single.clauses = clauses;
4478 /* Return the clauses associated with OMP_SECTIONS GS. */
4480 static inline tree
4481 gimple_omp_sections_clauses (const_gimple gs)
4483 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4484 return gs->gimple_omp_sections.clauses;
4488 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
4490 static inline tree *
4491 gimple_omp_sections_clauses_ptr (gimple gs)
4493 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4494 return &gs->gimple_omp_sections.clauses;
4498 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
4499 GS. */
4501 static inline void
4502 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
4504 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4505 gs->gimple_omp_sections.clauses = clauses;
4509 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
4510 in GS. */
4512 static inline tree
4513 gimple_omp_sections_control (const_gimple gs)
4515 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4516 return gs->gimple_omp_sections.control;
4520 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
4521 GS. */
4523 static inline tree *
4524 gimple_omp_sections_control_ptr (gimple gs)
4526 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4527 return &gs->gimple_omp_sections.control;
4531 /* Set CONTROL to be the set of clauses associated with the
4532 GIMPLE_OMP_SECTIONS in GS. */
4534 static inline void
4535 gimple_omp_sections_set_control (gimple gs, tree control)
4537 GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4538 gs->gimple_omp_sections.control = control;
4542 /* Set COND to be the condition code for OMP_FOR GS. */
4544 static inline void
4545 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
4547 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4548 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
4549 && i < gs->gimple_omp_for.collapse);
4550 gs->gimple_omp_for.iter[i].cond = cond;
4554 /* Return the condition code associated with OMP_FOR GS. */
4556 static inline enum tree_code
4557 gimple_omp_for_cond (const_gimple gs, size_t i)
4559 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4560 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
4561 return gs->gimple_omp_for.iter[i].cond;
4565 /* Set the value being stored in an atomic store. */
4567 static inline void
4568 gimple_omp_atomic_store_set_val (gimple g, tree val)
4570 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4571 g->gimple_omp_atomic_store.val = val;
4575 /* Return the value being stored in an atomic store. */
4577 static inline tree
4578 gimple_omp_atomic_store_val (const_gimple g)
4580 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4581 return g->gimple_omp_atomic_store.val;
4585 /* Return a pointer to the value being stored in an atomic store. */
4587 static inline tree *
4588 gimple_omp_atomic_store_val_ptr (gimple g)
4590 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4591 return &g->gimple_omp_atomic_store.val;
4595 /* Set the LHS of an atomic load. */
4597 static inline void
4598 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
4600 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4601 g->gimple_omp_atomic_load.lhs = lhs;
4605 /* Get the LHS of an atomic load. */
4607 static inline tree
4608 gimple_omp_atomic_load_lhs (const_gimple g)
4610 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4611 return g->gimple_omp_atomic_load.lhs;
4615 /* Return a pointer to the LHS of an atomic load. */
4617 static inline tree *
4618 gimple_omp_atomic_load_lhs_ptr (gimple g)
4620 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4621 return &g->gimple_omp_atomic_load.lhs;
4625 /* Set the RHS of an atomic load. */
4627 static inline void
4628 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
4630 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4631 g->gimple_omp_atomic_load.rhs = rhs;
4635 /* Get the RHS of an atomic load. */
4637 static inline tree
4638 gimple_omp_atomic_load_rhs (const_gimple g)
4640 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4641 return g->gimple_omp_atomic_load.rhs;
4645 /* Return a pointer to the RHS of an atomic load. */
4647 static inline tree *
4648 gimple_omp_atomic_load_rhs_ptr (gimple g)
4650 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4651 return &g->gimple_omp_atomic_load.rhs;
4655 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4657 static inline tree
4658 gimple_omp_continue_control_def (const_gimple g)
4660 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4661 return g->gimple_omp_continue.control_def;
4664 /* The same as above, but return the address. */
4666 static inline tree *
4667 gimple_omp_continue_control_def_ptr (gimple g)
4669 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4670 return &g->gimple_omp_continue.control_def;
4673 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
4675 static inline void
4676 gimple_omp_continue_set_control_def (gimple g, tree def)
4678 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4679 g->gimple_omp_continue.control_def = def;
4683 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4685 static inline tree
4686 gimple_omp_continue_control_use (const_gimple g)
4688 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4689 return g->gimple_omp_continue.control_use;
4693 /* The same as above, but return the address. */
4695 static inline tree *
4696 gimple_omp_continue_control_use_ptr (gimple g)
4698 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4699 return &g->gimple_omp_continue.control_use;
4703 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
4705 static inline void
4706 gimple_omp_continue_set_control_use (gimple g, tree use)
4708 GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4709 g->gimple_omp_continue.control_use = use;
4712 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
4714 static inline gimple_seq *
4715 gimple_transaction_body_ptr (gimple gs)
4717 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4718 return &gs->gimple_transaction.body;
4721 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
4723 static inline gimple_seq
4724 gimple_transaction_body (gimple gs)
4726 return *gimple_transaction_body_ptr (gs);
4729 /* Return the label associated with a GIMPLE_TRANSACTION. */
4731 static inline tree
4732 gimple_transaction_label (const_gimple gs)
4734 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4735 return gs->gimple_transaction.label;
4738 static inline tree *
4739 gimple_transaction_label_ptr (gimple gs)
4741 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4742 return &gs->gimple_transaction.label;
4745 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
4747 static inline unsigned int
4748 gimple_transaction_subcode (const_gimple gs)
4750 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4751 return gs->gsbase.subcode;
4754 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
4756 static inline void
4757 gimple_transaction_set_body (gimple gs, gimple_seq body)
4759 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4760 gs->gimple_transaction.body = body;
4763 /* Set the label associated with a GIMPLE_TRANSACTION. */
4765 static inline void
4766 gimple_transaction_set_label (gimple gs, tree label)
4768 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4769 gs->gimple_transaction.label = label;
4772 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
4774 static inline void
4775 gimple_transaction_set_subcode (gimple gs, unsigned int subcode)
4777 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
4778 gs->gsbase.subcode = subcode;
4782 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
4784 static inline tree *
4785 gimple_return_retval_ptr (const_gimple gs)
4787 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4788 return gimple_op_ptr (gs, 0);
4791 /* Return the return value for GIMPLE_RETURN GS. */
4793 static inline tree
4794 gimple_return_retval (const_gimple gs)
4796 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4797 return gimple_op (gs, 0);
4801 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
4803 static inline void
4804 gimple_return_set_retval (gimple gs, tree retval)
4806 GIMPLE_CHECK (gs, GIMPLE_RETURN);
4807 gimple_set_op (gs, 0, retval);
4811 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
4813 #define CASE_GIMPLE_OMP \
4814 case GIMPLE_OMP_PARALLEL: \
4815 case GIMPLE_OMP_TASK: \
4816 case GIMPLE_OMP_FOR: \
4817 case GIMPLE_OMP_SECTIONS: \
4818 case GIMPLE_OMP_SECTIONS_SWITCH: \
4819 case GIMPLE_OMP_SINGLE: \
4820 case GIMPLE_OMP_SECTION: \
4821 case GIMPLE_OMP_MASTER: \
4822 case GIMPLE_OMP_ORDERED: \
4823 case GIMPLE_OMP_CRITICAL: \
4824 case GIMPLE_OMP_RETURN: \
4825 case GIMPLE_OMP_ATOMIC_LOAD: \
4826 case GIMPLE_OMP_ATOMIC_STORE: \
4827 case GIMPLE_OMP_CONTINUE
4829 static inline bool
4830 is_gimple_omp (const_gimple stmt)
4832 switch (gimple_code (stmt))
4834 CASE_GIMPLE_OMP:
4835 return true;
4836 default:
4837 return false;
4842 /* Returns TRUE if statement G is a GIMPLE_NOP. */
4844 static inline bool
4845 gimple_nop_p (const_gimple g)
4847 return gimple_code (g) == GIMPLE_NOP;
4851 /* Return true if GS is a GIMPLE_RESX. */
4853 static inline bool
4854 is_gimple_resx (const_gimple gs)
4856 return gimple_code (gs) == GIMPLE_RESX;
4859 /* Return the predictor of GIMPLE_PREDICT statement GS. */
4861 static inline enum br_predictor
4862 gimple_predict_predictor (gimple gs)
4864 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4865 return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
4869 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
4871 static inline void
4872 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
4874 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4875 gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
4876 | (unsigned) predictor;
4880 /* Return the outcome of GIMPLE_PREDICT statement GS. */
4882 static inline enum prediction
4883 gimple_predict_outcome (gimple gs)
4885 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4886 return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
4890 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
4892 static inline void
4893 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
4895 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4896 if (outcome == TAKEN)
4897 gs->gsbase.subcode |= GF_PREDICT_TAKEN;
4898 else
4899 gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
4903 /* Return the type of the main expression computed by STMT. Return
4904 void_type_node if the statement computes nothing. */
4906 static inline tree
4907 gimple_expr_type (const_gimple stmt)
4909 enum gimple_code code = gimple_code (stmt);
4911 if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
4913 tree type;
4914 /* In general we want to pass out a type that can be substituted
4915 for both the RHS and the LHS types if there is a possibly
4916 useless conversion involved. That means returning the
4917 original RHS type as far as we can reconstruct it. */
4918 if (code == GIMPLE_CALL)
4919 type = gimple_call_return_type (stmt);
4920 else
4921 switch (gimple_assign_rhs_code (stmt))
4923 case POINTER_PLUS_EXPR:
4924 type = TREE_TYPE (gimple_assign_rhs1 (stmt));
4925 break;
4927 default:
4928 /* As fallback use the type of the LHS. */
4929 type = TREE_TYPE (gimple_get_lhs (stmt));
4930 break;
4932 return type;
4934 else if (code == GIMPLE_COND)
4935 return boolean_type_node;
4936 else
4937 return void_type_node;
4940 /* Return true if TYPE is a suitable type for a scalar register variable. */
4942 static inline bool
4943 is_gimple_reg_type (tree type)
4945 return !AGGREGATE_TYPE_P (type);
4948 /* Return a new iterator pointing to GIMPLE_SEQ's first statement. */
4950 static inline gimple_stmt_iterator
4951 gsi_start_1 (gimple_seq *seq)
4953 gimple_stmt_iterator i;
4955 i.ptr = gimple_seq_first (*seq);
4956 i.seq = seq;
4957 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
4959 return i;
4962 #define gsi_start(x) gsi_start_1(&(x))
4964 static inline gimple_stmt_iterator
4965 gsi_none (void)
4967 gimple_stmt_iterator i;
4968 i.ptr = NULL;
4969 i.seq = NULL;
4970 i.bb = NULL;
4971 return i;
4974 /* Return a new iterator pointing to the first statement in basic block BB. */
4976 static inline gimple_stmt_iterator
4977 gsi_start_bb (basic_block bb)
4979 gimple_stmt_iterator i;
4980 gimple_seq *seq;
4982 seq = bb_seq_addr (bb);
4983 i.ptr = gimple_seq_first (*seq);
4984 i.seq = seq;
4985 i.bb = bb;
4987 return i;
4991 /* Return a new iterator initially pointing to GIMPLE_SEQ's last statement. */
4993 static inline gimple_stmt_iterator
4994 gsi_last_1 (gimple_seq *seq)
4996 gimple_stmt_iterator i;
4998 i.ptr = gimple_seq_last (*seq);
4999 i.seq = seq;
5000 i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
5002 return i;
5005 #define gsi_last(x) gsi_last_1(&(x))
5007 /* Return a new iterator pointing to the last statement in basic block BB. */
5009 static inline gimple_stmt_iterator
5010 gsi_last_bb (basic_block bb)
5012 gimple_stmt_iterator i;
5013 gimple_seq *seq;
5015 seq = bb_seq_addr (bb);
5016 i.ptr = gimple_seq_last (*seq);
5017 i.seq = seq;
5018 i.bb = bb;
5020 return i;
5024 /* Return true if I is at the end of its sequence. */
5026 static inline bool
5027 gsi_end_p (gimple_stmt_iterator i)
5029 return i.ptr == NULL;
5033 /* Return true if I is one statement before the end of its sequence. */
5035 static inline bool
5036 gsi_one_before_end_p (gimple_stmt_iterator i)
5038 return i.ptr != NULL && i.ptr->gsbase.next == NULL;
5042 /* Advance the iterator to the next gimple statement. */
5044 static inline void
5045 gsi_next (gimple_stmt_iterator *i)
5047 i->ptr = i->ptr->gsbase.next;
5050 /* Advance the iterator to the previous gimple statement. */
5052 static inline void
5053 gsi_prev (gimple_stmt_iterator *i)
5055 gimple prev = i->ptr->gsbase.prev;
5056 if (prev->gsbase.next)
5057 i->ptr = prev;
5058 else
5059 i->ptr = NULL;
5062 /* Return the current stmt. */
5064 static inline gimple
5065 gsi_stmt (gimple_stmt_iterator i)
5067 return i.ptr;
5070 /* Return a block statement iterator that points to the first non-label
5071 statement in block BB. */
5073 static inline gimple_stmt_iterator
5074 gsi_after_labels (basic_block bb)
5076 gimple_stmt_iterator gsi = gsi_start_bb (bb);
5078 while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
5079 gsi_next (&gsi);
5081 return gsi;
5084 /* Advance the iterator to the next non-debug gimple statement. */
5086 static inline void
5087 gsi_next_nondebug (gimple_stmt_iterator *i)
5091 gsi_next (i);
5093 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5096 /* Advance the iterator to the next non-debug gimple statement. */
5098 static inline void
5099 gsi_prev_nondebug (gimple_stmt_iterator *i)
5103 gsi_prev (i);
5105 while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
5108 /* Return a new iterator pointing to the first non-debug statement in
5109 basic block BB. */
5111 static inline gimple_stmt_iterator
5112 gsi_start_nondebug_bb (basic_block bb)
5114 gimple_stmt_iterator i = gsi_start_bb (bb);
5116 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5117 gsi_next_nondebug (&i);
5119 return i;
5122 /* Return a new iterator pointing to the last non-debug statement in
5123 basic block BB. */
5125 static inline gimple_stmt_iterator
5126 gsi_last_nondebug_bb (basic_block bb)
5128 gimple_stmt_iterator i = gsi_last_bb (bb);
5130 if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
5131 gsi_prev_nondebug (&i);
5133 return i;
5137 /* Return the basic block associated with this iterator. */
5139 static inline basic_block
5140 gsi_bb (gimple_stmt_iterator i)
5142 return i.bb;
5146 /* Return the sequence associated with this iterator. */
5148 static inline gimple_seq
5149 gsi_seq (gimple_stmt_iterator i)
5151 return *i.seq;
5155 enum gsi_iterator_update
5157 GSI_NEW_STMT, /* Only valid when single statement is added, move
5158 iterator to it. */
5159 GSI_SAME_STMT, /* Leave the iterator at the same statement. */
5160 GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable
5161 for linking other statements in the same
5162 direction. */
5165 /* In gimple-iterator.c */
5166 gimple_stmt_iterator gsi_start_phis (basic_block);
5167 gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
5168 void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
5169 void gsi_set_stmt (gimple_stmt_iterator *, gimple);
5170 void gsi_replace (gimple_stmt_iterator *, gimple, bool);
5171 void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
5172 void gsi_insert_before (gimple_stmt_iterator *, gimple,
5173 enum gsi_iterator_update);
5174 void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
5175 enum gsi_iterator_update);
5176 void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
5177 enum gsi_iterator_update);
5178 void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
5179 enum gsi_iterator_update);
5180 void gsi_insert_after (gimple_stmt_iterator *, gimple,
5181 enum gsi_iterator_update);
5182 void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
5183 enum gsi_iterator_update);
5184 void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
5185 enum gsi_iterator_update);
5186 void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
5187 enum gsi_iterator_update);
5188 bool gsi_remove (gimple_stmt_iterator *, bool);
5189 gimple_stmt_iterator gsi_for_stmt (gimple);
5190 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
5191 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
5192 void gsi_move_to_bb_end (gimple_stmt_iterator *, struct basic_block_def *);
5193 void gsi_insert_on_edge (edge, gimple);
5194 void gsi_insert_seq_on_edge (edge, gimple_seq);
5195 basic_block gsi_insert_on_edge_immediate (edge, gimple);
5196 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
5197 void gsi_commit_one_edge_insert (edge, basic_block *);
5198 void gsi_commit_edge_inserts (void);
5199 gimple gimple_call_copy_skip_args (gimple, bitmap);
5202 /* Convenience routines to walk all statements of a gimple function.
5203 Note that this is useful exclusively before the code is converted
5204 into SSA form. Once the program is in SSA form, the standard
5205 operand interface should be used to analyze/modify statements. */
5206 struct walk_stmt_info
5208 /* Points to the current statement being walked. */
5209 gimple_stmt_iterator gsi;
5211 /* Additional data that the callback functions may want to carry
5212 through the recursion. */
5213 void *info;
5215 /* Pointer map used to mark visited tree nodes when calling
5216 walk_tree on each operand. If set to NULL, duplicate tree nodes
5217 will be visited more than once. */
5218 struct pointer_set_t *pset;
5220 /* Operand returned by the callbacks. This is set when calling
5221 walk_gimple_seq. If the walk_stmt_fn or walk_tree_fn callback
5222 returns non-NULL, this field will contain the tree returned by
5223 the last callback. */
5224 tree callback_result;
5226 /* Indicates whether the operand being examined may be replaced
5227 with something that matches is_gimple_val (if true) or something
5228 slightly more complicated (if false). "Something" technically
5229 means the common subset of is_gimple_lvalue and is_gimple_rhs,
5230 but we never try to form anything more complicated than that, so
5231 we don't bother checking.
5233 Also note that CALLBACK should update this flag while walking the
5234 sub-expressions of a statement. For instance, when walking the
5235 statement 'foo (&var)', the flag VAL_ONLY will initially be set
5236 to true, however, when walking &var, the operand of that
5237 ADDR_EXPR does not need to be a GIMPLE value. */
5238 BOOL_BITFIELD val_only : 1;
5240 /* True if we are currently walking the LHS of an assignment. */
5241 BOOL_BITFIELD is_lhs : 1;
5243 /* Optional. Set to true by the callback functions if they made any
5244 changes. */
5245 BOOL_BITFIELD changed : 1;
5247 /* True if we're interested in location information. */
5248 BOOL_BITFIELD want_locations : 1;
5250 /* True if we've removed the statement that was processed. */
5251 BOOL_BITFIELD removed_stmt : 1;
5254 /* Callback for walk_gimple_stmt. Called for every statement found
5255 during traversal. The first argument points to the statement to
5256 walk. The second argument is a flag that the callback sets to
5257 'true' if it the callback handled all the operands and
5258 sub-statements of the statement (the default value of this flag is
5259 'false'). The third argument is an anonymous pointer to data
5260 to be used by the callback. */
5261 typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
5262 struct walk_stmt_info *);
5264 gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
5265 struct walk_stmt_info *);
5266 gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
5267 struct walk_stmt_info *);
5268 tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
5269 struct walk_stmt_info *);
5270 tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
5272 #ifdef GATHER_STATISTICS
5273 /* Enum and arrays used for allocation stats. Keep in sync with
5274 gimple.c:gimple_alloc_kind_names. */
5275 enum gimple_alloc_kind
5277 gimple_alloc_kind_assign, /* Assignments. */
5278 gimple_alloc_kind_phi, /* PHI nodes. */
5279 gimple_alloc_kind_cond, /* Conditionals. */
5280 gimple_alloc_kind_rest, /* Everything else. */
5281 gimple_alloc_kind_all
5284 extern int gimple_alloc_counts[];
5285 extern int gimple_alloc_sizes[];
5287 /* Return the allocation kind for a given stmt CODE. */
5288 static inline enum gimple_alloc_kind
5289 gimple_alloc_kind (enum gimple_code code)
5291 switch (code)
5293 case GIMPLE_ASSIGN:
5294 return gimple_alloc_kind_assign;
5295 case GIMPLE_PHI:
5296 return gimple_alloc_kind_phi;
5297 case GIMPLE_COND:
5298 return gimple_alloc_kind_cond;
5299 default:
5300 return gimple_alloc_kind_rest;
5303 #endif /* GATHER_STATISTICS */
5305 extern void dump_gimple_statistics (void);
5307 /* In gimple-fold.c. */
5308 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
5309 tree gimple_fold_builtin (gimple);
5310 bool fold_stmt (gimple_stmt_iterator *);
5311 bool fold_stmt_inplace (gimple_stmt_iterator *);
5312 tree get_symbol_constant_value (tree);
5313 tree canonicalize_constructor_val (tree, tree);
5314 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree,
5315 enum tree_code, tree, tree);
5316 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
5317 enum tree_code, tree, tree);
5319 bool gimple_val_nonnegative_real_p (tree);
5320 #endif /* GCC_GIMPLE_H */