Line data Source code
1 : /* Gimple IR definitions.
2 :
3 : Copyright (C) 2007-2026 Free Software Foundation, Inc.
4 : Contributed by Aldy Hernandez <aldyh@redhat.com>
5 :
6 : This file is part of GCC.
7 :
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.
12 :
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.
17 :
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/>. */
21 :
22 : #ifndef GCC_GIMPLE_H
23 : #define GCC_GIMPLE_H
24 :
25 : #include "tree-ssa-alias.h"
26 : #include "gimple-expr.h"
27 : #include "bitmap.h"
28 : #include "value-range.h"
29 : #include "value-query.h"
30 :
31 : typedef gimple *gimple_seq_node;
32 :
33 : enum gimple_code {
34 : #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
35 : #include "gimple.def"
36 : #undef DEFGSCODE
37 : LAST_AND_UNUSED_GIMPLE_CODE
38 : };
39 :
40 : extern const char *const gimple_code_name[];
41 : extern const unsigned char gimple_rhs_class_table[];
42 :
43 : /* Error out if a gimple tuple is addressed incorrectly. */
44 : #if defined ENABLE_GIMPLE_CHECKING
45 : #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
46 : extern void gimple_check_failed (const gimple *, const char *, int, \
47 : const char *, enum gimple_code, \
48 : enum tree_code) ATTRIBUTE_NORETURN \
49 : ATTRIBUTE_COLD;
50 :
51 : #define GIMPLE_CHECK(GS, CODE) \
52 : do { \
53 : const gimple *__gs = (GS); \
54 : if (gimple_code (__gs) != (CODE)) \
55 : gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
56 : (CODE), ERROR_MARK); \
57 : } while (0)
58 : template <typename T>
59 : inline T
60 >11198*10^7 : GIMPLE_CHECK2(const gimple *gs,
61 : #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
62 : const char *file = __builtin_FILE (),
63 : int line = __builtin_LINE (),
64 : const char *fun = __builtin_FUNCTION ())
65 : #else
66 : const char *file = __FILE__,
67 : int line = __LINE__,
68 : const char *fun = NULL)
69 : #endif
70 : {
71 >11198*10^7 : T ret = dyn_cast <T> (gs);
72 : if (!ret)
73 0 : gimple_check_failed (gs, file, line, fun,
74 : std::remove_pointer<T>::type::code_, ERROR_MARK);
75 >11198*10^7 : return ret;
76 : }
77 : template <typename T>
78 : inline T
79 7225027845 : GIMPLE_CHECK2(gimple *gs,
80 : #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
81 : const char *file = __builtin_FILE (),
82 : int line = __builtin_LINE (),
83 : const char *fun = __builtin_FUNCTION ())
84 : #else
85 : const char *file = __FILE__,
86 : int line = __LINE__,
87 : const char *fun = NULL)
88 : #endif
89 : {
90 7225027845 : T ret = dyn_cast <T> (gs);
91 : if (!ret)
92 0 : gimple_check_failed (gs, file, line, fun,
93 : std::remove_pointer<T>::type::code_, ERROR_MARK);
94 7225027845 : return ret;
95 : }
96 : #else /* not ENABLE_GIMPLE_CHECKING */
97 : #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
98 : #define GIMPLE_CHECK(GS, CODE) (void)0
99 : template <typename T>
100 : inline T
101 : GIMPLE_CHECK2(gimple *gs)
102 : {
103 : return as_a <T> (gs);
104 : }
105 : template <typename T>
106 : inline T
107 : GIMPLE_CHECK2(const gimple *gs)
108 : {
109 : return as_a <T> (gs);
110 : }
111 : #endif
112 :
113 : /* Class of GIMPLE expressions suitable for the RHS of assignments. See
114 : get_gimple_rhs_class. */
115 : enum gimple_rhs_class
116 : {
117 : GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
118 : GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
119 : GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
120 : GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
121 : GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
122 : name, a _DECL, a _REF, etc. */
123 : };
124 :
125 : /* Specific flags for individual GIMPLE statements. These flags are
126 : always stored in gimple.subcode and they may only be
127 : defined for statement codes that do not use subcodes.
128 :
129 : Values for the masks can overlap as long as the overlapping values
130 : are never used in the same statement class.
131 :
132 : The maximum mask value that can be defined is 1 << 15 (i.e., each
133 : statement code can hold up to 16 bitflags).
134 :
135 : Keep this list sorted. */
136 : enum gf_mask {
137 : GF_ASM_BASIC = 1 << 0,
138 : GF_ASM_VOLATILE = 1 << 1,
139 : GF_ASM_INLINE = 1 << 2,
140 : GF_CALL_FROM_THUNK = 1 << 0,
141 : GF_CALL_RETURN_SLOT_OPT = 1 << 1,
142 : GF_CALL_TAILCALL = 1 << 2,
143 : GF_CALL_VA_ARG_PACK = 1 << 3,
144 : GF_CALL_NOTHROW = 1 << 4,
145 : GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
146 : GF_CALL_INTERNAL = 1 << 6,
147 : GF_CALL_CTRL_ALTERING = 1 << 7,
148 : GF_CALL_MUST_TAIL_CALL = 1 << 9,
149 : GF_CALL_BY_DESCRIPTOR = 1 << 10,
150 : GF_CALL_NOCF_CHECK = 1 << 11,
151 : GF_CALL_FROM_NEW_OR_DELETE = 1 << 12,
152 : GF_CALL_XTHROW = 1 << 13,
153 : GF_OMP_PARALLEL_COMBINED = 1 << 0,
154 : GF_OMP_TASK_TASKLOOP = 1 << 0,
155 : GF_OMP_TASK_TASKWAIT = 1 << 1,
156 : GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
157 : GF_OMP_FOR_KIND_FOR = 0,
158 : GF_OMP_FOR_KIND_DISTRIBUTE = 1,
159 : GF_OMP_FOR_KIND_TASKLOOP = 2,
160 : GF_OMP_FOR_KIND_OACC_LOOP = 4,
161 : GF_OMP_FOR_KIND_SIMD = 5,
162 : GF_OMP_FOR_COMBINED = 1 << 3,
163 : GF_OMP_FOR_COMBINED_INTO = 1 << 4,
164 : GF_OMP_TARGET_KIND_MASK = (1 << 5) - 1,
165 : GF_OMP_TARGET_KIND_REGION = 0,
166 : GF_OMP_TARGET_KIND_DATA = 1,
167 : GF_OMP_TARGET_KIND_UPDATE = 2,
168 : GF_OMP_TARGET_KIND_ENTER_DATA = 3,
169 : GF_OMP_TARGET_KIND_EXIT_DATA = 4,
170 : GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
171 : GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
172 : GF_OMP_TARGET_KIND_OACC_SERIAL = 7,
173 : GF_OMP_TARGET_KIND_OACC_DATA = 8,
174 : GF_OMP_TARGET_KIND_OACC_UPDATE = 9,
175 : GF_OMP_TARGET_KIND_OACC_ENTER_DATA = 10,
176 : GF_OMP_TARGET_KIND_OACC_EXIT_DATA = 11,
177 : GF_OMP_TARGET_KIND_OACC_DECLARE = 12,
178 : GF_OMP_TARGET_KIND_OACC_HOST_DATA = 13,
179 : /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
180 : decomposed part, parallelized. */
181 : GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED = 14,
182 : /* A 'GF_OMP_TARGET_KIND_OACC_PARALLEL' representing an OpenACC 'kernels'
183 : decomposed part, "gang-single". */
184 : GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE = 15,
185 : /* A 'GF_OMP_TARGET_KIND_OACC_DATA' representing an OpenACC 'kernels'
186 : decomposed parts' 'data' construct. */
187 : GF_OMP_TARGET_KIND_OACC_DATA_KERNELS = 16,
188 : GF_OMP_TEAMS_HOST = 1 << 0,
189 :
190 : /* True on an GIMPLE_OMP_RETURN statement if the return does not require
191 : a thread synchronization via some sort of barrier. The exact barrier
192 : that would otherwise be emitted is dependent on the OMP statement with
193 : which this return is associated. */
194 : GF_OMP_RETURN_NOWAIT = 1 << 0,
195 :
196 : GF_OMP_SECTION_LAST = 1 << 0,
197 : GF_OMP_ORDERED_STANDALONE = 1 << 0,
198 : GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 6) - 1,
199 : GF_OMP_ATOMIC_NEED_VALUE = 1 << 6,
200 : GF_OMP_ATOMIC_WEAK = 1 << 7,
201 : GF_PREDICT_TAKEN = 1 << 15
202 : };
203 :
204 : /* This subcode tells apart different kinds of stmts that are not used
205 : for codegen, but rather to retain debug information. */
206 : enum gimple_debug_subcode {
207 : GIMPLE_DEBUG_BIND = 0,
208 : GIMPLE_DEBUG_SOURCE_BIND = 1,
209 : GIMPLE_DEBUG_BEGIN_STMT = 2,
210 : GIMPLE_DEBUG_INLINE_ENTRY = 3
211 : };
212 :
213 : /* Masks for selecting a pass local flag (PLF) to work on. These
214 : masks are used by gimple_set_plf and gimple_plf. */
215 : enum plf_mask {
216 : GF_PLF_1 = 1 << 0,
217 : GF_PLF_2 = 1 << 1
218 : };
219 :
220 : /* Data structure definitions for GIMPLE tuples. NOTE: word markers
221 : are for 64 bit hosts. */
222 :
223 : struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
224 : chain_next ("%h.next"), variable_size))
225 : gimple
226 : {
227 : /* [ WORD 1 ]
228 : Main identifying code for a tuple. */
229 : ENUM_BITFIELD(gimple_code) code : 8;
230 :
231 : /* Nonzero if a warning should not be emitted on this tuple. */
232 : unsigned int no_warning : 1;
233 :
234 : /* Nonzero if this tuple has been visited. Passes are responsible
235 : for clearing this bit before using it. */
236 : unsigned int visited : 1;
237 :
238 : /* Nonzero if this tuple represents a non-temporal move; currently
239 : only stores are supported. */
240 : unsigned int nontemporal_move : 1;
241 :
242 : /* Pass local flags. These flags are free for any pass to use as
243 : they see fit. Passes should not assume that these flags contain
244 : any useful value when the pass starts. Any initial state that
245 : the pass requires should be set on entry to the pass. See
246 : gimple_set_plf and gimple_plf for usage. */
247 : unsigned int plf : 2;
248 :
249 : /* Nonzero if this statement has been modified and needs to have its
250 : operands rescanned. */
251 : unsigned modified : 1;
252 :
253 : /* Nonzero if this statement contains volatile operands. */
254 : unsigned has_volatile_ops : 1;
255 :
256 : /* Infrastructure local flag. Always clear. */
257 : unsigned ilf : 1;
258 :
259 : /* The SUBCODE field can be used for tuple-specific flags for tuples
260 : that do not require subcodes. Note that SUBCODE should be at
261 : least as wide as tree codes, as several tuples store tree codes
262 : in there. */
263 : unsigned int subcode : 16;
264 :
265 : /* UID of this statement. This is used by passes that want to assign IDs
266 : to statements. It must be assigned and used by each pass. By default
267 : it should be assumed to contain garbage. */
268 : unsigned uid;
269 :
270 : /* [ WORD 2 ]
271 : Number of operands in this tuple. */
272 : unsigned num_ops;
273 :
274 : /* Unused 32 bits padding on 64-bit hosts. */
275 :
276 : /* [ WORD 3 ]
277 : Locus information for debug info. */
278 : location_t location;
279 :
280 : /* [ WORD 4 ]
281 : Basic block holding this statement. */
282 : basic_block bb;
283 :
284 : /* [ WORD 5-6 ]
285 : Linked lists of gimple statements. The next pointers form
286 : a NULL terminated list, the prev pointers are a cyclic list.
287 : A gimple statement is hence also a double-ended list of
288 : statements, with the pointer itself being the first element,
289 : and the prev pointer being the last. */
290 : gimple *next;
291 : gimple *GTY((skip)) prev;
292 : };
293 :
294 :
295 : /* Base structure for tuples with operands. */
296 :
297 : /* This gimple subclass has no tag value. */
298 : struct GTY(())
299 : gimple_statement_with_ops_base : public gimple
300 : {
301 : /* [ WORD 1-6 ] : base class */
302 :
303 : /* [ WORD 7 ]
304 : SSA operand vectors. NOTE: It should be possible to
305 : amalgamate these vectors with the operand vector OP. However,
306 : the SSA operand vectors are organized differently and contain
307 : more information (like immediate use chaining). */
308 : struct use_optype_d GTY((skip (""))) *use_ops;
309 : };
310 :
311 :
312 : /* Statements that take register operands. */
313 :
314 : struct GTY((tag("GSS_WITH_OPS")))
315 : gimple_statement_with_ops : public gimple_statement_with_ops_base
316 : {
317 : /* [ WORD 1-7 ] : base class */
318 :
319 : /* [ WORD 8 ]
320 : Operand vector. NOTE! This must always be the last field
321 : of this structure. In particular, this means that this
322 : structure cannot be embedded inside another one. */
323 : tree GTY((length ("%h.num_ops"))) op[1];
324 : };
325 :
326 :
327 : /* Base for statements that take both memory and register operands. */
328 :
329 : struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
330 : gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
331 : {
332 : /* [ WORD 1-7 ] : base class */
333 :
334 : /* [ WORD 8-9 ]
335 : Virtual operands for this statement. The GC will pick them
336 : up via the ssa_names array. */
337 : tree GTY((skip (""))) vdef;
338 : tree GTY((skip (""))) vuse;
339 : };
340 :
341 :
342 : /* Statements that take both memory and register operands. */
343 :
344 : struct GTY((tag("GSS_WITH_MEM_OPS")))
345 : gimple_statement_with_memory_ops :
346 : public gimple_statement_with_memory_ops_base
347 : {
348 : /* [ WORD 1-9 ] : base class */
349 :
350 : /* [ WORD 10 ]
351 : Operand vector. NOTE! This must always be the last field
352 : of this structure. In particular, this means that this
353 : structure cannot be embedded inside another one. */
354 : tree GTY((length ("%h.num_ops"))) op[1];
355 : };
356 :
357 :
358 : /* Call statements that take both memory and register operands. */
359 :
360 : struct GTY((tag("GSS_CALL")))
361 : gcall : public gimple_statement_with_memory_ops_base
362 : {
363 : /* [ WORD 1-9 ] : base class */
364 :
365 : /* [ WORD 10-13 ] */
366 : struct pt_solution call_used;
367 : struct pt_solution call_clobbered;
368 :
369 : /* [ WORD 14 ] */
370 : union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
371 : tree GTY ((tag ("0"))) fntype;
372 : enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
373 : } u;
374 :
375 : /* [ WORD 15 ]
376 : Operand vector. NOTE! This must always be the last field
377 : of this structure. In particular, this means that this
378 : structure cannot be embedded inside another one. */
379 : tree GTY((length ("%h.num_ops"))) op[1];
380 :
381 : static const enum gimple_code code_ = GIMPLE_CALL;
382 : };
383 :
384 :
385 : /* OMP statements. */
386 :
387 : struct GTY((tag("GSS_OMP")))
388 : gimple_statement_omp : public gimple
389 : {
390 : /* [ WORD 1-6 ] : base class */
391 :
392 : /* [ WORD 7 ] */
393 : gimple_seq body;
394 : };
395 :
396 :
397 : /* GIMPLE_BIND */
398 :
399 : struct GTY((tag("GSS_BIND")))
400 : gbind : public gimple
401 : {
402 : /* [ WORD 1-6 ] : base class */
403 :
404 : /* [ WORD 7 ]
405 : Variables declared in this scope. */
406 : tree vars;
407 :
408 : /* [ WORD 8 ]
409 : This is different than the BLOCK field in gimple,
410 : which is analogous to TREE_BLOCK (i.e., the lexical block holding
411 : this statement). This field is the equivalent of BIND_EXPR_BLOCK
412 : in tree land (i.e., the lexical scope defined by this bind). See
413 : gimple-low.cc. */
414 : tree block;
415 :
416 : /* [ WORD 9 ] */
417 : gimple_seq body;
418 : };
419 :
420 :
421 : /* GIMPLE_CATCH */
422 :
423 : struct GTY((tag("GSS_CATCH")))
424 : gcatch : public gimple
425 : {
426 : /* [ WORD 1-6 ] : base class */
427 :
428 : /* [ WORD 7 ] */
429 : tree types;
430 :
431 : /* [ WORD 8 ] */
432 : gimple_seq handler;
433 : };
434 :
435 :
436 : /* GIMPLE_EH_FILTER */
437 :
438 : struct GTY((tag("GSS_EH_FILTER")))
439 : geh_filter : public gimple
440 : {
441 : /* [ WORD 1-6 ] : base class */
442 :
443 : /* [ WORD 7 ]
444 : Filter types. */
445 : tree types;
446 :
447 : /* [ WORD 8 ]
448 : Failure actions. */
449 : gimple_seq failure;
450 : };
451 :
452 : /* GIMPLE_EH_ELSE */
453 :
454 : struct GTY((tag("GSS_EH_ELSE")))
455 : geh_else : public gimple
456 : {
457 : /* [ WORD 1-6 ] : base class */
458 :
459 : /* [ WORD 7,8 ] */
460 : gimple_seq n_body, e_body;
461 : };
462 :
463 : /* GIMPLE_EH_MUST_NOT_THROW */
464 :
465 : struct GTY((tag("GSS_EH_MNT")))
466 : geh_mnt : public gimple
467 : {
468 : /* [ WORD 1-6 ] : base class */
469 :
470 : /* [ WORD 7 ] Abort function decl. */
471 : tree fndecl;
472 : };
473 :
474 : /* GIMPLE_PHI */
475 :
476 : struct GTY((tag("GSS_PHI")))
477 : gphi : public gimple
478 : {
479 : /* [ WORD 1-6 ] : base class */
480 :
481 : /* [ WORD 7 ] */
482 : unsigned capacity;
483 : unsigned nargs;
484 :
485 : /* [ WORD 8 ] */
486 : tree result;
487 :
488 : /* [ WORD 9-14 ] */
489 : struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
490 : };
491 :
492 :
493 : /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
494 :
495 : struct GTY((tag("GSS_EH_CTRL")))
496 : gimple_statement_eh_ctrl : public gimple
497 : {
498 : /* [ WORD 1-6 ] : base class */
499 :
500 : /* [ WORD 7 ]
501 : Exception region number. */
502 : int region;
503 : };
504 :
505 : struct GTY((tag("GSS_EH_CTRL")))
506 : gresx : public gimple_statement_eh_ctrl
507 : {
508 : /* No extra fields; adds invariant:
509 : stmt->code == GIMPLE_RESX. */
510 : };
511 :
512 : struct GTY((tag("GSS_EH_CTRL")))
513 : geh_dispatch : public gimple_statement_eh_ctrl
514 : {
515 : /* No extra fields; adds invariant:
516 : stmt->code == GIMPLE_EH_DISPATH. */
517 : };
518 :
519 :
520 : /* GIMPLE_TRY */
521 :
522 : struct GTY((tag("GSS_TRY")))
523 : gtry : public gimple
524 : {
525 : /* [ WORD 1-6 ] : base class */
526 :
527 : /* [ WORD 7 ]
528 : Expression to evaluate. */
529 : gimple_seq eval;
530 :
531 : /* [ WORD 8 ]
532 : Cleanup expression. */
533 : gimple_seq cleanup;
534 : };
535 :
536 : /* Kind of GIMPLE_TRY statements. */
537 : enum gimple_try_flags
538 : {
539 : /* A try/catch. */
540 : GIMPLE_TRY_CATCH = 1 << 0,
541 :
542 : /* A try/finally. */
543 : GIMPLE_TRY_FINALLY = 1 << 1,
544 : GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
545 :
546 : /* Analogous to TRY_CATCH_IS_CLEANUP. */
547 : GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
548 : };
549 :
550 : /* GIMPLE_WITH_CLEANUP_EXPR */
551 :
552 : struct GTY((tag("GSS_WCE")))
553 : gimple_statement_wce : public gimple
554 : {
555 : /* [ WORD 1-6 ] : base class */
556 :
557 : /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
558 : executed if an exception is thrown, not on normal exit of its
559 : scope. This flag is analogous to the CLEANUP_EH_ONLY flag
560 : in TARGET_EXPRs. */
561 :
562 : /* [ WORD 7 ]
563 : Cleanup expression. */
564 : gimple_seq cleanup;
565 : };
566 :
567 :
568 : /* GIMPLE_ASM */
569 :
570 : struct GTY((tag("GSS_ASM")))
571 : gasm : public gimple_statement_with_memory_ops_base
572 : {
573 : /* [ WORD 1-9 ] : base class */
574 :
575 : /* [ WORD 10 ]
576 : __asm__ statement. */
577 : const char *string;
578 :
579 : /* [ WORD 11 ]
580 : Number of inputs, outputs, clobbers, labels. */
581 : unsigned char ni;
582 : unsigned char no;
583 : unsigned char nc;
584 : unsigned char nl;
585 :
586 : /* [ WORD 12 ]
587 : Operand vector. NOTE! This must always be the last field
588 : of this structure. In particular, this means that this
589 : structure cannot be embedded inside another one. */
590 : tree GTY((length ("%h.num_ops"))) op[1];
591 : };
592 :
593 : /* GIMPLE_OMP_CRITICAL */
594 :
595 : struct GTY((tag("GSS_OMP_CRITICAL")))
596 : gomp_critical : public gimple_statement_omp
597 : {
598 : /* [ WORD 1-7 ] : base class */
599 :
600 : /* [ WORD 8 ] */
601 : tree clauses;
602 :
603 : /* [ WORD 9 ]
604 : Critical section name. */
605 : tree name;
606 : };
607 :
608 :
609 : struct GTY(()) gimple_omp_for_iter {
610 : /* Condition code. */
611 : enum tree_code cond;
612 :
613 : /* Index variable. */
614 : tree index;
615 :
616 : /* Initial value. */
617 : tree initial;
618 :
619 : /* Final value. */
620 : tree final;
621 :
622 : /* Increment. */
623 : tree incr;
624 : };
625 :
626 : /* GIMPLE_OMP_FOR */
627 :
628 : struct GTY((tag("GSS_OMP_FOR")))
629 : gomp_for : public gimple_statement_omp
630 : {
631 : /* [ WORD 1-7 ] : base class */
632 :
633 : /* [ WORD 8 ] */
634 : tree clauses;
635 :
636 : /* [ WORD 9 ]
637 : Number of elements in iter array. */
638 : size_t collapse;
639 :
640 : /* [ WORD 10 ] */
641 : struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
642 :
643 : /* [ WORD 11 ]
644 : Pre-body evaluated before the loop body begins. */
645 : gimple_seq pre_body;
646 : };
647 :
648 :
649 : /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
650 :
651 : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
652 : gimple_statement_omp_parallel_layout : public gimple_statement_omp
653 : {
654 : /* [ WORD 1-7 ] : base class */
655 :
656 : /* [ WORD 8 ]
657 : Clauses. */
658 : tree clauses;
659 :
660 : /* [ WORD 9 ]
661 : Child function holding the body of the parallel region. */
662 : tree child_fn;
663 :
664 : /* [ WORD 10 ]
665 : Shared data argument. */
666 : tree data_arg;
667 : };
668 :
669 : /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
670 : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
671 : gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
672 : {
673 : /* No extra fields; adds invariant:
674 : stmt->code == GIMPLE_OMP_PARALLEL
675 : || stmt->code == GIMPLE_OMP_TASK
676 : || stmt->code == GIMPLE_OMP_TEAMS. */
677 : };
678 :
679 : /* GIMPLE_OMP_PARALLEL */
680 : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
681 : gomp_parallel : public gimple_statement_omp_taskreg
682 : {
683 : /* No extra fields; adds invariant:
684 : stmt->code == GIMPLE_OMP_PARALLEL. */
685 : };
686 :
687 : /* GIMPLE_OMP_TARGET */
688 : struct GTY((tag("GSS_OMP_TARGET")))
689 : gomp_target : public gimple_statement_omp_parallel_layout
690 : {
691 : /* [ WORD 1-10 ] : base class */
692 :
693 : /* [ WORD 11 ]
694 : Iterator loops. */
695 : gimple_seq iterator_loops;
696 : };
697 :
698 : /* GIMPLE_OMP_TASK */
699 :
700 : struct GTY((tag("GSS_OMP_TASK")))
701 : gomp_task : public gimple_statement_omp_taskreg
702 : {
703 : /* [ WORD 1-10 ] : base class */
704 :
705 : /* [ WORD 11 ]
706 : Child function holding firstprivate initialization if needed. */
707 : tree copy_fn;
708 :
709 : /* [ WORD 12-13 ]
710 : Size and alignment in bytes of the argument data block. */
711 : tree arg_size;
712 : tree arg_align;
713 : };
714 :
715 :
716 : /* GIMPLE_OMP_SECTION */
717 : /* Uses struct gimple_statement_omp. */
718 :
719 :
720 : /* GIMPLE_OMP_SECTIONS */
721 :
722 : struct GTY((tag("GSS_OMP_SECTIONS")))
723 : gomp_sections : public gimple_statement_omp
724 : {
725 : /* [ WORD 1-7 ] : base class */
726 :
727 : /* [ WORD 8 ] */
728 : tree clauses;
729 :
730 : /* [ WORD 9 ]
731 : The control variable used for deciding which of the sections to
732 : execute. */
733 : tree control;
734 : };
735 :
736 : /* GIMPLE_OMP_CONTINUE.
737 :
738 : Note: This does not inherit from gimple_statement_omp, because we
739 : do not need the body field. */
740 :
741 : struct GTY((tag("GSS_OMP_CONTINUE")))
742 : gomp_continue : public gimple
743 : {
744 : /* [ WORD 1-6 ] : base class */
745 :
746 : /* [ WORD 7 ] */
747 : tree control_def;
748 :
749 : /* [ WORD 8 ] */
750 : tree control_use;
751 : };
752 :
753 : /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
754 : GIMPLE_OMP_SCAN, GIMPLE_OMP_MASKED, GIMPLE_OMP_SCOPE, GIMPLE_OMP_DISPATCH,
755 : GIMPLE_OMP_INTEROP. */
756 :
757 : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
758 : gimple_statement_omp_single_layout : public gimple_statement_omp
759 : {
760 : /* [ WORD 1-7 ] : base class */
761 :
762 : /* [ WORD 8 ] */
763 : tree clauses;
764 : };
765 :
766 : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
767 : gomp_single : public gimple_statement_omp_single_layout
768 : {
769 : /* No extra fields; adds invariant:
770 : stmt->code == GIMPLE_OMP_SINGLE. */
771 : };
772 :
773 : struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
774 : gomp_teams : public gimple_statement_omp_taskreg
775 : {
776 : /* No extra fields; adds invariant:
777 : stmt->code == GIMPLE_OMP_TEAMS. */
778 : };
779 :
780 : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
781 : gomp_ordered : public gimple_statement_omp_single_layout
782 : {
783 : /* No extra fields; adds invariant:
784 : stmt->code == GIMPLE_OMP_ORDERED. */
785 : };
786 :
787 : struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
788 : gomp_scan : public gimple_statement_omp_single_layout
789 : {
790 : /* No extra fields; adds invariant:
791 : stmt->code == GIMPLE_OMP_SCAN. */
792 : };
793 :
794 :
795 : /* GIMPLE_OMP_ATOMIC_LOAD.
796 : Note: This is based on gimple, not g_s_omp, because g_s_omp
797 : contains a sequence, which we don't need here. */
798 :
799 : struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
800 : gomp_atomic_load : public gimple
801 : {
802 : /* [ WORD 1-6 ] : base class */
803 :
804 : /* [ WORD 7-8 ] */
805 : tree rhs, lhs;
806 : };
807 :
808 : /* GIMPLE_OMP_ATOMIC_STORE.
809 : See note on GIMPLE_OMP_ATOMIC_LOAD. */
810 :
811 : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
812 : gimple_statement_omp_atomic_store_layout : public gimple
813 : {
814 : /* [ WORD 1-6 ] : base class */
815 :
816 : /* [ WORD 7 ] */
817 : tree val;
818 : };
819 :
820 : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
821 : gomp_atomic_store :
822 : public gimple_statement_omp_atomic_store_layout
823 : {
824 : /* No extra fields; adds invariant:
825 : stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
826 : };
827 :
828 : struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
829 : gimple_statement_omp_return :
830 : public gimple_statement_omp_atomic_store_layout
831 : {
832 : /* No extra fields; adds invariant:
833 : stmt->code == GIMPLE_OMP_RETURN. */
834 : };
835 :
836 : /* Assumptions. */
837 :
838 : struct GTY((tag("GSS_ASSUME")))
839 : gimple_statement_assume : public gimple
840 : {
841 : /* [ WORD 1-6 ] : base class */
842 :
843 : /* [ WORD 7 ] */
844 : tree guard;
845 :
846 : /* [ WORD 8 ] */
847 : gimple_seq body;
848 : };
849 :
850 : /* GIMPLE_TRANSACTION. */
851 :
852 : /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
853 :
854 : /* The __transaction_atomic was declared [[outer]] or it is
855 : __transaction_relaxed. */
856 : #define GTMA_IS_OUTER (1u << 0)
857 : #define GTMA_IS_RELAXED (1u << 1)
858 : #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
859 :
860 : /* The transaction is seen to not have an abort. */
861 : #define GTMA_HAVE_ABORT (1u << 2)
862 : /* The transaction is seen to have loads or stores. */
863 : #define GTMA_HAVE_LOAD (1u << 3)
864 : #define GTMA_HAVE_STORE (1u << 4)
865 : /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
866 : #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
867 : /* The transaction WILL enter serial irrevocable mode.
868 : An irrevocable block post-dominates the entire transaction, such
869 : that all invocations of the transaction will go serial-irrevocable.
870 : In such case, we don't bother instrumenting the transaction, and
871 : tell the runtime that it should begin the transaction in
872 : serial-irrevocable mode. */
873 : #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
874 : /* The transaction contains no instrumentation code whatsoever, most
875 : likely because it is guaranteed to go irrevocable upon entry. */
876 : #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
877 :
878 : struct GTY((tag("GSS_TRANSACTION")))
879 : gtransaction : public gimple_statement_with_memory_ops_base
880 : {
881 : /* [ WORD 1-9 ] : base class */
882 :
883 : /* [ WORD 10 ] */
884 : gimple_seq body;
885 :
886 : /* [ WORD 11-13 ] */
887 : tree label_norm;
888 : tree label_uninst;
889 : tree label_over;
890 : };
891 :
892 : #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
893 : enum gimple_statement_structure_enum {
894 : #include "gsstruct.def"
895 : LAST_GSS_ENUM
896 : };
897 : #undef DEFGSSTRUCT
898 :
899 : /* A statement with the invariant that
900 : stmt->code == GIMPLE_COND
901 : i.e. a conditional jump statement. */
902 :
903 : struct GTY((tag("GSS_WITH_OPS")))
904 : gcond : public gimple_statement_with_ops
905 : {
906 : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
907 : static const enum gimple_code code_ = GIMPLE_COND;
908 : };
909 :
910 : /* A statement with the invariant that
911 : stmt->code == GIMPLE_DEBUG
912 : i.e. a debug statement. */
913 :
914 : struct GTY((tag("GSS_WITH_OPS")))
915 : gdebug : public gimple_statement_with_ops
916 : {
917 : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
918 : };
919 :
920 : /* A statement with the invariant that
921 : stmt->code == GIMPLE_GOTO
922 : i.e. a goto statement. */
923 :
924 : struct GTY((tag("GSS_WITH_OPS")))
925 : ggoto : public gimple_statement_with_ops
926 : {
927 : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
928 : };
929 :
930 : /* A statement with the invariant that
931 : stmt->code == GIMPLE_LABEL
932 : i.e. a label statement. */
933 :
934 : struct GTY((tag("GSS_WITH_OPS")))
935 : glabel : public gimple_statement_with_ops
936 : {
937 : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
938 : };
939 :
940 : /* A statement with the invariant that
941 : stmt->code == GIMPLE_SWITCH
942 : i.e. a switch statement. */
943 :
944 : struct GTY((tag("GSS_WITH_OPS")))
945 : gswitch : public gimple_statement_with_ops
946 : {
947 : /* no additional fields; this uses the layout for GSS_WITH_OPS. */
948 : };
949 :
950 : /* A statement with the invariant that
951 : stmt->code == GIMPLE_ASSIGN
952 : i.e. an assignment statement. */
953 :
954 : struct GTY((tag("GSS_WITH_MEM_OPS")))
955 : gassign : public gimple_statement_with_memory_ops
956 : {
957 : static const enum gimple_code code_ = GIMPLE_ASSIGN;
958 : /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
959 : };
960 :
961 : /* A statement with the invariant that
962 : stmt->code == GIMPLE_RETURN
963 : i.e. a return statement. */
964 :
965 : struct GTY((tag("GSS_WITH_MEM_OPS")))
966 : greturn : public gimple_statement_with_memory_ops
967 : {
968 : /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
969 : };
970 :
971 : template <>
972 : template <>
973 : inline bool
974 93505247 : is_a_helper <gasm *>::test (gimple *gs)
975 : {
976 93505247 : return gs->code == GIMPLE_ASM;
977 : }
978 :
979 : template <>
980 : template <>
981 : inline bool
982 13338838920 : is_a_helper <gassign *>::test (gimple *gs)
983 : {
984 13338734103 : return gs->code == GIMPLE_ASSIGN;
985 : }
986 :
987 : template <>
988 : template <>
989 : inline bool
990 77735652029 : is_a_helper <const gassign *>::test (const gimple *gs)
991 : {
992 77735652029 : return gs->code == GIMPLE_ASSIGN;
993 : }
994 :
995 : template <>
996 : template <>
997 : inline bool
998 41982477 : is_a_helper <gbind *>::test (gimple *gs)
999 : {
1000 41982477 : return gs->code == GIMPLE_BIND;
1001 : }
1002 :
1003 : template <>
1004 : template <>
1005 : inline bool
1006 17668737298 : is_a_helper <gcall *>::test (gimple *gs)
1007 : {
1008 17668737298 : return gs->code == GIMPLE_CALL;
1009 : }
1010 :
1011 : template <>
1012 : template <>
1013 : inline bool
1014 518032 : is_a_helper <gcatch *>::test (gimple *gs)
1015 : {
1016 518032 : return gs->code == GIMPLE_CATCH;
1017 : }
1018 :
1019 : template <>
1020 : template <>
1021 : inline bool
1022 2746496032 : is_a_helper <gcond *>::test (gimple *gs)
1023 : {
1024 2746496032 : return gs->code == GIMPLE_COND;
1025 : }
1026 :
1027 : template <>
1028 : template <>
1029 : inline bool
1030 2018848386 : is_a_helper <const gcond *>::test (const gimple *gs)
1031 : {
1032 2018848386 : return gs->code == GIMPLE_COND;
1033 : }
1034 :
1035 : template <>
1036 : template <>
1037 : inline bool
1038 80019131 : is_a_helper <gdebug *>::test (gimple *gs)
1039 : {
1040 80019131 : return gs->code == GIMPLE_DEBUG;
1041 : }
1042 :
1043 : template <>
1044 : template <>
1045 : inline bool
1046 35144 : is_a_helper <const gdebug *>::test (const gimple *gs)
1047 : {
1048 35144 : return gs->code == GIMPLE_DEBUG;
1049 : }
1050 :
1051 : template <>
1052 : template <>
1053 : inline bool
1054 38330008 : is_a_helper <ggoto *>::test (gimple *gs)
1055 : {
1056 38330008 : return gs->code == GIMPLE_GOTO;
1057 : }
1058 :
1059 : template <>
1060 : template <>
1061 : inline bool
1062 4408 : is_a_helper <const ggoto *>::test (const gimple *gs)
1063 : {
1064 4408 : return gs->code == GIMPLE_GOTO;
1065 : }
1066 :
1067 : template <>
1068 : template <>
1069 : inline bool
1070 14457419664 : is_a_helper <glabel *>::test (gimple *gs)
1071 : {
1072 14457419664 : return gs->code == GIMPLE_LABEL;
1073 : }
1074 :
1075 : template <>
1076 : template <>
1077 : inline bool
1078 164725 : is_a_helper <const glabel *>::test (const gimple *gs)
1079 : {
1080 164725 : return gs->code == GIMPLE_LABEL;
1081 : }
1082 :
1083 : template <>
1084 : template <>
1085 : inline bool
1086 9337976 : is_a_helper <gresx *>::test (gimple *gs)
1087 : {
1088 9337976 : return gs->code == GIMPLE_RESX;
1089 : }
1090 :
1091 : template <>
1092 : template <>
1093 : inline bool
1094 2096232 : is_a_helper <geh_dispatch *>::test (gimple *gs)
1095 : {
1096 2096232 : return gs->code == GIMPLE_EH_DISPATCH;
1097 : }
1098 :
1099 : template <>
1100 : template <>
1101 : inline bool
1102 9221 : is_a_helper <geh_else *>::test (gimple *gs)
1103 : {
1104 9221 : return gs->code == GIMPLE_EH_ELSE;
1105 : }
1106 :
1107 : template <>
1108 : template <>
1109 : inline bool
1110 0 : is_a_helper <const geh_else *>::test (const gimple *gs)
1111 : {
1112 0 : return gs->code == GIMPLE_EH_ELSE;
1113 : }
1114 :
1115 : template <>
1116 : template <>
1117 : inline bool
1118 53305 : is_a_helper <geh_filter *>::test (gimple *gs)
1119 : {
1120 53305 : return gs->code == GIMPLE_EH_FILTER;
1121 : }
1122 :
1123 : template <>
1124 : template <>
1125 : inline bool
1126 2468311 : is_a_helper <geh_mnt *>::test (gimple *gs)
1127 : {
1128 2468311 : return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1129 : }
1130 :
1131 : template <>
1132 : template <>
1133 : inline bool
1134 808 : is_a_helper <const geh_mnt *>::test (const gimple *gs)
1135 : {
1136 808 : return gs->code == GIMPLE_EH_MUST_NOT_THROW;
1137 : }
1138 :
1139 : template <>
1140 : template <>
1141 : inline bool
1142 72818 : is_a_helper <gomp_atomic_load *>::test (gimple *gs)
1143 : {
1144 72818 : return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1145 : }
1146 :
1147 : template <>
1148 : template <>
1149 : inline bool
1150 69968 : is_a_helper <gomp_atomic_store *>::test (gimple *gs)
1151 : {
1152 69968 : return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1153 : }
1154 :
1155 : template <>
1156 : template <>
1157 : inline bool
1158 401928 : is_a_helper <gimple_statement_omp_return *>::test (gimple *gs)
1159 : {
1160 401928 : return gs->code == GIMPLE_OMP_RETURN;
1161 : }
1162 :
1163 : template <>
1164 : template <>
1165 : inline bool
1166 284854 : is_a_helper <gomp_continue *>::test (gimple *gs)
1167 : {
1168 284854 : return gs->code == GIMPLE_OMP_CONTINUE;
1169 : }
1170 :
1171 : template <>
1172 : template <>
1173 : inline bool
1174 3103 : is_a_helper <gomp_critical *>::test (gimple *gs)
1175 : {
1176 3103 : return gs->code == GIMPLE_OMP_CRITICAL;
1177 : }
1178 :
1179 : template <>
1180 : template <>
1181 : inline bool
1182 12934 : is_a_helper <gomp_ordered *>::test (gimple *gs)
1183 : {
1184 12934 : return gs->code == GIMPLE_OMP_ORDERED;
1185 : }
1186 :
1187 : template <>
1188 : template <>
1189 : inline bool
1190 5279 : is_a_helper <gomp_scan *>::test (gimple *gs)
1191 : {
1192 5279 : return gs->code == GIMPLE_OMP_SCAN;
1193 : }
1194 :
1195 : template <>
1196 : template <>
1197 : inline bool
1198 2962473 : is_a_helper <gomp_for *>::test (gimple *gs)
1199 : {
1200 2962473 : return gs->code == GIMPLE_OMP_FOR;
1201 : }
1202 :
1203 : template <>
1204 : template <>
1205 : inline bool
1206 40512 : is_a_helper <gimple_statement_omp_taskreg *>::test (gimple *gs)
1207 : {
1208 40512 : return (gs->code == GIMPLE_OMP_PARALLEL
1209 : || gs->code == GIMPLE_OMP_TASK
1210 40512 : || gs->code == GIMPLE_OMP_TEAMS);
1211 : }
1212 :
1213 : template <>
1214 : template <>
1215 : inline bool
1216 62332712 : is_a_helper <gomp_parallel *>::test (gimple *gs)
1217 : {
1218 62332712 : return gs->code == GIMPLE_OMP_PARALLEL;
1219 : }
1220 :
1221 : template <>
1222 : template <>
1223 : inline bool
1224 478899 : is_a_helper <gomp_target *>::test (gimple *gs)
1225 : {
1226 478899 : return gs->code == GIMPLE_OMP_TARGET;
1227 : }
1228 :
1229 : template <>
1230 : template <>
1231 : inline bool
1232 6545 : is_a_helper <gomp_sections *>::test (gimple *gs)
1233 : {
1234 6545 : return gs->code == GIMPLE_OMP_SECTIONS;
1235 : }
1236 :
1237 : template <>
1238 : template <>
1239 : inline bool
1240 8658 : is_a_helper <gomp_single *>::test (gimple *gs)
1241 : {
1242 8658 : return gs->code == GIMPLE_OMP_SINGLE;
1243 : }
1244 :
1245 : template <>
1246 : template <>
1247 : inline bool
1248 153642 : is_a_helper <gomp_teams *>::test (gimple *gs)
1249 : {
1250 153642 : return gs->code == GIMPLE_OMP_TEAMS;
1251 : }
1252 :
1253 : template <>
1254 : template <>
1255 : inline bool
1256 160227 : is_a_helper <gomp_task *>::test (gimple *gs)
1257 : {
1258 160227 : return gs->code == GIMPLE_OMP_TASK;
1259 : }
1260 :
1261 : template <>
1262 : template <>
1263 : inline bool
1264 10034083904 : is_a_helper <gphi *>::test (gimple *gs)
1265 : {
1266 10034082216 : return gs->code == GIMPLE_PHI;
1267 : }
1268 :
1269 : template <>
1270 : template <>
1271 : inline bool
1272 485807419 : is_a_helper <greturn *>::test (gimple *gs)
1273 : {
1274 485807419 : return gs->code == GIMPLE_RETURN;
1275 : }
1276 :
1277 : template <>
1278 : template <>
1279 : inline bool
1280 271838729 : is_a_helper <gswitch *>::test (gimple *gs)
1281 : {
1282 271838729 : return gs->code == GIMPLE_SWITCH;
1283 : }
1284 :
1285 : template <>
1286 : template <>
1287 : inline bool
1288 274472 : is_a_helper <const gswitch *>::test (const gimple *gs)
1289 : {
1290 274472 : return gs->code == GIMPLE_SWITCH;
1291 : }
1292 :
1293 : template <>
1294 : template <>
1295 : inline bool
1296 535 : is_a_helper <gimple_statement_assume *>::test (gimple *gs)
1297 : {
1298 535 : return gs->code == GIMPLE_ASSUME;
1299 : }
1300 :
1301 : template <>
1302 : template <>
1303 : inline bool
1304 115967 : is_a_helper <gtransaction *>::test (gimple *gs)
1305 : {
1306 115967 : return gs->code == GIMPLE_TRANSACTION;
1307 : }
1308 :
1309 : template <>
1310 : template <>
1311 : inline bool
1312 108198574 : is_a_helper <gtry *>::test (gimple *gs)
1313 : {
1314 106823710 : return gs->code == GIMPLE_TRY;
1315 : }
1316 :
1317 : template <>
1318 : template <>
1319 : inline bool
1320 4093 : is_a_helper <const gtry *>::test (const gimple *gs)
1321 : {
1322 4093 : return gs->code == GIMPLE_TRY;
1323 : }
1324 :
1325 : template <>
1326 : template <>
1327 : inline bool
1328 1180696 : is_a_helper <gimple_statement_wce *>::test (gimple *gs)
1329 : {
1330 1180696 : return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
1331 : }
1332 :
1333 : template <>
1334 : template <>
1335 : inline bool
1336 671414 : is_a_helper <const gasm *>::test (const gimple *gs)
1337 : {
1338 671414 : return gs->code == GIMPLE_ASM;
1339 : }
1340 :
1341 : template <>
1342 : template <>
1343 : inline bool
1344 17870 : is_a_helper <const gbind *>::test (const gimple *gs)
1345 : {
1346 17870 : return gs->code == GIMPLE_BIND;
1347 : }
1348 :
1349 : template <>
1350 : template <>
1351 : inline bool
1352 34879956600 : is_a_helper <const gcall *>::test (const gimple *gs)
1353 : {
1354 34879956600 : return gs->code == GIMPLE_CALL;
1355 : }
1356 :
1357 : template <>
1358 : template <>
1359 : inline bool
1360 0 : is_a_helper <const gcatch *>::test (const gimple *gs)
1361 : {
1362 0 : return gs->code == GIMPLE_CATCH;
1363 : }
1364 :
1365 : template <>
1366 : template <>
1367 : inline bool
1368 2263 : is_a_helper <const gresx *>::test (const gimple *gs)
1369 : {
1370 2263 : return gs->code == GIMPLE_RESX;
1371 : }
1372 :
1373 : template <>
1374 : template <>
1375 : inline bool
1376 30 : is_a_helper <const geh_dispatch *>::test (const gimple *gs)
1377 : {
1378 30 : return gs->code == GIMPLE_EH_DISPATCH;
1379 : }
1380 :
1381 : template <>
1382 : template <>
1383 : inline bool
1384 5256 : is_a_helper <const geh_filter *>::test (const gimple *gs)
1385 : {
1386 5256 : return gs->code == GIMPLE_EH_FILTER;
1387 : }
1388 :
1389 : template <>
1390 : template <>
1391 : inline bool
1392 526 : is_a_helper <const gomp_atomic_load *>::test (const gimple *gs)
1393 : {
1394 526 : return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
1395 : }
1396 :
1397 : template <>
1398 : template <>
1399 : inline bool
1400 526 : is_a_helper <const gomp_atomic_store *>::test (const gimple *gs)
1401 : {
1402 526 : return gs->code == GIMPLE_OMP_ATOMIC_STORE;
1403 : }
1404 :
1405 : template <>
1406 : template <>
1407 : inline bool
1408 10029 : is_a_helper <const gimple_statement_omp_return *>::test (const gimple *gs)
1409 : {
1410 10029 : return gs->code == GIMPLE_OMP_RETURN;
1411 : }
1412 :
1413 : template <>
1414 : template <>
1415 : inline bool
1416 292 : is_a_helper <const gomp_continue *>::test (const gimple *gs)
1417 : {
1418 292 : return gs->code == GIMPLE_OMP_CONTINUE;
1419 : }
1420 :
1421 : template <>
1422 : template <>
1423 : inline bool
1424 16 : is_a_helper <const gomp_critical *>::test (const gimple *gs)
1425 : {
1426 16 : return gs->code == GIMPLE_OMP_CRITICAL;
1427 : }
1428 :
1429 : template <>
1430 : template <>
1431 : inline bool
1432 37 : is_a_helper <const gomp_ordered *>::test (const gimple *gs)
1433 : {
1434 37 : return gs->code == GIMPLE_OMP_ORDERED;
1435 : }
1436 :
1437 : template <>
1438 : template <>
1439 : inline bool
1440 0 : is_a_helper <const gomp_scan *>::test (const gimple *gs)
1441 : {
1442 0 : return gs->code == GIMPLE_OMP_SCAN;
1443 : }
1444 :
1445 : template <>
1446 : template <>
1447 : inline bool
1448 2612466 : is_a_helper <const gomp_for *>::test (const gimple *gs)
1449 : {
1450 2612466 : return gs->code == GIMPLE_OMP_FOR;
1451 : }
1452 :
1453 : template <>
1454 : template <>
1455 : inline bool
1456 106416 : is_a_helper <const gimple_statement_omp_taskreg *>::test (const gimple *gs)
1457 : {
1458 106416 : return (gs->code == GIMPLE_OMP_PARALLEL
1459 : || gs->code == GIMPLE_OMP_TASK
1460 106416 : || gs->code == GIMPLE_OMP_TEAMS);
1461 : }
1462 :
1463 : template <>
1464 : template <>
1465 : inline bool
1466 117329 : is_a_helper <const gomp_parallel *>::test (const gimple *gs)
1467 : {
1468 117329 : return gs->code == GIMPLE_OMP_PARALLEL;
1469 : }
1470 :
1471 : template <>
1472 : template <>
1473 : inline bool
1474 185177 : is_a_helper <const gomp_target *>::test (const gimple *gs)
1475 : {
1476 185177 : return gs->code == GIMPLE_OMP_TARGET;
1477 : }
1478 :
1479 : template <>
1480 : template <>
1481 : inline bool
1482 3374 : is_a_helper <const gomp_sections *>::test (const gimple *gs)
1483 : {
1484 3374 : return gs->code == GIMPLE_OMP_SECTIONS;
1485 : }
1486 :
1487 : template <>
1488 : template <>
1489 : inline bool
1490 3639 : is_a_helper <const gomp_single *>::test (const gimple *gs)
1491 : {
1492 3639 : return gs->code == GIMPLE_OMP_SINGLE;
1493 : }
1494 :
1495 : template <>
1496 : template <>
1497 : inline bool
1498 35910 : is_a_helper <const gomp_teams *>::test (const gimple *gs)
1499 : {
1500 35910 : return gs->code == GIMPLE_OMP_TEAMS;
1501 : }
1502 :
1503 : template <>
1504 : template <>
1505 : inline bool
1506 44548 : is_a_helper <const gomp_task *>::test (const gimple *gs)
1507 : {
1508 44548 : return gs->code == GIMPLE_OMP_TASK;
1509 : }
1510 :
1511 : template <>
1512 : template <>
1513 : inline bool
1514 9039326406 : is_a_helper <const gphi *>::test (const gimple *gs)
1515 : {
1516 9039326406 : return gs->code == GIMPLE_PHI;
1517 : }
1518 :
1519 : template <>
1520 : template <>
1521 : inline bool
1522 90702 : is_a_helper <const greturn *>::test (const gimple *gs)
1523 : {
1524 90702 : return gs->code == GIMPLE_RETURN;
1525 : }
1526 :
1527 : template <>
1528 : template <>
1529 : inline bool
1530 626 : is_a_helper <const gimple_statement_assume *>::test (const gimple *gs)
1531 : {
1532 626 : return gs->code == GIMPLE_ASSUME;
1533 : }
1534 :
1535 : template <>
1536 : template <>
1537 : inline bool
1538 77 : is_a_helper <const gtransaction *>::test (const gimple *gs)
1539 : {
1540 77 : return gs->code == GIMPLE_TRANSACTION;
1541 : }
1542 :
1543 : /* Offset in bytes to the location of the operand vector.
1544 : Zero if there is no operand vector for this tuple structure. */
1545 : extern size_t const gimple_ops_offset_[];
1546 :
1547 : /* Map GIMPLE codes to GSS codes. */
1548 : extern enum gimple_statement_structure_enum const gss_for_code_[];
1549 :
1550 : /* This variable holds the currently expanded gimple statement for purposes
1551 : of communicating the profile info to the builtin expanders. */
1552 : extern gimple *currently_expanding_gimple_stmt;
1553 :
1554 : size_t gimple_size (enum gimple_code code, unsigned num_ops = 0);
1555 : void gimple_init (gimple *g, enum gimple_code code, unsigned num_ops);
1556 : gimple *gimple_alloc (enum gimple_code, unsigned CXX_MEM_STAT_INFO);
1557 : greturn *gimple_build_return (tree);
1558 : void gimple_call_reset_alias_info (gcall *);
1559 : gcall *gimple_build_call_vec (tree, const vec<tree> &);
1560 : gcall *gimple_build_call (tree, unsigned, ...);
1561 : gcall *gimple_build_call_valist (tree, unsigned, va_list);
1562 : gcall *gimple_build_call_internal (enum internal_fn, unsigned, ...);
1563 : gcall *gimple_build_call_internal_vec (enum internal_fn, const vec<tree> &);
1564 : gcall *gimple_build_call_from_tree (tree, tree);
1565 : gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_INFO);
1566 : gassign *gimple_build_assign (tree, enum tree_code,
1567 : tree, tree, tree CXX_MEM_STAT_INFO);
1568 : gassign *gimple_build_assign (tree, enum tree_code,
1569 : tree, tree CXX_MEM_STAT_INFO);
1570 : gassign *gimple_build_assign (tree, enum tree_code, tree CXX_MEM_STAT_INFO);
1571 : gcond *gimple_build_cond (enum tree_code, tree, tree, tree, tree);
1572 : gcond *gimple_build_cond_from_tree (tree, tree, tree);
1573 : void gimple_cond_set_condition_from_tree (gcond *, tree);
1574 : glabel *gimple_build_label (tree label);
1575 : ggoto *gimple_build_goto (tree dest);
1576 : gimple *gimple_build_nop (void);
1577 : gbind *gimple_build_bind (tree, gimple_seq, tree);
1578 : gasm *gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
1579 : vec<tree, va_gc> *, vec<tree, va_gc> *,
1580 : vec<tree, va_gc> *);
1581 : gcatch *gimple_build_catch (tree, gimple_seq);
1582 : geh_filter *gimple_build_eh_filter (tree, gimple_seq);
1583 : geh_mnt *gimple_build_eh_must_not_throw (tree);
1584 : geh_else *gimple_build_eh_else (gimple_seq, gimple_seq);
1585 : gtry *gimple_build_try (gimple_seq, gimple_seq,
1586 : enum gimple_try_flags);
1587 : gimple *gimple_build_wce (gimple_seq);
1588 : gresx *gimple_build_resx (int);
1589 : gswitch *gimple_build_switch_nlabels (unsigned, tree, tree);
1590 : gswitch *gimple_build_switch (tree, tree, const vec<tree> &);
1591 : geh_dispatch *gimple_build_eh_dispatch (int);
1592 : gdebug *gimple_build_debug_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1593 : gdebug *gimple_build_debug_source_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
1594 : gdebug *gimple_build_debug_begin_stmt (tree, location_t CXX_MEM_STAT_INFO);
1595 : gdebug *gimple_build_debug_inline_entry (tree, location_t CXX_MEM_STAT_INFO);
1596 : gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
1597 : gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
1598 : gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
1599 : gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
1600 : tree, tree);
1601 : gimple *gimple_build_omp_section (gimple_seq);
1602 : gimple *gimple_build_omp_structured_block (gimple_seq);
1603 : gimple *gimple_build_omp_scope (gimple_seq, tree);
1604 : gimple *gimple_build_omp_dispatch (gimple_seq, tree);
1605 : gimple *gimple_build_omp_interop (tree);
1606 : gimple *gimple_build_omp_master (gimple_seq);
1607 : gimple *gimple_build_omp_masked (gimple_seq, tree);
1608 : gimple *gimple_build_omp_taskgroup (gimple_seq, tree);
1609 : gomp_continue *gimple_build_omp_continue (tree, tree);
1610 : gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
1611 : gimple *gimple_build_omp_return (bool);
1612 : gomp_scan *gimple_build_omp_scan (gimple_seq, tree);
1613 : gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
1614 : gimple *gimple_build_omp_sections_switch (void);
1615 : gomp_single *gimple_build_omp_single (gimple_seq, tree);
1616 : gomp_target *gimple_build_omp_target (gimple_seq, int, tree, gimple_seq = NULL);
1617 : gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
1618 : gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree,
1619 : enum omp_memory_order);
1620 : gomp_atomic_store *gimple_build_omp_atomic_store (tree, enum omp_memory_order);
1621 : gimple *gimple_build_assume (tree, gimple_seq);
1622 : gtransaction *gimple_build_transaction (gimple_seq);
1623 : extern void gimple_seq_add_stmt (gimple_seq *, gimple *);
1624 : extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple *);
1625 : void gimple_seq_add_seq (gimple_seq *, gimple_seq);
1626 : void gimple_seq_add_seq_without_update (gimple_seq *, gimple_seq);
1627 : extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
1628 : location_t);
1629 : extern void annotate_all_with_location (gimple_seq, location_t);
1630 : bool empty_body_p (gimple_seq);
1631 : gimple_seq gimple_seq_copy (gimple_seq);
1632 : bool gimple_call_same_target_p (const gimple *, const gimple *);
1633 : int gimple_call_flags (const gimple *);
1634 : int gimple_call_arg_flags (const gcall *, unsigned);
1635 : int gimple_call_retslot_flags (const gcall *);
1636 : int gimple_call_static_chain_flags (const gcall *);
1637 : int gimple_call_return_flags (const gcall *);
1638 : bool gimple_call_nonnull_result_p (gcall *);
1639 : tree gimple_call_nonnull_arg (gcall *);
1640 : bool gimple_assign_copy_p (gimple *);
1641 : bool gimple_assign_ssa_name_copy_p (gimple *);
1642 : bool gimple_assign_unary_nop_p (gimple *);
1643 : bool gimple_assign_load_p (const gimple *);
1644 : void gimple_set_bb (gimple *, basic_block);
1645 : void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
1646 : void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
1647 : tree, tree, tree);
1648 : tree gimple_get_lhs (const gimple *);
1649 : void gimple_set_lhs (gimple *, tree);
1650 : gimple *gimple_copy (gimple *);
1651 : void gimple_move_vops (gimple *, gimple *);
1652 : bool gimple_has_side_effects (const gimple *);
1653 : bool gimple_could_trap_p_1 (const gimple *, bool, bool);
1654 : bool gimple_could_trap_p (const gimple *);
1655 : bool gimple_assign_rhs_could_trap_p (gimple *);
1656 : extern void dump_gimple_statistics (void);
1657 : unsigned get_gimple_rhs_num_ops (enum tree_code);
1658 : gcall *gimple_call_copy_skip_args (gcall *, bitmap);
1659 : extern bool gimple_compare_field_offset (tree, tree);
1660 : extern tree gimple_unsigned_type (tree);
1661 : extern tree gimple_signed_type (tree);
1662 : extern alias_set_type gimple_get_alias_set (tree);
1663 : extern bool gimple_ior_addresses_taken (bitmap, gimple *);
1664 : extern bool gimple_builtin_call_types_compatible_p (const gimple *, tree);
1665 : extern combined_fn gimple_call_combined_fn (const gimple *);
1666 : extern bool gimple_call_operator_delete_p (const gcall *);
1667 : extern bool gimple_call_builtin_p (const gimple *);
1668 : extern bool gimple_call_builtin_p (const gimple *, enum built_in_class);
1669 : extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
1670 : extern bool gimple_asm_clobbers_memory_p (const gasm *);
1671 : extern void dump_decl_set (FILE *, bitmap);
1672 : extern bool nonfreeing_call_p (gimple *);
1673 : extern bool nonbarrier_call_p (gimple *);
1674 : extern bool infer_nonnull_range (gimple *, tree);
1675 : extern bool infer_nonnull_range_by_dereference (gimple *, tree);
1676 : extern bool infer_nonnull_range_by_attribute (gimple *, tree, tree * = NULL,
1677 : tree * = NULL);
1678 : extern void sort_case_labels (vec<tree> &);
1679 : extern void preprocess_case_label_vec_for_gimple (vec<tree> &, tree, tree *);
1680 : extern void gimple_seq_set_location (gimple_seq, location_t);
1681 : extern void gimple_seq_discard (gimple_seq);
1682 : extern void maybe_remove_unused_call_args (struct function *, gimple *);
1683 : extern bool gimple_inexpensive_call_p (gcall *);
1684 : extern bool stmt_can_terminate_bb_p (gimple *);
1685 : extern location_t gimple_or_expr_nonartificial_location (gimple *, tree);
1686 : gcall *gimple_build_builtin_unreachable (location_t);
1687 :
1688 : /* Return the disposition for a warning (or all warnings by default)
1689 : for a statement. */
1690 : extern bool warning_suppressed_p (const gimple *, opt_code = all_warnings)
1691 : ATTRIBUTE_NONNULL (1);
1692 : /* Set the disposition for a warning (or all warnings by default)
1693 : at a location to enabled by default. */
1694 : extern void suppress_warning (gimple *, opt_code = all_warnings,
1695 : bool = true) ATTRIBUTE_NONNULL (1);
1696 :
1697 : /* Copy the warning disposition mapping from one statement to another. */
1698 : extern void copy_warning (gimple *, const gimple *)
1699 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1700 : /* Copy the warning disposition mapping from an expression to a statement. */
1701 : extern void copy_warning (gimple *, const_tree)
1702 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1703 : /* Copy the warning disposition mapping from a statement to an expression. */
1704 : extern void copy_warning (tree, const gimple *)
1705 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2);
1706 :
1707 : /* Formal (expression) temporary table handling: multiple occurrences of
1708 : the same scalar expression are evaluated into the same temporary. */
1709 :
1710 : typedef struct gimple_temp_hash_elt
1711 : {
1712 : tree val; /* Key */
1713 : tree temp; /* Value */
1714 : } elt_t;
1715 :
1716 : /* Get the number of the next statement uid to be allocated. */
1717 : inline unsigned int
1718 8548512 : gimple_stmt_max_uid (struct function *fn)
1719 : {
1720 8548512 : return fn->last_stmt_uid;
1721 : }
1722 :
1723 : /* Set the number of the next statement uid to be allocated. */
1724 : inline void
1725 20544776 : set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
1726 : {
1727 20544776 : fn->last_stmt_uid = maxid;
1728 : }
1729 :
1730 : /* Set the number of the next statement uid to be allocated. */
1731 : inline unsigned int
1732 1081137544 : inc_gimple_stmt_max_uid (struct function *fn)
1733 : {
1734 1081137544 : return fn->last_stmt_uid++;
1735 : }
1736 :
1737 : /* Return the first node in GIMPLE sequence S. */
1738 :
1739 : inline gimple_seq_node
1740 : gimple_seq_first (gimple_seq s)
1741 : {
1742 : return s;
1743 : }
1744 :
1745 :
1746 : /* Return the first statement in GIMPLE sequence S. */
1747 :
1748 : inline gimple *
1749 : gimple_seq_first_stmt (gimple_seq s)
1750 : {
1751 9699949 : gimple_seq_node n = gimple_seq_first (s);
1752 : return n;
1753 : }
1754 :
1755 : /* Return the first statement in GIMPLE sequence S as a gbind *,
1756 : verifying that it has code GIMPLE_BIND in a checked build. */
1757 :
1758 : inline gbind *
1759 24626 : gimple_seq_first_stmt_as_a_bind (gimple_seq s)
1760 : {
1761 24626 : gimple_seq_node n = gimple_seq_first (s);
1762 24626 : return as_a <gbind *> (n);
1763 : }
1764 :
1765 :
1766 : /* Return the last node in GIMPLE sequence S. */
1767 :
1768 : inline gimple_seq_node
1769 7155549167 : gimple_seq_last (gimple_seq s)
1770 : {
1771 7153320353 : return s ? s->prev : NULL;
1772 : }
1773 :
1774 :
1775 : /* Return the last statement in GIMPLE sequence S. */
1776 :
1777 : inline gimple *
1778 2481362 : gimple_seq_last_stmt (gimple_seq s)
1779 : {
1780 1049357 : gimple_seq_node n = gimple_seq_last (s);
1781 1615693 : return n;
1782 : }
1783 :
1784 :
1785 : /* Set the last node in GIMPLE sequence *PS to LAST. */
1786 :
1787 : inline void
1788 451797246 : gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1789 : {
1790 24011122 : (*ps)->prev = last;
1791 427198784 : }
1792 :
1793 :
1794 : /* Set the first node in GIMPLE sequence *PS to FIRST. */
1795 :
1796 : inline void
1797 207532888 : gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1798 : {
1799 187584086 : *ps = first;
1800 20536142 : }
1801 :
1802 :
1803 : /* Return true if GIMPLE sequence S is empty. */
1804 :
1805 : inline bool
1806 134469542 : gimple_seq_empty_p (gimple_seq s)
1807 : {
1808 134469542 : return s == NULL;
1809 : }
1810 :
1811 : /* Allocate a new sequence and initialize its first element with STMT. */
1812 :
1813 : inline gimple_seq
1814 13410067 : gimple_seq_alloc_with_stmt (gimple *stmt)
1815 : {
1816 13410067 : gimple_seq seq = NULL;
1817 13410067 : gimple_seq_add_stmt (&seq, stmt);
1818 13410067 : return seq;
1819 : }
1820 :
1821 :
1822 : /* Returns the sequence of statements in BB. */
1823 :
1824 : inline gimple_seq
1825 97161948 : bb_seq (const_basic_block bb)
1826 : {
1827 97161948 : return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1828 : }
1829 :
1830 : inline gimple_seq *
1831 19153285906 : bb_seq_addr (basic_block bb)
1832 : {
1833 19121678628 : return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1834 : }
1835 :
1836 : /* Sets the sequence of statements in BB to SEQ. */
1837 :
1838 : inline void
1839 92081477 : set_bb_seq (basic_block bb, gimple_seq seq)
1840 : {
1841 92081477 : gcc_checking_assert (!(bb->flags & BB_RTL));
1842 92081477 : bb->il.gimple.seq = seq;
1843 92081477 : }
1844 :
1845 :
1846 : /* Return the code for GIMPLE statement G. */
1847 :
1848 : inline enum gimple_code
1849 >58967*10^7 : gimple_code (const gimple *g)
1850 : {
1851 >19694*10^7 : return g->code;
1852 : }
1853 :
1854 :
1855 : /* Return the GSS code used by a GIMPLE code. */
1856 :
1857 : inline enum gimple_statement_structure_enum
1858 >10122*10^7 : gss_for_code (enum gimple_code code)
1859 : {
1860 >10122*10^7 : gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1861 >10122*10^7 : return gss_for_code_[code];
1862 : }
1863 :
1864 :
1865 : /* Return which GSS code is used by GS. */
1866 :
1867 : inline enum gimple_statement_structure_enum
1868 >10084*10^7 : gimple_statement_structure (gimple *gs)
1869 : {
1870 55093855188 : return gss_for_code (gimple_code (gs));
1871 : }
1872 :
1873 :
1874 : /* Return true if statement G has sub-statements. This is only true for
1875 : High GIMPLE statements. */
1876 :
1877 : inline bool
1878 384786139 : gimple_has_substatements (gimple *g)
1879 : {
1880 384786139 : switch (gimple_code (g))
1881 : {
1882 : case GIMPLE_ASSUME:
1883 : case GIMPLE_BIND:
1884 : case GIMPLE_CATCH:
1885 : case GIMPLE_EH_FILTER:
1886 : case GIMPLE_EH_ELSE:
1887 : case GIMPLE_TRY:
1888 : case GIMPLE_OMP_FOR:
1889 : case GIMPLE_OMP_MASTER:
1890 : case GIMPLE_OMP_MASKED:
1891 : case GIMPLE_OMP_TASKGROUP:
1892 : case GIMPLE_OMP_ORDERED:
1893 : case GIMPLE_OMP_SECTION:
1894 : case GIMPLE_OMP_STRUCTURED_BLOCK:
1895 : case GIMPLE_OMP_PARALLEL:
1896 : case GIMPLE_OMP_TASK:
1897 : case GIMPLE_OMP_SCOPE:
1898 : case GIMPLE_OMP_DISPATCH:
1899 : case GIMPLE_OMP_SECTIONS:
1900 : case GIMPLE_OMP_SINGLE:
1901 : case GIMPLE_OMP_TARGET:
1902 : case GIMPLE_OMP_TEAMS:
1903 : case GIMPLE_OMP_CRITICAL:
1904 : case GIMPLE_WITH_CLEANUP_EXPR:
1905 : case GIMPLE_TRANSACTION:
1906 : return true;
1907 :
1908 384698589 : default:
1909 384698589 : return false;
1910 : }
1911 : }
1912 :
1913 :
1914 : /* Return the basic block holding statement G. */
1915 :
1916 : inline basic_block
1917 34881939304 : gimple_bb (const gimple *g)
1918 : {
1919 32934046112 : return g->bb;
1920 : }
1921 :
1922 :
1923 : /* Return the lexical scope block holding statement G. */
1924 :
1925 : inline tree
1926 1489848367 : gimple_block (const gimple *g)
1927 : {
1928 1489848367 : return LOCATION_BLOCK (g->location);
1929 : }
1930 :
1931 : /* Forward declare. */
1932 : inline void gimple_set_location (gimple *, location_t);
1933 :
1934 : /* Set BLOCK to be the lexical scope block holding statement G. */
1935 :
1936 : inline void
1937 179148940 : gimple_set_block (gimple *g, tree block)
1938 : {
1939 179148940 : gimple_set_location (g, set_block (g->location, block));
1940 179148940 : }
1941 :
1942 : /* Return location information for statement G. */
1943 :
1944 : inline location_t
1945 16078883230 : gimple_location (const gimple *g)
1946 : {
1947 15988063397 : return g->location;
1948 : }
1949 :
1950 : /* Return location information for statement G if g is not NULL.
1951 : Otherwise, UNKNOWN_LOCATION is returned. */
1952 :
1953 : inline location_t
1954 : gimple_location_safe (const gimple *g)
1955 : {
1956 : return g ? gimple_location (g) : UNKNOWN_LOCATION;
1957 : }
1958 :
1959 : /* Set location information for statement G. */
1960 :
1961 : inline void
1962 445082271 : gimple_set_location (gimple *g, location_t location)
1963 : {
1964 : /* Copy the no-warning data to the statement location. */
1965 421836633 : if (g->location != UNKNOWN_LOCATION)
1966 237160205 : copy_warning (location, g->location);
1967 271364198 : g->location = location;
1968 169995408 : }
1969 :
1970 : /* Return address of the location information for statement G. */
1971 :
1972 : inline location_t *
1973 1405361 : gimple_location_ptr (gimple *g)
1974 : {
1975 1405361 : return &g->location;
1976 : }
1977 :
1978 :
1979 : /* Return true if G contains location information. */
1980 :
1981 : inline bool
1982 754268189 : gimple_has_location (const gimple *g)
1983 : {
1984 754268189 : return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1985 : }
1986 :
1987 :
1988 : /* Return non-artificial location information for statement G. */
1989 :
1990 : inline location_t
1991 170448 : gimple_nonartificial_location (const gimple *g)
1992 : {
1993 170448 : location_t *ploc = NULL;
1994 :
1995 170448 : if (tree block = gimple_block (g))
1996 168664 : ploc = block_nonartificial_location (block);
1997 :
1998 170448 : return ploc ? *ploc : gimple_location (g);
1999 : }
2000 :
2001 :
2002 : /* Return the file name of the location of STMT. */
2003 :
2004 : inline const char *
2005 10727 : gimple_filename (const gimple *stmt)
2006 : {
2007 10727 : return LOCATION_FILE (gimple_location (stmt));
2008 : }
2009 :
2010 :
2011 : /* Return the line number of the location of STMT. */
2012 :
2013 : inline int
2014 20972 : gimple_lineno (const gimple *stmt)
2015 : {
2016 10736 : return LOCATION_LINE (gimple_location (stmt));
2017 : }
2018 :
2019 :
2020 : /* Determine whether SEQ is a singleton. */
2021 :
2022 : inline bool
2023 405982 : gimple_seq_singleton_p (gimple_seq seq)
2024 : {
2025 405982 : return ((gimple_seq_first (seq) != NULL)
2026 405982 : && (gimple_seq_first (seq) == gimple_seq_last (seq)));
2027 : }
2028 :
2029 : /* Return true if no warnings should be emitted for statement STMT. */
2030 :
2031 : inline bool
2032 1689045 : gimple_no_warning_p (const gimple *stmt)
2033 : {
2034 1689045 : return stmt->no_warning;
2035 : }
2036 :
2037 : /* Set the no_warning flag of STMT to NO_WARNING. */
2038 :
2039 : inline void
2040 : gimple_set_no_warning (gimple *stmt, bool no_warning)
2041 : {
2042 : stmt->no_warning = (unsigned) no_warning;
2043 : }
2044 :
2045 : /* Set the visited status on statement STMT to VISITED_P.
2046 :
2047 : Please note that this 'visited' property of the gimple statement is
2048 : supposed to be undefined at pass boundaries. This means that a
2049 : given pass should not assume it contains any useful value when the
2050 : pass starts and thus can set it to any value it sees fit.
2051 :
2052 : You can learn more about the visited property of the gimple
2053 : statement by reading the comments of the 'visited' data member of
2054 : struct gimple.
2055 : */
2056 :
2057 : inline void
2058 2277495566 : gimple_set_visited (gimple *stmt, bool visited_p)
2059 : {
2060 2104490205 : stmt->visited = (unsigned) visited_p;
2061 173005361 : }
2062 :
2063 :
2064 : /* Return the visited status for statement STMT.
2065 :
2066 : Please note that this 'visited' property of the gimple statement is
2067 : supposed to be undefined at pass boundaries. This means that a
2068 : given pass should not assume it contains any useful value when the
2069 : pass starts and thus can set it to any value it sees fit.
2070 :
2071 : You can learn more about the visited property of the gimple
2072 : statement by reading the comments of the 'visited' data member of
2073 : struct gimple. */
2074 :
2075 : inline bool
2076 6658536352 : gimple_visited_p (gimple *stmt)
2077 : {
2078 6658536352 : return stmt->visited;
2079 : }
2080 :
2081 :
2082 : /* Set pass local flag PLF on statement STMT to VAL_P.
2083 :
2084 : Please note that this PLF property of the gimple statement is
2085 : supposed to be undefined at pass boundaries. This means that a
2086 : given pass should not assume it contains any useful value when the
2087 : pass starts and thus can set it to any value it sees fit.
2088 :
2089 : You can learn more about the PLF property by reading the comment of
2090 : the 'plf' data member of struct gimple_statement_structure. */
2091 :
2092 : inline void
2093 2994456916 : gimple_set_plf (gimple *stmt, enum plf_mask plf, bool val_p)
2094 : {
2095 2994456916 : if (val_p)
2096 1210790457 : stmt->plf |= (unsigned int) plf;
2097 : else
2098 1769604446 : stmt->plf &= ~((unsigned int) plf);
2099 40532494 : }
2100 :
2101 :
2102 : /* Return the value of pass local flag PLF on statement STMT.
2103 :
2104 : Please note that this 'plf' property of the gimple statement is
2105 : supposed to be undefined at pass boundaries. This means that a
2106 : given pass should not assume it contains any useful value when the
2107 : pass starts and thus can set it to any value it sees fit.
2108 :
2109 : You can learn more about the plf property by reading the comment of
2110 : the 'plf' data member of struct gimple_statement_structure. */
2111 :
2112 : inline unsigned int
2113 4267565434 : gimple_plf (gimple *stmt, enum plf_mask plf)
2114 : {
2115 4232016860 : return stmt->plf & ((unsigned int) plf);
2116 : }
2117 :
2118 :
2119 : /* Set the UID of statement.
2120 :
2121 : Please note that this UID property is supposed to be undefined at
2122 : pass boundaries. This means that a given pass should not assume it
2123 : contains any useful value when the pass starts and thus can set it
2124 : to any value it sees fit. */
2125 :
2126 : inline void
2127 2103203935 : gimple_set_uid (gimple *g, unsigned uid)
2128 : {
2129 2101767606 : g->uid = uid;
2130 34807111 : }
2131 :
2132 :
2133 : /* Return the UID of statement.
2134 :
2135 : Please note that this UID property is supposed to be undefined at
2136 : pass boundaries. This means that a given pass should not assume it
2137 : contains any useful value when the pass starts and thus can set it
2138 : to any value it sees fit. */
2139 :
2140 : inline unsigned
2141 2091287725 : gimple_uid (const gimple *g)
2142 : {
2143 2083668516 : return g->uid;
2144 : }
2145 :
2146 :
2147 : /* Make statement G a singleton sequence. */
2148 :
2149 : inline void
2150 403461463 : gimple_init_singleton (gimple *g)
2151 : {
2152 403461463 : g->next = NULL;
2153 90478163 : g->prev = g;
2154 : }
2155 :
2156 :
2157 : /* Return true if GIMPLE statement G has register or memory operands. */
2158 :
2159 : inline bool
2160 >12891*10^7 : gimple_has_ops (const gimple *g)
2161 : {
2162 >12891*10^7 : return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
2163 : }
2164 :
2165 : template <>
2166 : template <>
2167 : inline bool
2168 26527063602 : is_a_helper <const gimple_statement_with_ops *>::test (const gimple *gs)
2169 : {
2170 66372405166 : return gimple_has_ops (gs);
2171 : }
2172 :
2173 : template <>
2174 : template <>
2175 : inline bool
2176 462110024 : is_a_helper <gimple_statement_with_ops *>::test (gimple *gs)
2177 : {
2178 924220048 : return gimple_has_ops (gs);
2179 : }
2180 :
2181 : /* Return true if GIMPLE statement G has memory operands. */
2182 :
2183 : inline bool
2184 >10926*10^7 : gimple_has_mem_ops (const gimple *g)
2185 : {
2186 58656986227 : return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
2187 : }
2188 :
2189 : template <>
2190 : template <>
2191 : inline bool
2192 39831326436 : is_a_helper <const gimple_statement_with_memory_ops *>::test (const gimple *gs)
2193 : {
2194 >13629*10^7 : return gimple_has_mem_ops (gs);
2195 : }
2196 :
2197 : template <>
2198 : template <>
2199 : inline bool
2200 564529684 : is_a_helper <gimple_statement_with_memory_ops *>::test (gimple *gs)
2201 : {
2202 2624047242 : return gimple_has_mem_ops (gs);
2203 : }
2204 :
2205 : /* Return the set of USE operands for statement G. */
2206 :
2207 : inline struct use_optype_d *
2208 26527078448 : gimple_use_ops (const gimple *g)
2209 : {
2210 26527063602 : const gimple_statement_with_ops *ops_stmt =
2211 39844533230 : dyn_cast <const gimple_statement_with_ops *> (g);
2212 26394736090 : if (!ops_stmt)
2213 : return NULL;
2214 26394736090 : return ops_stmt->use_ops;
2215 : }
2216 :
2217 :
2218 : /* Set USE to be the set of USE operands for statement G. */
2219 :
2220 : inline void
2221 462110024 : gimple_set_use_ops (gimple *g, struct use_optype_d *use)
2222 : {
2223 462110024 : gimple_statement_with_ops *ops_stmt =
2224 462110024 : as_a <gimple_statement_with_ops *> (g);
2225 67332256 : ops_stmt->use_ops = use;
2226 5323 : }
2227 :
2228 :
2229 : /* Return the single VUSE operand of the statement G. */
2230 :
2231 : inline tree
2232 46612861620 : gimple_vuse (const gimple *g)
2233 : {
2234 49550677439 : const gimple_statement_with_memory_ops *mem_ops_stmt =
2235 54119717325 : dyn_cast <const gimple_statement_with_memory_ops *> (g);
2236 23714883375 : if (!mem_ops_stmt)
2237 : return NULL_TREE;
2238 23605143902 : return mem_ops_stmt->vuse;
2239 : }
2240 :
2241 : /* Return the single VDEF operand of the statement G. */
2242 :
2243 : inline tree
2244 23581197485 : gimple_vdef (const gimple *g)
2245 : {
2246 34363172210 : const gimple_statement_with_memory_ops *mem_ops_stmt =
2247 43551784321 : dyn_cast <const gimple_statement_with_memory_ops *> (g);
2248 15658498152 : if (!mem_ops_stmt)
2249 : return NULL_TREE;
2250 15627149515 : return mem_ops_stmt->vdef;
2251 : }
2252 :
2253 : /* Return the single VUSE operand of the statement G. */
2254 :
2255 : inline tree *
2256 98078428 : gimple_vuse_ptr (gimple *g)
2257 : {
2258 98078428 : gimple_statement_with_memory_ops *mem_ops_stmt =
2259 98078428 : dyn_cast <gimple_statement_with_memory_ops *> (g);
2260 98078428 : if (!mem_ops_stmt)
2261 : return NULL;
2262 98078428 : return &mem_ops_stmt->vuse;
2263 : }
2264 :
2265 : /* Return the single VDEF operand of the statement G. */
2266 :
2267 : inline tree *
2268 158523950 : gimple_vdef_ptr (gimple *g)
2269 : {
2270 158523950 : gimple_statement_with_memory_ops *mem_ops_stmt =
2271 1551212442 : dyn_cast <gimple_statement_with_memory_ops *> (g);
2272 158523950 : if (!mem_ops_stmt)
2273 : return NULL;
2274 158523950 : return &mem_ops_stmt->vdef;
2275 : }
2276 :
2277 : /* Set the single VUSE operand of the statement G. */
2278 :
2279 : inline void
2280 206777784 : gimple_set_vuse (gimple *g, tree vuse)
2281 : {
2282 206777784 : gimple_statement_with_memory_ops *mem_ops_stmt =
2283 206843009 : as_a <gimple_statement_with_memory_ops *> (g);
2284 206777784 : mem_ops_stmt->vuse = vuse;
2285 121423229 : }
2286 :
2287 : /* Set the single VDEF operand of the statement G. */
2288 :
2289 : inline void
2290 101149522 : gimple_set_vdef (gimple *g, tree vdef)
2291 : {
2292 101149522 : gimple_statement_with_memory_ops *mem_ops_stmt =
2293 101214747 : as_a <gimple_statement_with_memory_ops *> (g);
2294 101149522 : mem_ops_stmt->vdef = vdef;
2295 41160757 : }
2296 :
2297 :
2298 : /* Return true if statement G has operands and the modified field has
2299 : been set. */
2300 :
2301 : inline bool
2302 14773751045 : gimple_modified_p (const gimple *g)
2303 : {
2304 29531718762 : return (gimple_has_ops (g)) ? (bool) g->modified : false;
2305 : }
2306 :
2307 :
2308 : /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
2309 : a MODIFIED field. */
2310 :
2311 : inline void
2312 824103397 : gimple_set_modified (gimple *s, bool modifiedp)
2313 : {
2314 824103397 : if (gimple_has_ops (s))
2315 : {
2316 819445714 : s->modified = (unsigned) modifiedp;
2317 : // Mark the LHS as out of date with the current range query.
2318 819445714 : if (modifiedp)
2319 : {
2320 424667946 : tree def = gimple_get_lhs (s);
2321 424667946 : if (def && TREE_CODE (def) == SSA_NAME)
2322 241640566 : get_range_query (cfun)->update_range_info (def);
2323 : }
2324 : }
2325 824103397 : }
2326 :
2327 :
2328 : /* Return true if statement STMT contains volatile operands. */
2329 :
2330 : inline bool
2331 23957651208 : gimple_has_volatile_ops (const gimple *stmt)
2332 : {
2333 34495374141 : if (gimple_has_mem_ops (stmt))
2334 10544410745 : return stmt->has_volatile_ops;
2335 : else
2336 : return false;
2337 : }
2338 :
2339 :
2340 : /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
2341 :
2342 : inline void
2343 11555156290 : gimple_set_has_volatile_ops (gimple *stmt, bool volatilep)
2344 : {
2345 21652398584 : if (gimple_has_mem_ops (stmt))
2346 4881641847 : stmt->has_volatile_ops = (unsigned) volatilep;
2347 : }
2348 :
2349 : /* Return true if STMT is in a transaction. */
2350 :
2351 : inline bool
2352 434 : gimple_in_transaction (const gimple *stmt)
2353 : {
2354 434 : return bb_in_transaction (gimple_bb (stmt));
2355 : }
2356 :
2357 : /* Return true if statement STMT may access memory. */
2358 :
2359 : inline bool
2360 110752076 : gimple_references_memory_p (gimple *stmt)
2361 : {
2362 190652702 : return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
2363 : }
2364 :
2365 :
2366 : /* Return the subcode for OMP statement S. */
2367 :
2368 : inline unsigned
2369 3394392 : gimple_omp_subcode (const gimple *s)
2370 : {
2371 3394392 : gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
2372 : && gimple_code (s) <= GIMPLE_OMP_ORDERED);
2373 3394392 : return s->subcode;
2374 : }
2375 :
2376 : /* Set the subcode for OMP statement S to SUBCODE. */
2377 :
2378 : inline void
2379 12536 : gimple_omp_set_subcode (gimple *s, unsigned int subcode)
2380 : {
2381 : /* We only have 16 bits for the subcode. Assert that we are not
2382 : overflowing it. */
2383 12536 : gcc_gimple_checking_assert (subcode < (1 << 16));
2384 12536 : s->subcode = subcode;
2385 12536 : }
2386 :
2387 : /* Set the nowait flag on OMP_RETURN statement S. */
2388 :
2389 : inline void
2390 38195 : gimple_omp_return_set_nowait (gimple *s)
2391 : {
2392 38195 : GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
2393 38195 : s->subcode |= GF_OMP_RETURN_NOWAIT;
2394 38195 : }
2395 :
2396 :
2397 : /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
2398 : flag set. */
2399 :
2400 : inline bool
2401 84062 : gimple_omp_return_nowait_p (const gimple *g)
2402 : {
2403 84062 : GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
2404 84062 : return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
2405 : }
2406 :
2407 :
2408 : /* Set the LHS of OMP return. */
2409 :
2410 : inline void
2411 64 : gimple_omp_return_set_lhs (gimple *g, tree lhs)
2412 : {
2413 64 : gimple_statement_omp_return *omp_return_stmt =
2414 64 : as_a <gimple_statement_omp_return *> (g);
2415 64 : omp_return_stmt->val = lhs;
2416 : }
2417 :
2418 :
2419 : /* Get the LHS of OMP return. */
2420 :
2421 : inline tree
2422 10029 : gimple_omp_return_lhs (const gimple *g)
2423 : {
2424 10029 : const gimple_statement_omp_return *omp_return_stmt =
2425 10029 : as_a <const gimple_statement_omp_return *> (g);
2426 10029 : return omp_return_stmt->val;
2427 : }
2428 :
2429 :
2430 : /* Return a pointer to the LHS of OMP return. */
2431 :
2432 : inline tree *
2433 401864 : gimple_omp_return_lhs_ptr (gimple *g)
2434 : {
2435 401864 : gimple_statement_omp_return *omp_return_stmt =
2436 401864 : as_a <gimple_statement_omp_return *> (g);
2437 401864 : return &omp_return_stmt->val;
2438 : }
2439 :
2440 :
2441 : /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
2442 : flag set. */
2443 :
2444 : inline bool
2445 0 : gimple_omp_section_last_p (const gimple *g)
2446 : {
2447 0 : GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2448 0 : return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
2449 : }
2450 :
2451 :
2452 : /* Set the GF_OMP_SECTION_LAST flag on G. */
2453 :
2454 : inline void
2455 378 : gimple_omp_section_set_last (gimple *g)
2456 : {
2457 378 : GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
2458 378 : g->subcode |= GF_OMP_SECTION_LAST;
2459 378 : }
2460 :
2461 :
2462 : /* Return true if OMP ordered construct is stand-alone
2463 : (G has the GF_OMP_ORDERED_STANDALONE flag set). */
2464 :
2465 : inline bool
2466 5872 : gimple_omp_ordered_standalone_p (const gimple *g)
2467 : {
2468 5872 : GIMPLE_CHECK (g, GIMPLE_OMP_ORDERED);
2469 5872 : return (gimple_omp_subcode (g) & GF_OMP_ORDERED_STANDALONE) != 0;
2470 : }
2471 :
2472 :
2473 : /* Set the GF_OMP_ORDERED_STANDALONE flag on G. */
2474 :
2475 : inline void
2476 1025 : gimple_omp_ordered_standalone (gimple *g)
2477 : {
2478 1025 : GIMPLE_CHECK (g, GIMPLE_OMP_ORDERED);
2479 1025 : g->subcode |= GF_OMP_ORDERED_STANDALONE;
2480 1025 : }
2481 :
2482 :
2483 : /* Return true if OMP parallel statement G has the
2484 : GF_OMP_PARALLEL_COMBINED flag set. */
2485 :
2486 : inline bool
2487 35474 : gimple_omp_parallel_combined_p (const gimple *g)
2488 : {
2489 35474 : GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2490 35474 : return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
2491 : }
2492 :
2493 :
2494 : /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
2495 : value of COMBINED_P. */
2496 :
2497 : inline void
2498 377 : gimple_omp_parallel_set_combined_p (gimple *g, bool combined_p)
2499 : {
2500 377 : GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
2501 377 : if (combined_p)
2502 377 : g->subcode |= GF_OMP_PARALLEL_COMBINED;
2503 : else
2504 0 : g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
2505 377 : }
2506 :
2507 :
2508 : /* Return true if OMP atomic load/store statement G has the
2509 : GF_OMP_ATOMIC_NEED_VALUE flag set. */
2510 :
2511 : inline bool
2512 12914 : gimple_omp_atomic_need_value_p (const gimple *g)
2513 : {
2514 12914 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2515 6029 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2516 12914 : return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
2517 : }
2518 :
2519 :
2520 : /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
2521 :
2522 : inline void
2523 2933 : gimple_omp_atomic_set_need_value (gimple *g)
2524 : {
2525 2933 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2526 868 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2527 2933 : g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
2528 2933 : }
2529 :
2530 :
2531 : /* Return true if OMP atomic load/store statement G has the
2532 : GF_OMP_ATOMIC_WEAK flag set. */
2533 :
2534 : inline bool
2535 1343 : gimple_omp_atomic_weak_p (const gimple *g)
2536 : {
2537 1343 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2538 526 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2539 1343 : return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_WEAK) != 0;
2540 : }
2541 :
2542 :
2543 : /* Set the GF_OMP_ATOMIC_WEAK flag on G. */
2544 :
2545 : inline void
2546 74 : gimple_omp_atomic_set_weak (gimple *g)
2547 : {
2548 74 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2549 37 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2550 74 : g->subcode |= GF_OMP_ATOMIC_WEAK;
2551 74 : }
2552 :
2553 :
2554 : /* Return the memory order of the OMP atomic load/store statement G. */
2555 :
2556 : inline enum omp_memory_order
2557 11097 : gimple_omp_atomic_memory_order (const gimple *g)
2558 : {
2559 11097 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2560 1382 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2561 11097 : return (enum omp_memory_order)
2562 11097 : (gimple_omp_subcode (g) & GF_OMP_ATOMIC_MEMORY_ORDER);
2563 : }
2564 :
2565 :
2566 : /* Set the memory order on G. */
2567 :
2568 : inline void
2569 20608 : gimple_omp_atomic_set_memory_order (gimple *g, enum omp_memory_order mo)
2570 : {
2571 20608 : if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
2572 10304 : GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
2573 20608 : g->subcode = ((g->subcode & ~GF_OMP_ATOMIC_MEMORY_ORDER)
2574 20608 : | (int (mo) & GF_OMP_ATOMIC_MEMORY_ORDER));
2575 20608 : }
2576 :
2577 :
2578 : /* Return the number of operands for statement GS. */
2579 :
2580 : inline unsigned
2581 >18788*10^7 : gimple_num_ops (const gimple *gs)
2582 : {
2583 81334553011 : return gs->num_ops;
2584 : }
2585 :
2586 :
2587 : /* Set the number of operands for statement GS. */
2588 :
2589 : inline void
2590 320244232 : gimple_set_num_ops (gimple *gs, unsigned num_ops)
2591 : {
2592 7260932 : gs->num_ops = num_ops;
2593 : }
2594 :
2595 :
2596 : /* Return the array of operands for statement GS. */
2597 :
2598 : inline tree *
2599 86037089634 : gimple_ops (gimple *gs)
2600 : {
2601 86037089634 : size_t off;
2602 :
2603 : /* All the tuples have their operand vector at the very bottom
2604 : of the structure. Note that those structures that do not
2605 : have an operand vector have a zero offset. */
2606 86037089634 : off = gimple_ops_offset_[gimple_statement_structure (gs)];
2607 86037089634 : gcc_gimple_checking_assert (off != 0);
2608 :
2609 86037089634 : return (tree *) ((char *) gs + off);
2610 : }
2611 :
2612 :
2613 : /* Return operand I for statement GS. */
2614 :
2615 : inline tree
2616 21243169431 : gimple_op (const gimple *gs, unsigned i)
2617 : {
2618 21243169431 : if (gimple_has_ops (gs))
2619 : {
2620 21243169431 : gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2621 21243169431 : return gimple_ops (const_cast<gimple *> (gs))[i];
2622 : }
2623 : else
2624 : return NULL_TREE;
2625 : }
2626 :
2627 : /* Return a pointer to operand I for statement GS. */
2628 :
2629 : inline tree *
2630 64462723380 : gimple_op_ptr (gimple *gs, unsigned i)
2631 : {
2632 64462723380 : if (gimple_has_ops (gs))
2633 : {
2634 64462723380 : gcc_gimple_checking_assert (i < gimple_num_ops (gs));
2635 64462723380 : return gimple_ops (gs) + i;
2636 : }
2637 : else
2638 : return NULL;
2639 : }
2640 :
2641 : /* Set operand I of statement GS to OP. */
2642 :
2643 : inline void
2644 331196823 : gimple_set_op (gimple *gs, unsigned i, tree op)
2645 : {
2646 662393646 : gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
2647 :
2648 : /* Note. It may be tempting to assert that OP matches
2649 : is_gimple_operand, but that would be wrong. Different tuples
2650 : accept slightly different sets of tree operands. Each caller
2651 : should perform its own validation. */
2652 331196823 : gimple_ops (gs)[i] = op;
2653 331196823 : }
2654 :
2655 : /* Return true if GS is a GIMPLE_ASSIGN. */
2656 :
2657 : inline bool
2658 22614471706 : is_gimple_assign (const gimple *gs)
2659 : {
2660 14386059069 : return gimple_code (gs) == GIMPLE_ASSIGN;
2661 : }
2662 :
2663 : /* Determine if expression CODE is one of the valid expressions that can
2664 : be used on the RHS of GIMPLE assignments. */
2665 :
2666 : inline enum gimple_rhs_class
2667 77376136948 : get_gimple_rhs_class (enum tree_code code)
2668 : {
2669 70394962930 : return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
2670 : }
2671 :
2672 : /* Return the LHS of assignment statement GS. */
2673 :
2674 : inline tree
2675 25637617657 : gimple_assign_lhs (const gassign *gs)
2676 : {
2677 20473909398 : return gs->op[0];
2678 : }
2679 :
2680 : inline tree
2681 18823887485 : gimple_assign_lhs (const gimple *gs)
2682 : {
2683 18823887485 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2684 18823887485 : return gimple_assign_lhs (ass);
2685 : }
2686 :
2687 :
2688 : /* Return a pointer to the LHS of assignment statement GS. */
2689 :
2690 : inline tree *
2691 183905878 : gimple_assign_lhs_ptr (gassign *gs)
2692 : {
2693 183905878 : return &gs->op[0];
2694 : }
2695 :
2696 : inline tree *
2697 183905878 : gimple_assign_lhs_ptr (gimple *gs)
2698 : {
2699 183905878 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2700 183905878 : return gimple_assign_lhs_ptr (ass);
2701 : }
2702 :
2703 :
2704 : /* Set LHS to be the LHS operand of assignment statement GS. */
2705 :
2706 : inline void
2707 98011831 : gimple_assign_set_lhs (gassign *gs, tree lhs)
2708 : {
2709 98011831 : gs->op[0] = lhs;
2710 :
2711 98011831 : if (lhs && TREE_CODE (lhs) == SSA_NAME)
2712 45933817 : SSA_NAME_DEF_STMT (lhs) = gs;
2713 : }
2714 :
2715 : inline void
2716 3925027 : gimple_assign_set_lhs (gimple *gs, tree lhs)
2717 : {
2718 3925027 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2719 3925027 : gimple_assign_set_lhs (ass, lhs);
2720 3925027 : }
2721 :
2722 :
2723 : /* Return the first operand on the RHS of assignment statement GS. */
2724 :
2725 : inline tree
2726 26097243806 : gimple_assign_rhs1 (const gassign *gs)
2727 : {
2728 23142960745 : return gs->op[1];
2729 : }
2730 :
2731 : inline tree
2732 20740993686 : gimple_assign_rhs1 (const gimple *gs)
2733 : {
2734 20740993686 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2735 20740993686 : return gimple_assign_rhs1 (ass);
2736 : }
2737 :
2738 :
2739 : /* Return a pointer to the first operand on the RHS of assignment
2740 : statement GS. */
2741 :
2742 : inline tree *
2743 198972861 : gimple_assign_rhs1_ptr (gassign *gs)
2744 : {
2745 198972861 : return &gs->op[1];
2746 : }
2747 :
2748 : inline tree *
2749 198674700 : gimple_assign_rhs1_ptr (gimple *gs)
2750 : {
2751 198674700 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2752 198674700 : return gimple_assign_rhs1_ptr (ass);
2753 : }
2754 :
2755 : /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2756 :
2757 : inline void
2758 104218510 : gimple_assign_set_rhs1 (gassign *gs, tree rhs)
2759 : {
2760 94282582 : gs->op[1] = rhs;
2761 130 : }
2762 :
2763 : inline void
2764 10179569 : gimple_assign_set_rhs1 (gimple *gs, tree rhs)
2765 : {
2766 10179569 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2767 10179569 : gimple_assign_set_rhs1 (ass, rhs);
2768 10179569 : }
2769 :
2770 :
2771 : /* Return the second operand on the RHS of assignment statement GS.
2772 : If GS does not have two operands, NULL is returned instead. */
2773 :
2774 : inline tree
2775 4406721518 : gimple_assign_rhs2 (const gassign *gs)
2776 : {
2777 3639674298 : if (gimple_num_ops (gs) >= 3)
2778 2886048523 : return gs->op[2];
2779 : else
2780 : return NULL_TREE;
2781 : }
2782 :
2783 : inline tree
2784 1544630650 : gimple_assign_rhs2 (const gimple *gs)
2785 : {
2786 1544630650 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2787 1544630650 : return gimple_assign_rhs2 (ass);
2788 : }
2789 :
2790 :
2791 : /* Return a pointer to the second operand on the RHS of assignment
2792 : statement GS. */
2793 :
2794 : inline tree *
2795 668946 : gimple_assign_rhs2_ptr (gassign *gs)
2796 : {
2797 668946 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2798 668946 : return &gs->op[2];
2799 : }
2800 :
2801 : inline tree *
2802 668383 : gimple_assign_rhs2_ptr (gimple *gs)
2803 : {
2804 668383 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2805 668383 : return gimple_assign_rhs2_ptr (ass);
2806 : }
2807 :
2808 :
2809 : /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2810 :
2811 : inline void
2812 20349371 : gimple_assign_set_rhs2 (gassign *gs, tree rhs)
2813 : {
2814 20349371 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
2815 20349371 : gs->op[2] = rhs;
2816 20349371 : }
2817 :
2818 : inline void
2819 3967230 : gimple_assign_set_rhs2 (gimple *gs, tree rhs)
2820 : {
2821 3967230 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2822 3967230 : return gimple_assign_set_rhs2 (ass, rhs);
2823 : }
2824 :
2825 : /* Return the third operand on the RHS of assignment statement GS.
2826 : If GS does not have two operands, NULL is returned instead. */
2827 :
2828 : inline tree
2829 20049717 : gimple_assign_rhs3 (const gassign *gs)
2830 : {
2831 14887155 : if (gimple_num_ops (gs) >= 4)
2832 15129733 : return gs->op[3];
2833 : else
2834 : return NULL_TREE;
2835 : }
2836 :
2837 : inline tree
2838 7944604 : gimple_assign_rhs3 (const gimple *gs)
2839 : {
2840 7944604 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2841 7944604 : return gimple_assign_rhs3 (ass);
2842 : }
2843 :
2844 : /* Return a pointer to the third operand on the RHS of assignment
2845 : statement GS. */
2846 :
2847 : inline tree *
2848 560 : gimple_assign_rhs3_ptr (gimple *gs)
2849 : {
2850 560 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2851 560 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2852 560 : return &ass->op[3];
2853 : }
2854 :
2855 :
2856 : /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2857 :
2858 : inline void
2859 507406 : gimple_assign_set_rhs3 (gassign *gs, tree rhs)
2860 : {
2861 507406 : gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
2862 507406 : gs->op[3] = rhs;
2863 507406 : }
2864 :
2865 : inline void
2866 35228 : gimple_assign_set_rhs3 (gimple *gs, tree rhs)
2867 : {
2868 35228 : gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
2869 35228 : gimple_assign_set_rhs3 (ass, rhs);
2870 35228 : }
2871 :
2872 :
2873 : /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2874 : which expect to see only two operands. */
2875 :
2876 : inline void
2877 323525 : gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2878 : tree op1, tree op2)
2879 : {
2880 323525 : gimple_assign_set_rhs_with_ops (gsi, code, op1, op2, NULL);
2881 1348 : }
2882 :
2883 : /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
2884 : which expect to see only one operands. */
2885 :
2886 : inline void
2887 64806 : gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2888 : tree op1)
2889 : {
2890 64806 : gimple_assign_set_rhs_with_ops (gsi, code, op1, NULL, NULL);
2891 53216 : }
2892 :
2893 : /* Returns true if GS is a nontemporal move. */
2894 :
2895 : inline bool
2896 4520036335 : gimple_assign_nontemporal_move_p (const gassign *gs)
2897 : {
2898 4520036335 : return gs->nontemporal_move;
2899 : }
2900 :
2901 : /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2902 :
2903 : inline void
2904 2 : gimple_assign_set_nontemporal_move (gimple *gs, bool nontemporal)
2905 : {
2906 2 : GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2907 2 : gs->nontemporal_move = nontemporal;
2908 2 : }
2909 :
2910 :
2911 : /* Return the code of the expression computed on the rhs of assignment
2912 : statement GS. In case that the RHS is a single object, returns the
2913 : tree code of the object. */
2914 :
2915 : inline enum tree_code
2916 46292799136 : gimple_assign_rhs_code (const gassign *gs)
2917 : {
2918 46354653785 : enum tree_code code = (enum tree_code) gs->subcode;
2919 : /* While we initially set subcode to the TREE_CODE of the rhs for
2920 : GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2921 : in sync when we rewrite stmts into SSA form or do SSA propagations. */
2922 36271836952 : if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2923 28715235848 : code = TREE_CODE (gs->op[1]);
2924 :
2925 36178569774 : return code;
2926 : }
2927 :
2928 : inline enum tree_code
2929 34156461005 : gimple_assign_rhs_code (const gimple *gs)
2930 : {
2931 34156461005 : const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
2932 34156461005 : return gimple_assign_rhs_code (ass);
2933 : }
2934 :
2935 :
2936 : /* Set CODE to be the code for the expression computed on the RHS of
2937 : assignment S. */
2938 :
2939 : inline void
2940 2118926 : gimple_assign_set_rhs_code (gimple *s, enum tree_code code)
2941 : {
2942 2118926 : GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2943 2118926 : s->subcode = code;
2944 2118926 : }
2945 :
2946 :
2947 : /* Return the gimple rhs class of the code of the expression computed on
2948 : the rhs of assignment statement GS.
2949 : This will never return GIMPLE_INVALID_RHS. */
2950 :
2951 : inline enum gimple_rhs_class
2952 28670243684 : gimple_assign_rhs_class (const gimple *gs)
2953 : {
2954 28662438138 : return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2955 : }
2956 :
2957 : /* Return true if GS is an assignment with a singleton RHS, i.e.,
2958 : there is no operator associated with the assignment itself.
2959 : Unlike gimple_assign_copy_p, this predicate returns true for
2960 : any RHS operand, including those that perform an operation
2961 : and do not have the semantics of a copy, such as COND_EXPR. */
2962 :
2963 : inline bool
2964 16278602819 : gimple_assign_single_p (const gimple *gs)
2965 : {
2966 16278602819 : return (is_gimple_assign (gs)
2967 28240079304 : && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2968 : }
2969 :
2970 : /* Return true if GS performs a store to its lhs. */
2971 :
2972 : inline bool
2973 1265739884 : gimple_store_p (const gimple *gs)
2974 : {
2975 1265739884 : tree lhs = gimple_get_lhs (gs);
2976 1265739884 : return lhs && !is_gimple_reg (lhs);
2977 : }
2978 :
2979 : /* Return true if S is a type-cast assignment. */
2980 :
2981 : inline bool
2982 25543724 : gimple_assign_cast_p (const gimple *s)
2983 : {
2984 25543724 : if (is_gimple_assign (s))
2985 : {
2986 13940289 : enum tree_code sc = gimple_assign_rhs_code (s);
2987 13940289 : return CONVERT_EXPR_CODE_P (sc)
2988 11756155 : || sc == VIEW_CONVERT_EXPR
2989 13940289 : || sc == FIX_TRUNC_EXPR;
2990 : }
2991 :
2992 : return false;
2993 : }
2994 :
2995 : /* Return true if S is a clobber statement. */
2996 :
2997 : inline bool
2998 8088421342 : gimple_clobber_p (const gimple *s)
2999 : {
3000 8088421342 : return gimple_assign_single_p (s)
3001 8088421342 : && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
3002 : }
3003 :
3004 : /* Return true if S is a clobber statement. */
3005 :
3006 : inline bool
3007 89715813 : gimple_clobber_p (const gimple *s, enum clobber_kind kind)
3008 : {
3009 89715813 : return gimple_clobber_p (s)
3010 89715813 : && CLOBBER_KIND (gimple_assign_rhs1 (s)) == kind;
3011 : }
3012 :
3013 : /* Return true if GS is a GIMPLE_CALL. */
3014 :
3015 : inline bool
3016 15880658351 : is_gimple_call (const gimple *gs)
3017 : {
3018 20539235646 : return gimple_code (gs) == GIMPLE_CALL;
3019 : }
3020 :
3021 : /* Return the LHS of call statement GS. */
3022 :
3023 : inline tree
3024 5794969394 : gimple_call_lhs (const gcall *gs)
3025 : {
3026 1687897995 : return gs->op[0];
3027 : }
3028 :
3029 : inline tree
3030 4264850575 : gimple_call_lhs (const gimple *gs)
3031 : {
3032 4264850575 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3033 4264850575 : return gimple_call_lhs (gc);
3034 : }
3035 :
3036 :
3037 : /* Return a pointer to the LHS of call statement GS. */
3038 :
3039 : inline tree *
3040 852807058 : gimple_call_lhs_ptr (gcall *gs)
3041 : {
3042 852807058 : return &gs->op[0];
3043 : }
3044 :
3045 : inline tree *
3046 795331210 : gimple_call_lhs_ptr (gimple *gs)
3047 : {
3048 795331210 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3049 795331210 : return gimple_call_lhs_ptr (gc);
3050 : }
3051 :
3052 :
3053 : /* Set LHS to be the LHS operand of call statement GS. */
3054 :
3055 : inline void
3056 6700154 : gimple_call_set_lhs (gcall *gs, tree lhs)
3057 : {
3058 6700154 : gs->op[0] = lhs;
3059 6622736 : if (lhs && TREE_CODE (lhs) == SSA_NAME)
3060 2872730 : SSA_NAME_DEF_STMT (lhs) = gs;
3061 3 : }
3062 :
3063 : inline void
3064 1416305 : gimple_call_set_lhs (gimple *gs, tree lhs)
3065 : {
3066 1416305 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3067 1416305 : gimple_call_set_lhs (gc, lhs);
3068 1416305 : }
3069 :
3070 :
3071 : /* Return true if call GS calls an internal-only function, as enumerated
3072 : by internal_fn. */
3073 :
3074 : inline bool
3075 13552981239 : gimple_call_internal_p (const gcall *gs)
3076 : {
3077 3927244181 : return (gs->subcode & GF_CALL_INTERNAL) != 0;
3078 : }
3079 :
3080 : inline bool
3081 5922151308 : gimple_call_internal_p (const gimple *gs)
3082 : {
3083 5922151308 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3084 5922151308 : return gimple_call_internal_p (gc);
3085 : }
3086 :
3087 : /* Return true if call GS is marked as nocf_check. */
3088 :
3089 : inline bool
3090 8309030 : gimple_call_nocf_check_p (const gcall *gs)
3091 : {
3092 8309030 : return (gs->subcode & GF_CALL_NOCF_CHECK) != 0;
3093 : }
3094 :
3095 : /* Mark statement GS as nocf_check call. */
3096 :
3097 : inline void
3098 21 : gimple_call_set_nocf_check (gcall *gs, bool nocf_check)
3099 : {
3100 21 : if (nocf_check)
3101 21 : gs->subcode |= GF_CALL_NOCF_CHECK;
3102 : else
3103 : gs->subcode &= ~GF_CALL_NOCF_CHECK;
3104 21 : }
3105 :
3106 : /* Return the target of internal call GS. */
3107 :
3108 : inline enum internal_fn
3109 198646517 : gimple_call_internal_fn (const gcall *gs)
3110 : {
3111 198646517 : gcc_gimple_checking_assert (gimple_call_internal_p (gs));
3112 198646517 : return gs->u.internal_fn;
3113 : }
3114 :
3115 : inline enum internal_fn
3116 173307697 : gimple_call_internal_fn (const gimple *gs)
3117 : {
3118 173307697 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3119 173307697 : return gimple_call_internal_fn (gc);
3120 : }
3121 :
3122 : /* Return true, if this internal gimple call is unique. */
3123 :
3124 : inline bool
3125 1020559 : gimple_call_internal_unique_p (const gcall *gs)
3126 : {
3127 2036020 : return gimple_call_internal_fn (gs) == IFN_UNIQUE;
3128 : }
3129 :
3130 : inline bool
3131 1015461 : gimple_call_internal_unique_p (const gimple *gs)
3132 : {
3133 1015461 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3134 1015461 : return gimple_call_internal_unique_p (gc);
3135 : }
3136 :
3137 : /* Return true if GS is an internal function FN. */
3138 :
3139 : inline bool
3140 3236422335 : gimple_call_internal_p (const gimple *gs, internal_fn fn)
3141 : {
3142 3236422335 : return (is_gimple_call (gs)
3143 1412616865 : && gimple_call_internal_p (gs)
3144 3289610351 : && gimple_call_internal_fn (gs) == fn);
3145 : }
3146 :
3147 : /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
3148 : that could alter control flow. */
3149 :
3150 : inline void
3151 33849983 : gimple_call_set_ctrl_altering (gcall *s, bool ctrl_altering_p)
3152 : {
3153 33849983 : if (ctrl_altering_p)
3154 24631176 : s->subcode |= GF_CALL_CTRL_ALTERING;
3155 : else
3156 9218807 : s->subcode &= ~GF_CALL_CTRL_ALTERING;
3157 : }
3158 :
3159 : inline void
3160 33595631 : gimple_call_set_ctrl_altering (gimple *s, bool ctrl_altering_p)
3161 : {
3162 33595631 : gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3163 33595631 : gimple_call_set_ctrl_altering (gc, ctrl_altering_p);
3164 33595631 : }
3165 :
3166 : /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
3167 : flag is set. Such call could not be a stmt in the middle of a bb. */
3168 :
3169 : inline bool
3170 2306421855 : gimple_call_ctrl_altering_p (const gcall *gs)
3171 : {
3172 1226326862 : return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
3173 : }
3174 :
3175 : inline bool
3176 1153917912 : gimple_call_ctrl_altering_p (const gimple *gs)
3177 : {
3178 1153917912 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3179 1153917912 : return gimple_call_ctrl_altering_p (gc);
3180 : }
3181 :
3182 :
3183 : /* Return the function type of the function called by GS. */
3184 :
3185 : inline tree
3186 5668663945 : gimple_call_fntype (const gcall *gs)
3187 : {
3188 1190194484 : if (gimple_call_internal_p (gs))
3189 : return NULL_TREE;
3190 5613459645 : return gs->u.fntype;
3191 : }
3192 :
3193 : inline tree
3194 4124129936 : gimple_call_fntype (const gimple *gs)
3195 : {
3196 4124129936 : const gcall *call_stmt = GIMPLE_CHECK2<const gcall *> (gs);
3197 4124129936 : return gimple_call_fntype (call_stmt);
3198 : }
3199 :
3200 : /* Set the type of the function called by CALL_STMT to FNTYPE. */
3201 :
3202 : inline void
3203 23338198 : gimple_call_set_fntype (gcall *call_stmt, tree fntype)
3204 : {
3205 23338198 : gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt));
3206 23338198 : call_stmt->u.fntype = fntype;
3207 23338198 : }
3208 :
3209 :
3210 : /* Return the tree node representing the function called by call
3211 : statement GS. */
3212 :
3213 : inline tree
3214 10037950328 : gimple_call_fn (const gcall *gs)
3215 : {
3216 2242103753 : return gs->op[1];
3217 : }
3218 :
3219 : inline tree
3220 87028201 : gimple_call_fn (const gimple *gs)
3221 : {
3222 87028201 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3223 87028201 : return gimple_call_fn (gc);
3224 : }
3225 :
3226 : /* Return a pointer to the tree node representing the function called by call
3227 : statement GS. */
3228 :
3229 : inline tree *
3230 2003662668 : gimple_call_fn_ptr (gcall *gs)
3231 : {
3232 2003662668 : return &gs->op[1];
3233 : }
3234 :
3235 : inline tree *
3236 2003662668 : gimple_call_fn_ptr (gimple *gs)
3237 : {
3238 2003662668 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3239 2003662668 : return gimple_call_fn_ptr (gc);
3240 : }
3241 :
3242 :
3243 : /* Set FN to be the function called by call statement GS. */
3244 :
3245 : inline void
3246 3707 : gimple_call_set_fn (gcall *gs, tree fn)
3247 : {
3248 3707 : gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3249 3707 : gs->op[1] = fn;
3250 3707 : }
3251 :
3252 :
3253 : /* Set FNDECL to be the function called by call statement GS. */
3254 :
3255 : inline void
3256 647539 : gimple_call_set_fndecl (gcall *gs, tree decl)
3257 : {
3258 647539 : gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
3259 647539 : gs->op[1] = build1_loc (gimple_location (gs), ADDR_EXPR,
3260 647539 : build_pointer_type (TREE_TYPE (decl)), decl);
3261 647539 : }
3262 :
3263 : inline void
3264 36169 : gimple_call_set_fndecl (gimple *gs, tree decl)
3265 : {
3266 36169 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3267 36169 : gimple_call_set_fndecl (gc, decl);
3268 36169 : }
3269 :
3270 :
3271 : /* Set internal function FN to be the function called by call statement CALL_STMT. */
3272 :
3273 : inline void
3274 831154 : gimple_call_set_internal_fn (gcall *call_stmt, enum internal_fn fn)
3275 : {
3276 831154 : gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt));
3277 831154 : call_stmt->u.internal_fn = fn;
3278 831154 : }
3279 :
3280 :
3281 : /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
3282 : Otherwise return NULL. This function is analogous to
3283 : get_callee_fndecl in tree land. */
3284 :
3285 : inline tree
3286 8768035794 : gimple_call_fndecl (const gcall *gs)
3287 : {
3288 2591953502 : return gimple_call_addr_fndecl (gimple_call_fn (gs));
3289 : }
3290 :
3291 : inline tree
3292 6440740079 : gimple_call_fndecl (const gimple *gs)
3293 : {
3294 6440740079 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3295 6440740079 : return gimple_call_fndecl (gc);
3296 : }
3297 :
3298 :
3299 : /* Return the type returned by call statement GS. */
3300 :
3301 : inline tree
3302 12614236 : gimple_call_return_type (const gcall *gs)
3303 : {
3304 12614236 : tree type = gimple_call_fntype (gs);
3305 :
3306 12612470 : if (type == NULL_TREE)
3307 1766 : return TREE_TYPE (gimple_call_lhs (gs));
3308 :
3309 : /* The type returned by a function is the type of its
3310 : function type. */
3311 12612470 : return TREE_TYPE (type);
3312 : }
3313 :
3314 :
3315 : /* Return the static chain for call statement GS. */
3316 :
3317 : inline tree
3318 2362303972 : gimple_call_chain (const gcall *gs)
3319 : {
3320 1303928962 : return gs->op[2];
3321 : }
3322 :
3323 : inline tree
3324 16812018 : gimple_call_chain (const gimple *gs)
3325 : {
3326 16812018 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3327 16812018 : return gimple_call_chain (gc);
3328 : }
3329 :
3330 :
3331 : /* Return a pointer to the static chain for call statement CALL_STMT. */
3332 :
3333 : inline tree *
3334 2003692024 : gimple_call_chain_ptr (gcall *call_stmt)
3335 : {
3336 2003692024 : return &call_stmt->op[2];
3337 : }
3338 :
3339 : /* Set CHAIN to be the static chain for call statement CALL_STMT. */
3340 :
3341 : inline void
3342 11079278 : gimple_call_set_chain (gcall *call_stmt, tree chain)
3343 : {
3344 11079278 : call_stmt->op[2] = chain;
3345 0 : }
3346 :
3347 :
3348 : /* Return the number of arguments used by call statement GS. */
3349 :
3350 : inline unsigned
3351 11605614528 : gimple_call_num_args (const gcall *gs)
3352 : {
3353 4841971398 : return gimple_num_ops (gs) - 3;
3354 : }
3355 :
3356 : inline unsigned
3357 7085221515 : gimple_call_num_args (const gimple *gs)
3358 : {
3359 7085221515 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3360 7085221515 : return gimple_call_num_args (gc);
3361 : }
3362 :
3363 :
3364 : /* Return the argument at position INDEX for call statement GS. */
3365 :
3366 : inline tree
3367 8201760833 : gimple_call_arg (const gcall *gs, unsigned index)
3368 : {
3369 8196146676 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3370 5663761112 : return gs->op[index + 3];
3371 : }
3372 :
3373 : inline tree
3374 5223285201 : gimple_call_arg (const gimple *gs, unsigned index)
3375 : {
3376 5223285201 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
3377 5223285201 : return gimple_call_arg (gc, index);
3378 : }
3379 :
3380 :
3381 : /* Return a pointer to the argument at position INDEX for call
3382 : statement GS. */
3383 :
3384 : inline tree *
3385 4116371830 : gimple_call_arg_ptr (gcall *gs, unsigned index)
3386 : {
3387 4116371830 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3388 4116359353 : return &gs->op[index + 3];
3389 : }
3390 :
3391 : inline tree *
3392 3988792584 : gimple_call_arg_ptr (gimple *gs, unsigned index)
3393 : {
3394 3988792584 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3395 3988792584 : return gimple_call_arg_ptr (gc, index);
3396 : }
3397 :
3398 :
3399 : /* Set ARG to be the argument at position INDEX for call statement GS. */
3400 :
3401 : inline void
3402 24134762 : gimple_call_set_arg (gcall *gs, unsigned index, tree arg)
3403 : {
3404 24064374 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
3405 23970533 : gs->op[index + 3] = arg;
3406 24098106 : }
3407 :
3408 : inline void
3409 535292 : gimple_call_set_arg (gimple *gs, unsigned index, tree arg)
3410 : {
3411 535292 : gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
3412 535292 : gimple_call_set_arg (gc, index, arg);
3413 535292 : }
3414 :
3415 :
3416 : /* If TAIL_P is true, mark call statement S as being a tail call
3417 : (i.e., a call just before the exit of a function). These calls are
3418 : candidate for tail call optimization. */
3419 :
3420 : inline void
3421 10659176 : gimple_call_set_tail (gcall *s, bool tail_p)
3422 : {
3423 10659176 : if (tail_p)
3424 197171 : s->subcode |= GF_CALL_TAILCALL;
3425 : else
3426 10462005 : s->subcode &= ~GF_CALL_TAILCALL;
3427 127 : }
3428 :
3429 :
3430 : /* Return true if GIMPLE_CALL S is marked as a tail call. */
3431 :
3432 : inline bool
3433 24134502 : gimple_call_tail_p (const gcall *s)
3434 : {
3435 24134502 : return (s->subcode & GF_CALL_TAILCALL) != 0;
3436 : }
3437 :
3438 : /* Mark (or clear) call statement S as requiring tail call optimization. */
3439 :
3440 : inline void
3441 10461161 : gimple_call_set_must_tail (gcall *s, bool must_tail_p)
3442 : {
3443 10461161 : if (must_tail_p)
3444 859 : s->subcode |= GF_CALL_MUST_TAIL_CALL;
3445 : else
3446 10460302 : s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
3447 18 : }
3448 :
3449 : /* Return true if call statement has been marked as requiring
3450 : tail call optimization. */
3451 :
3452 : inline bool
3453 71106610 : gimple_call_must_tail_p (const gcall *s)
3454 : {
3455 71106567 : return (s->subcode & GF_CALL_MUST_TAIL_CALL) != 0;
3456 : }
3457 :
3458 : /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
3459 : slot optimization. This transformation uses the target of the call
3460 : expansion as the return slot for calls that return in memory. */
3461 :
3462 : inline void
3463 10468927 : gimple_call_set_return_slot_opt (gcall *s, bool return_slot_opt_p)
3464 : {
3465 10468927 : if (return_slot_opt_p)
3466 316292 : s->subcode |= GF_CALL_RETURN_SLOT_OPT;
3467 : else
3468 10152635 : s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
3469 439 : }
3470 :
3471 :
3472 : /* Return true if S is marked for return slot optimization. */
3473 :
3474 : inline bool
3475 147275138 : gimple_call_return_slot_opt_p (const gcall *s)
3476 : {
3477 147275138 : return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
3478 : }
3479 :
3480 :
3481 : /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
3482 : thunk to the thunked-to function. */
3483 :
3484 : inline void
3485 10310921 : gimple_call_set_from_thunk (gcall *s, bool from_thunk_p)
3486 : {
3487 10310921 : if (from_thunk_p)
3488 20862 : s->subcode |= GF_CALL_FROM_THUNK;
3489 : else
3490 10290059 : s->subcode &= ~GF_CALL_FROM_THUNK;
3491 166 : }
3492 :
3493 :
3494 : /* Return true if GIMPLE_CALL S is a jump from a thunk. */
3495 :
3496 : inline bool
3497 34574663 : gimple_call_from_thunk_p (gcall *s)
3498 : {
3499 34574663 : return (s->subcode & GF_CALL_FROM_THUNK) != 0;
3500 : }
3501 :
3502 :
3503 : /* If FROM_NEW_OR_DELETE_P is true, mark GIMPLE_CALL S as being a call
3504 : to operator new or delete created from a new or delete expression. */
3505 :
3506 : inline void
3507 128398 : gimple_call_set_from_new_or_delete (gcall *s, bool from_new_or_delete_p)
3508 : {
3509 128398 : if (from_new_or_delete_p)
3510 105382 : s->subcode |= GF_CALL_FROM_NEW_OR_DELETE;
3511 : else
3512 23016 : s->subcode &= ~GF_CALL_FROM_NEW_OR_DELETE;
3513 : }
3514 :
3515 :
3516 : /* Return true if GIMPLE_CALL S is a call to operator new or delete from
3517 : from a new or delete expression. */
3518 :
3519 : inline bool
3520 118824781 : gimple_call_from_new_or_delete (const gcall *s)
3521 : {
3522 118824781 : return (s->subcode & GF_CALL_FROM_NEW_OR_DELETE) != 0;
3523 : }
3524 :
3525 :
3526 : /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
3527 : argument pack in its argument list. */
3528 :
3529 : inline void
3530 10461406 : gimple_call_set_va_arg_pack (gcall *s, bool pass_arg_pack_p)
3531 : {
3532 10461406 : if (pass_arg_pack_p)
3533 131 : s->subcode |= GF_CALL_VA_ARG_PACK;
3534 : else
3535 10461275 : s->subcode &= ~GF_CALL_VA_ARG_PACK;
3536 : }
3537 :
3538 :
3539 : /* Return true if GIMPLE_CALL S is a stdarg call that needs the
3540 : argument pack in its argument list. */
3541 :
3542 : inline bool
3543 17775337 : gimple_call_va_arg_pack_p (const gcall *s)
3544 : {
3545 17775337 : return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
3546 : }
3547 :
3548 :
3549 : /* Return true if S is a noreturn call. */
3550 :
3551 : inline bool
3552 352541007 : gimple_call_noreturn_p (const gcall *s)
3553 : {
3554 439870765 : return (gimple_call_flags (s) & ECF_NORETURN) != 0;
3555 : }
3556 :
3557 : inline bool
3558 198186580 : gimple_call_noreturn_p (const gimple *s)
3559 : {
3560 198186580 : const gcall *gc = GIMPLE_CHECK2<const gcall *> (s);
3561 198186580 : return gimple_call_noreturn_p (gc);
3562 : }
3563 :
3564 :
3565 : /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
3566 : even if the called function can throw in other cases. */
3567 :
3568 : inline void
3569 10832953 : gimple_call_set_nothrow (gcall *s, bool nothrow_p)
3570 : {
3571 10819311 : if (nothrow_p)
3572 2839358 : s->subcode |= GF_CALL_NOTHROW;
3573 : else
3574 7991307 : s->subcode &= ~GF_CALL_NOTHROW;
3575 278 : }
3576 :
3577 : /* Return true if S is a nothrow call. */
3578 :
3579 : inline bool
3580 1026922690 : gimple_call_nothrow_p (const gcall *s)
3581 : {
3582 1026922690 : return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
3583 : }
3584 :
3585 : /* If EXPECTED_THROW_P is true, GIMPLE_CALL S is a call that is known
3586 : to be more likely to throw than to run forever, terminate the
3587 : program or return by other means. */
3588 :
3589 : static inline void
3590 10299452 : gimple_call_set_expected_throw (gcall *s, bool expected_throw_p)
3591 : {
3592 10299452 : if (expected_throw_p)
3593 24696 : s->subcode |= GF_CALL_XTHROW;
3594 : else
3595 10274756 : s->subcode &= ~GF_CALL_XTHROW;
3596 : }
3597 :
3598 : /* Return true if S is a call that is more likely to end by
3599 : propagating an exception than by other means. */
3600 :
3601 : static inline bool
3602 323 : gimple_call_expected_throw_p (gcall *s)
3603 : {
3604 323 : return (gimple_call_flags (s) & ECF_XTHROW) != 0;
3605 : }
3606 :
3607 : /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
3608 : is known to be emitted for VLA objects. Those are wrapped by
3609 : stack_save/stack_restore calls and hence can't lead to unbounded
3610 : stack growth even when they occur in loops. */
3611 :
3612 : inline void
3613 42415 : gimple_call_set_alloca_for_var (gcall *s, bool for_var)
3614 : {
3615 42415 : if (for_var)
3616 10059 : s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
3617 : else
3618 32356 : s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
3619 : }
3620 :
3621 : /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
3622 :
3623 : inline bool
3624 338144 : gimple_call_alloca_for_var_p (gcall *s)
3625 : {
3626 338144 : return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3627 : }
3628 :
3629 : inline bool
3630 301411 : gimple_call_alloca_for_var_p (gimple *s)
3631 : {
3632 301411 : const gcall *gc = GIMPLE_CHECK2<gcall *> (s);
3633 301411 : return (gc->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
3634 : }
3635 :
3636 : /* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
3637 : pointers to nested function are descriptors instead of trampolines. */
3638 :
3639 : inline void
3640 10461099 : gimple_call_set_by_descriptor (gcall *s, bool by_descriptor_p)
3641 : {
3642 10461099 : if (by_descriptor_p)
3643 0 : s->subcode |= GF_CALL_BY_DESCRIPTOR;
3644 : else
3645 10461099 : s->subcode &= ~GF_CALL_BY_DESCRIPTOR;
3646 : }
3647 :
3648 : /* Return true if S is a by-descriptor call. */
3649 :
3650 : inline bool
3651 6596833 : gimple_call_by_descriptor_p (gcall *s)
3652 : {
3653 6596833 : return (s->subcode & GF_CALL_BY_DESCRIPTOR) != 0;
3654 : }
3655 :
3656 : /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
3657 :
3658 : inline void
3659 599992 : gimple_call_copy_flags (gcall *dest_call, gcall *orig_call)
3660 : {
3661 599992 : dest_call->subcode = orig_call->subcode;
3662 : }
3663 :
3664 :
3665 : /* Return a pointer to the points-to solution for the set of call-used
3666 : variables of the call CALL_STMT. */
3667 :
3668 : inline struct pt_solution *
3669 54090594 : gimple_call_use_set (gcall *call_stmt)
3670 : {
3671 54090594 : return &call_stmt->call_used;
3672 : }
3673 :
3674 : /* As above, but const. */
3675 :
3676 : inline const pt_solution *
3677 494 : gimple_call_use_set (const gcall *call_stmt)
3678 : {
3679 494 : return &call_stmt->call_used;
3680 : }
3681 :
3682 : /* Return a pointer to the points-to solution for the set of call-used
3683 : variables of the call CALL_STMT. */
3684 :
3685 : inline struct pt_solution *
3686 132912434 : gimple_call_clobber_set (gcall *call_stmt)
3687 : {
3688 132912434 : return &call_stmt->call_clobbered;
3689 : }
3690 :
3691 : /* As above, but const. */
3692 :
3693 : inline const pt_solution *
3694 494 : gimple_call_clobber_set (const gcall *call_stmt)
3695 : {
3696 494 : return &call_stmt->call_clobbered;
3697 : }
3698 :
3699 :
3700 : /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
3701 : non-NULL lhs. */
3702 :
3703 : inline bool
3704 606203455 : gimple_has_lhs (const gimple *stmt)
3705 : {
3706 605758057 : if (is_gimple_assign (stmt))
3707 : return true;
3708 1038808529 : if (const gcall *call = dyn_cast <const gcall *> (stmt))
3709 51103532 : return gimple_call_lhs (call) != NULL_TREE;
3710 : return false;
3711 : }
3712 :
3713 :
3714 : /* Return the code of the predicate computed by conditional statement GS. */
3715 :
3716 : inline enum tree_code
3717 3498655583 : gimple_cond_code (const gcond *gs)
3718 : {
3719 2287922726 : return (enum tree_code) gs->subcode;
3720 : }
3721 :
3722 : inline enum tree_code
3723 569643180 : gimple_cond_code (const gimple *gs)
3724 : {
3725 569643180 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3726 569643180 : return gimple_cond_code (gc);
3727 : }
3728 :
3729 :
3730 : /* Set CODE to be the predicate code for the conditional statement GS. */
3731 :
3732 : inline void
3733 15851908 : gimple_cond_set_code (gcond *gs, enum tree_code code)
3734 : {
3735 15851908 : gcc_gimple_checking_assert (TREE_CODE_CLASS (code) == tcc_comparison);
3736 15851908 : gs->subcode = code;
3737 15851908 : }
3738 :
3739 :
3740 : /* Return the LHS of the predicate computed by conditional statement GS. */
3741 :
3742 : inline tree
3743 3157115075 : gimple_cond_lhs (const gcond *gs)
3744 : {
3745 1872037088 : return gs->op[0];
3746 : }
3747 :
3748 : inline tree
3749 738952960 : gimple_cond_lhs (const gimple *gs)
3750 : {
3751 738952960 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3752 738952960 : return gimple_cond_lhs (gc);
3753 : }
3754 :
3755 : /* Return the pointer to the LHS of the predicate computed by conditional
3756 : statement GS. */
3757 :
3758 : inline tree *
3759 7283596 : gimple_cond_lhs_ptr (gcond *gs)
3760 : {
3761 7283596 : return &gs->op[0];
3762 : }
3763 :
3764 : /* Set LHS to be the LHS operand of the predicate computed by
3765 : conditional statement GS. */
3766 :
3767 : inline void
3768 29530325 : gimple_cond_set_lhs (gcond *gs, tree lhs)
3769 : {
3770 26177536 : gs->op[0] = lhs;
3771 : }
3772 :
3773 :
3774 : /* Return the RHS operand of the predicate computed by conditional GS. */
3775 :
3776 : inline tree
3777 2286819557 : gimple_cond_rhs (const gcond *gs)
3778 : {
3779 1759658015 : return gs->op[1];
3780 : }
3781 :
3782 : inline tree
3783 709453776 : gimple_cond_rhs (const gimple *gs)
3784 : {
3785 709453776 : const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
3786 709453776 : return gimple_cond_rhs (gc);
3787 : }
3788 :
3789 : /* Return the pointer to the RHS operand of the predicate computed by
3790 : conditional GS. */
3791 :
3792 : inline tree *
3793 7282990 : gimple_cond_rhs_ptr (gcond *gs)
3794 : {
3795 7282990 : return &gs->op[1];
3796 : }
3797 :
3798 :
3799 : /* Set RHS to be the RHS operand of the predicate computed by
3800 : conditional statement GS. */
3801 :
3802 : inline void
3803 29659494 : gimple_cond_set_rhs (gcond *gs, tree rhs)
3804 : {
3805 26305716 : gs->op[1] = rhs;
3806 41568 : }
3807 :
3808 :
3809 : /* Return the label used by conditional statement GS when its
3810 : predicate evaluates to true. */
3811 :
3812 : inline tree
3813 774302349 : gimple_cond_true_label (const gcond *gs)
3814 : {
3815 774302204 : return gs->op[2];
3816 : }
3817 :
3818 :
3819 : /* Set LABEL to be the label used by conditional statement GS when its
3820 : predicate evaluates to true. */
3821 :
3822 : inline void
3823 16103138 : gimple_cond_set_true_label (gcond *gs, tree label)
3824 : {
3825 16103138 : gs->op[2] = label;
3826 9148 : }
3827 :
3828 :
3829 : /* Set LABEL to be the label used by conditional statement GS when its
3830 : predicate evaluates to false. */
3831 :
3832 : inline void
3833 16201916 : gimple_cond_set_false_label (gcond *gs, tree label)
3834 : {
3835 16201916 : gs->op[3] = label;
3836 107926 : }
3837 :
3838 :
3839 : /* Return the label used by conditional statement GS when its
3840 : predicate evaluates to false. */
3841 :
3842 : inline tree
3843 774309435 : gimple_cond_false_label (const gcond *gs)
3844 : {
3845 774309435 : return gs->op[3];
3846 : }
3847 :
3848 :
3849 : /* Set the conditional COND_STMT to be of the form 'if (0 != 0)'. */
3850 :
3851 : inline void
3852 2034578 : gimple_cond_make_false (gcond *gs)
3853 : {
3854 2034578 : gimple_cond_set_lhs (gs, boolean_false_node);
3855 2034578 : gimple_cond_set_rhs (gs, boolean_false_node);
3856 2034011 : gs->subcode = NE_EXPR;
3857 1874797 : }
3858 :
3859 :
3860 : /* Set the conditional COND_STMT to be of the form 'if (1 != 0)'. */
3861 :
3862 : inline void
3863 1130083 : gimple_cond_make_true (gcond *gs)
3864 : {
3865 1130083 : gimple_cond_set_lhs (gs, boolean_true_node);
3866 1130083 : gimple_cond_set_rhs (gs, boolean_false_node);
3867 1129772 : gs->subcode = NE_EXPR;
3868 1034269 : }
3869 :
3870 : /* Check if conditional statement GS is of the form 'if (1 == 1)',
3871 : 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
3872 :
3873 : inline bool
3874 184447519 : gimple_cond_true_p (const gcond *gs)
3875 : {
3876 184447519 : tree lhs = gimple_cond_lhs (gs);
3877 184447519 : tree rhs = gimple_cond_rhs (gs);
3878 184447519 : enum tree_code code = gimple_cond_code (gs);
3879 :
3880 184447519 : if (lhs != boolean_true_node && lhs != boolean_false_node)
3881 : return false;
3882 :
3883 396398 : if (rhs != boolean_true_node && rhs != boolean_false_node)
3884 : return false;
3885 :
3886 396398 : if (code == NE_EXPR && lhs != rhs)
3887 : return true;
3888 :
3889 276892 : if (code == EQ_EXPR && lhs == rhs)
3890 : return true;
3891 :
3892 : return false;
3893 : }
3894 :
3895 : /* Check if conditional statement GS is in the caonical form of 'if (1 != 0)'. */
3896 :
3897 : inline bool
3898 360646 : gimple_cond_true_canonical_p (const gcond *gs)
3899 : {
3900 360646 : tree lhs = gimple_cond_lhs (gs);
3901 360646 : tree rhs = gimple_cond_rhs (gs);
3902 360646 : tree_code code = gimple_cond_code (gs);
3903 360646 : if (code == NE_EXPR
3904 258376 : && lhs == boolean_true_node
3905 172644 : && rhs == boolean_false_node)
3906 172534 : return true;
3907 : return false;
3908 : }
3909 :
3910 : /* Check if conditional statement GS is of the form 'if (1 != 1)',
3911 : 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
3912 :
3913 : inline bool
3914 184328013 : gimple_cond_false_p (const gcond *gs)
3915 : {
3916 184328013 : tree lhs = gimple_cond_lhs (gs);
3917 184328013 : tree rhs = gimple_cond_rhs (gs);
3918 184328013 : enum tree_code code = gimple_cond_code (gs);
3919 :
3920 184328013 : if (lhs != boolean_true_node && lhs != boolean_false_node)
3921 : return false;
3922 :
3923 276892 : if (rhs != boolean_true_node && rhs != boolean_false_node)
3924 : return false;
3925 :
3926 276892 : if (code == NE_EXPR && lhs == rhs)
3927 : return true;
3928 :
3929 0 : if (code == EQ_EXPR && lhs != rhs)
3930 : return true;
3931 :
3932 : return false;
3933 : }
3934 :
3935 : /* Check if conditional statement GS is in the caonical form of 'if (0 != 0)'. */
3936 :
3937 : inline bool
3938 834313 : gimple_cond_false_canonical_p (const gcond *gs)
3939 : {
3940 834313 : tree lhs = gimple_cond_lhs (gs);
3941 834313 : tree rhs = gimple_cond_rhs (gs);
3942 834313 : tree_code code = gimple_cond_code (gs);
3943 834313 : if (code == NE_EXPR
3944 566510 : && lhs == boolean_false_node
3945 346851 : && rhs == boolean_false_node)
3946 : return true;
3947 : return false;
3948 : }
3949 :
3950 : /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
3951 :
3952 : inline void
3953 2075256 : gimple_cond_set_condition (gcond *stmt, enum tree_code code, tree lhs,
3954 : tree rhs)
3955 : {
3956 2075256 : gimple_cond_set_code (stmt, code);
3957 2075256 : gimple_cond_set_lhs (stmt, lhs);
3958 2075256 : gimple_cond_set_rhs (stmt, rhs);
3959 1668592 : }
3960 :
3961 :
3962 : /* Return the tree code for the expression computed by STMT. This is
3963 : only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
3964 : GIMPLE_CALL, return CALL_EXPR as the expression code for
3965 : consistency. This is useful when the caller needs to deal with the
3966 : three kinds of computation that GIMPLE supports. */
3967 :
3968 : inline enum tree_code
3969 331145537 : gimple_expr_code (const gimple *stmt)
3970 : {
3971 331145537 : if (const gassign *ass = dyn_cast<const gassign *> (stmt))
3972 230141867 : return gimple_assign_rhs_code (ass);
3973 101003670 : if (const gcond *cond = dyn_cast<const gcond *> (stmt))
3974 99824766 : return gimple_cond_code (cond);
3975 : else
3976 : {
3977 1178904 : gcc_gimple_checking_assert (gimple_code (stmt) == GIMPLE_CALL);
3978 : return CALL_EXPR;
3979 : }
3980 : }
3981 :
3982 :
3983 : /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
3984 :
3985 : inline tree
3986 505413818 : gimple_label_label (const glabel *gs)
3987 : {
3988 505413818 : return gs->op[0];
3989 : }
3990 :
3991 :
3992 : /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
3993 : GS. */
3994 :
3995 : inline void
3996 18993894 : gimple_label_set_label (glabel *gs, tree label)
3997 : {
3998 18993894 : gs->op[0] = label;
3999 : }
4000 :
4001 :
4002 : /* Return the destination of the unconditional jump GS. */
4003 :
4004 : inline tree
4005 52998647 : gimple_goto_dest (const gimple *gs)
4006 : {
4007 52998647 : GIMPLE_CHECK (gs, GIMPLE_GOTO);
4008 52998647 : return gimple_op (gs, 0);
4009 : }
4010 :
4011 :
4012 : /* Set DEST to be the destination of the unconditonal jump GS. */
4013 :
4014 : inline void
4015 7998027 : gimple_goto_set_dest (ggoto *gs, tree dest)
4016 : {
4017 7998027 : gs->op[0] = dest;
4018 1086954 : }
4019 :
4020 :
4021 : /* Return the variables declared in the GIMPLE_BIND statement GS. */
4022 :
4023 : inline tree
4024 17259694 : gimple_bind_vars (const gbind *bind_stmt)
4025 : {
4026 17259694 : return bind_stmt->vars;
4027 : }
4028 :
4029 :
4030 : /* Set VARS to be the set of variables declared in the GIMPLE_BIND
4031 : statement GS. */
4032 :
4033 : inline void
4034 9203378 : gimple_bind_set_vars (gbind *bind_stmt, tree vars)
4035 : {
4036 7322797 : bind_stmt->vars = vars;
4037 1880581 : }
4038 :
4039 :
4040 : /* Append VARS to the set of variables declared in the GIMPLE_BIND
4041 : statement GS. */
4042 :
4043 : inline void
4044 77231 : gimple_bind_append_vars (gbind *bind_stmt, tree vars)
4045 : {
4046 77231 : bind_stmt->vars = chainon (bind_stmt->vars, vars);
4047 : }
4048 :
4049 :
4050 : inline gimple_seq *
4051 10226132 : gimple_bind_body_ptr (gbind *bind_stmt)
4052 : {
4053 10226132 : return &bind_stmt->body;
4054 : }
4055 :
4056 : /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
4057 :
4058 : inline gimple_seq
4059 29355767 : gimple_bind_body (const gbind *gs)
4060 : {
4061 29355767 : return *gimple_bind_body_ptr (const_cast <gbind *> (gs));
4062 : }
4063 :
4064 :
4065 : /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
4066 : statement GS. */
4067 :
4068 : inline void
4069 7986456 : gimple_bind_set_body (gbind *bind_stmt, gimple_seq seq)
4070 : {
4071 6698109 : bind_stmt->body = seq;
4072 1287969 : }
4073 :
4074 :
4075 : /* Append a statement to the end of a GIMPLE_BIND's body. */
4076 :
4077 : inline void
4078 67725 : gimple_bind_add_stmt (gbind *bind_stmt, gimple *stmt)
4079 : {
4080 67725 : gimple_seq_add_stmt (&bind_stmt->body, stmt);
4081 0 : }
4082 :
4083 :
4084 : /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
4085 :
4086 : inline void
4087 129458 : gimple_bind_add_seq (gbind *bind_stmt, gimple_seq seq)
4088 : {
4089 125600 : gimple_seq_add_seq (&bind_stmt->body, seq);
4090 : }
4091 :
4092 :
4093 : /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
4094 : GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
4095 :
4096 : inline tree
4097 23660636 : gimple_bind_block (const gbind *bind_stmt)
4098 : {
4099 23659472 : return bind_stmt->block;
4100 : }
4101 :
4102 :
4103 : /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
4104 : statement GS. */
4105 :
4106 : inline void
4107 5869148 : gimple_bind_set_block (gbind *bind_stmt, tree block)
4108 : {
4109 5869148 : gcc_gimple_checking_assert (block == NULL_TREE
4110 : || TREE_CODE (block) == BLOCK);
4111 5869148 : bind_stmt->block = block;
4112 5869148 : }
4113 :
4114 :
4115 : /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
4116 :
4117 : inline unsigned
4118 51330387 : gimple_asm_ninputs (const gasm *asm_stmt)
4119 : {
4120 51330387 : return asm_stmt->ni;
4121 : }
4122 :
4123 :
4124 : /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
4125 :
4126 : inline unsigned
4127 84136425 : gimple_asm_noutputs (const gasm *asm_stmt)
4128 : {
4129 71012190 : return asm_stmt->no;
4130 : }
4131 :
4132 :
4133 : /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
4134 :
4135 : inline unsigned
4136 17126581 : gimple_asm_nclobbers (const gasm *asm_stmt)
4137 : {
4138 17126581 : return asm_stmt->nc;
4139 : }
4140 :
4141 : /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
4142 :
4143 : inline unsigned
4144 41612704 : gimple_asm_nlabels (const gasm *asm_stmt)
4145 : {
4146 41607320 : return asm_stmt->nl;
4147 : }
4148 :
4149 : /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
4150 :
4151 : inline tree
4152 23935747 : gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
4153 : {
4154 23935747 : gcc_gimple_checking_assert (index < asm_stmt->ni);
4155 23935747 : return asm_stmt->op[index + asm_stmt->no];
4156 : }
4157 :
4158 : /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
4159 :
4160 : inline void
4161 46238 : gimple_asm_set_input_op (gasm *asm_stmt, unsigned index, tree in_op)
4162 : {
4163 46238 : gcc_gimple_checking_assert (index < asm_stmt->ni
4164 : && TREE_CODE (in_op) == TREE_LIST);
4165 46238 : asm_stmt->op[index + asm_stmt->no] = in_op;
4166 46238 : }
4167 :
4168 :
4169 : /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
4170 :
4171 : inline tree
4172 35561916 : gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
4173 : {
4174 35561916 : gcc_gimple_checking_assert (index < asm_stmt->no);
4175 35561916 : return asm_stmt->op[index];
4176 : }
4177 :
4178 : /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
4179 :
4180 : inline void
4181 64766 : gimple_asm_set_output_op (gasm *asm_stmt, unsigned index, tree out_op)
4182 : {
4183 64766 : gcc_gimple_checking_assert (index < asm_stmt->no
4184 : && TREE_CODE (out_op) == TREE_LIST);
4185 64766 : asm_stmt->op[index] = out_op;
4186 64766 : }
4187 :
4188 :
4189 : /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
4190 :
4191 : inline tree
4192 9723817 : gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
4193 : {
4194 9723817 : gcc_gimple_checking_assert (index < asm_stmt->nc);
4195 9723817 : return asm_stmt->op[index + asm_stmt->ni + asm_stmt->no];
4196 : }
4197 :
4198 :
4199 : /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
4200 :
4201 : inline void
4202 95453 : gimple_asm_set_clobber_op (gasm *asm_stmt, unsigned index, tree clobber_op)
4203 : {
4204 95453 : gcc_gimple_checking_assert (index < asm_stmt->nc
4205 : && TREE_CODE (clobber_op) == TREE_LIST);
4206 95453 : asm_stmt->op[index + asm_stmt->ni + asm_stmt->no] = clobber_op;
4207 95453 : }
4208 :
4209 : /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
4210 :
4211 : inline tree
4212 217231 : gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
4213 : {
4214 217231 : gcc_gimple_checking_assert (index < asm_stmt->nl);
4215 217231 : return asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc];
4216 : }
4217 :
4218 : /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
4219 :
4220 : inline void
4221 882 : gimple_asm_set_label_op (gasm *asm_stmt, unsigned index, tree label_op)
4222 : {
4223 882 : gcc_gimple_checking_assert (index < asm_stmt->nl
4224 : && TREE_CODE (label_op) == TREE_LIST);
4225 882 : asm_stmt->op[index + asm_stmt->no + asm_stmt->ni + asm_stmt->nc] = label_op;
4226 882 : }
4227 :
4228 : /* Return the string representing the assembly instruction in
4229 : GIMPLE_ASM ASM_STMT. */
4230 :
4231 : inline const char *
4232 1167854 : gimple_asm_string (const gasm *asm_stmt)
4233 : {
4234 1167854 : return asm_stmt->string;
4235 : }
4236 :
4237 :
4238 : /* Return true if ASM_STMT is marked volatile. */
4239 :
4240 : inline bool
4241 1679801 : gimple_asm_volatile_p (const gasm *asm_stmt)
4242 : {
4243 1679801 : return (asm_stmt->subcode & GF_ASM_VOLATILE) != 0;
4244 : }
4245 :
4246 :
4247 : /* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile. */
4248 :
4249 : inline void
4250 7372 : gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
4251 : {
4252 7372 : if (volatile_p)
4253 90123 : asm_stmt->subcode |= GF_ASM_VOLATILE;
4254 : else
4255 7372 : asm_stmt->subcode &= ~GF_ASM_VOLATILE;
4256 : }
4257 :
4258 :
4259 : /* Return true if ASM_STMT is marked inline. */
4260 :
4261 : inline bool
4262 772745 : gimple_asm_inline_p (const gasm *asm_stmt)
4263 : {
4264 772745 : return (asm_stmt->subcode & GF_ASM_INLINE) != 0;
4265 : }
4266 :
4267 :
4268 : /* If INLINE_P is true, mark asm statement ASM_STMT as inline. */
4269 :
4270 : inline void
4271 97495 : gimple_asm_set_inline (gasm *asm_stmt, bool inline_p)
4272 : {
4273 97495 : if (inline_p)
4274 90 : asm_stmt->subcode |= GF_ASM_INLINE;
4275 : else
4276 97405 : asm_stmt->subcode &= ~GF_ASM_INLINE;
4277 : }
4278 :
4279 :
4280 : /* Mark whether asm ASM_STMT is a basic asm or an extended asm, based on
4281 : BASIC_P. */
4282 :
4283 : inline void
4284 97495 : gimple_asm_set_basic (gasm *asm_stmt, bool basic_p)
4285 : {
4286 97495 : if (basic_p)
4287 2404 : asm_stmt->subcode |= GF_ASM_BASIC;
4288 : else
4289 95091 : asm_stmt->subcode &= ~GF_ASM_BASIC;
4290 : }
4291 :
4292 :
4293 : /* Return true if asm ASM_STMT is a basic asm rather than an extended asm. */
4294 :
4295 : inline bool
4296 7518323 : gimple_asm_basic_p (const gasm *asm_stmt)
4297 : {
4298 7518323 : return (asm_stmt->subcode & GF_ASM_BASIC) != 0;
4299 : }
4300 :
4301 :
4302 : /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4303 :
4304 : inline tree
4305 61600 : gimple_catch_types (const gcatch *catch_stmt)
4306 : {
4307 61600 : return catch_stmt->types;
4308 : }
4309 :
4310 :
4311 : /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
4312 :
4313 : inline tree *
4314 17635 : gimple_catch_types_ptr (gcatch *catch_stmt)
4315 : {
4316 17635 : return &catch_stmt->types;
4317 : }
4318 :
4319 :
4320 : /* Return a pointer to the GIMPLE sequence representing the body of
4321 : the handler of GIMPLE_CATCH statement CATCH_STMT. */
4322 :
4323 : inline gimple_seq *
4324 75152 : gimple_catch_handler_ptr (gcatch *catch_stmt)
4325 : {
4326 75152 : return &catch_stmt->handler;
4327 : }
4328 :
4329 :
4330 : /* Return the GIMPLE sequence representing the body of the handler of
4331 : GIMPLE_CATCH statement CATCH_STMT. */
4332 :
4333 : inline gimple_seq
4334 367978 : gimple_catch_handler (const gcatch *catch_stmt)
4335 : {
4336 367978 : return *gimple_catch_handler_ptr (const_cast <gcatch *> (catch_stmt));
4337 : }
4338 :
4339 :
4340 : /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
4341 :
4342 : inline void
4343 57267 : gimple_catch_set_types (gcatch *catch_stmt, tree t)
4344 : {
4345 57267 : catch_stmt->types = t;
4346 17498 : }
4347 :
4348 :
4349 : /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
4350 :
4351 : inline void
4352 57255 : gimple_catch_set_handler (gcatch *catch_stmt, gimple_seq handler)
4353 : {
4354 17498 : catch_stmt->handler = handler;
4355 39757 : }
4356 :
4357 :
4358 : /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
4359 :
4360 : inline tree
4361 5244 : gimple_eh_filter_types (const gimple *gs)
4362 : {
4363 5244 : const geh_filter *eh_filter_stmt = as_a <const geh_filter *> (gs);
4364 5244 : return eh_filter_stmt->types;
4365 : }
4366 :
4367 :
4368 : /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
4369 : GS. */
4370 :
4371 : inline tree *
4372 71 : gimple_eh_filter_types_ptr (gimple *gs)
4373 : {
4374 71 : geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4375 71 : return &eh_filter_stmt->types;
4376 : }
4377 :
4378 :
4379 : /* Return a pointer to the sequence of statement to execute when
4380 : GIMPLE_EH_FILTER statement fails. */
4381 :
4382 : inline gimple_seq *
4383 48002 : gimple_eh_filter_failure_ptr (gimple *gs)
4384 : {
4385 36940 : geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
4386 36940 : return &eh_filter_stmt->failure;
4387 : }
4388 :
4389 :
4390 : /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
4391 : statement fails. */
4392 :
4393 : inline gimple_seq
4394 42093 : gimple_eh_filter_failure (const gimple *gs)
4395 : {
4396 42093 : return *gimple_eh_filter_failure_ptr (const_cast <gimple *> (gs));
4397 : }
4398 :
4399 :
4400 : /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
4401 : EH_FILTER_STMT. */
4402 :
4403 : inline void
4404 5232 : gimple_eh_filter_set_types (geh_filter *eh_filter_stmt, tree types)
4405 : {
4406 5232 : eh_filter_stmt->types = types;
4407 0 : }
4408 :
4409 :
4410 : /* Set FAILURE to be the sequence of statements to execute on failure
4411 : for GIMPLE_EH_FILTER EH_FILTER_STMT. */
4412 :
4413 : inline void
4414 5232 : gimple_eh_filter_set_failure (geh_filter *eh_filter_stmt,
4415 : gimple_seq failure)
4416 : {
4417 0 : eh_filter_stmt->failure = failure;
4418 5232 : }
4419 :
4420 : /* Get the function decl to be called by the MUST_NOT_THROW region. */
4421 :
4422 : inline tree
4423 1237924 : gimple_eh_must_not_throw_fndecl (const geh_mnt *eh_mnt_stmt)
4424 : {
4425 1237924 : return eh_mnt_stmt->fndecl;
4426 : }
4427 :
4428 : /* Set the function decl to be called by GS to DECL. */
4429 :
4430 : inline void
4431 1231195 : gimple_eh_must_not_throw_set_fndecl (geh_mnt *eh_mnt_stmt,
4432 : tree decl)
4433 : {
4434 1231195 : eh_mnt_stmt->fndecl = decl;
4435 0 : }
4436 :
4437 : /* GIMPLE_EH_ELSE accessors. */
4438 :
4439 : inline gimple_seq *
4440 972 : gimple_eh_else_n_body_ptr (geh_else *eh_else_stmt)
4441 : {
4442 972 : return &eh_else_stmt->n_body;
4443 : }
4444 :
4445 : inline gimple_seq
4446 4412 : gimple_eh_else_n_body (const geh_else *eh_else_stmt)
4447 : {
4448 4135 : return *gimple_eh_else_n_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4449 : }
4450 :
4451 : inline gimple_seq *
4452 972 : gimple_eh_else_e_body_ptr (geh_else *eh_else_stmt)
4453 : {
4454 972 : return &eh_else_stmt->e_body;
4455 : }
4456 :
4457 : inline gimple_seq
4458 3510 : gimple_eh_else_e_body (const geh_else *eh_else_stmt)
4459 : {
4460 3510 : return *gimple_eh_else_e_body_ptr (const_cast <geh_else *> (eh_else_stmt));
4461 : }
4462 :
4463 : inline void
4464 702 : gimple_eh_else_set_n_body (geh_else *eh_else_stmt, gimple_seq seq)
4465 : {
4466 273 : eh_else_stmt->n_body = seq;
4467 : }
4468 :
4469 : inline void
4470 702 : gimple_eh_else_set_e_body (geh_else *eh_else_stmt, gimple_seq seq)
4471 : {
4472 273 : eh_else_stmt->e_body = seq;
4473 273 : }
4474 :
4475 : /* GIMPLE_TRY accessors. */
4476 :
4477 : /* Return the kind of try block represented by GIMPLE_TRY GS. This is
4478 : either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
4479 :
4480 : inline enum gimple_try_flags
4481 9963338 : gimple_try_kind (const gimple *gs)
4482 : {
4483 9963338 : GIMPLE_CHECK (gs, GIMPLE_TRY);
4484 9963338 : return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
4485 : }
4486 :
4487 :
4488 : /* Set the kind of try block represented by GIMPLE_TRY GS. */
4489 :
4490 : inline void
4491 1 : gimple_try_set_kind (gtry *gs, enum gimple_try_flags kind)
4492 : {
4493 1 : gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
4494 : || kind == GIMPLE_TRY_FINALLY);
4495 1 : if (gimple_try_kind (gs) != kind)
4496 1 : gs->subcode = (unsigned int) kind;
4497 1 : }
4498 :
4499 :
4500 : /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4501 :
4502 : inline bool
4503 5999 : gimple_try_catch_is_cleanup (const gimple *gs)
4504 : {
4505 5999 : gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
4506 5999 : return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
4507 : }
4508 :
4509 :
4510 : /* Return a pointer to the sequence of statements used as the
4511 : body for GIMPLE_TRY GS. */
4512 :
4513 : inline gimple_seq *
4514 27692196 : gimple_try_eval_ptr (gimple *gs)
4515 : {
4516 19088462 : gtry *try_stmt = as_a <gtry *> (gs);
4517 19088462 : return &try_stmt->eval;
4518 : }
4519 :
4520 :
4521 : /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
4522 :
4523 : inline gimple_seq
4524 23396350 : gimple_try_eval (const gimple *gs)
4525 : {
4526 23396350 : return *gimple_try_eval_ptr (const_cast <gimple *> (gs));
4527 : }
4528 :
4529 :
4530 : /* Return a pointer to the sequence of statements used as the cleanup body for
4531 : GIMPLE_TRY GS. */
4532 :
4533 : inline gimple_seq *
4534 28150103 : gimple_try_cleanup_ptr (gimple *gs)
4535 : {
4536 16788109 : gtry *try_stmt = as_a <gtry *> (gs);
4537 16788109 : return &try_stmt->cleanup;
4538 : }
4539 :
4540 :
4541 : /* Return the sequence of statements used as the cleanup body for
4542 : GIMPLE_TRY GS. */
4543 :
4544 : inline gimple_seq
4545 13488479 : gimple_try_cleanup (const gimple *gs)
4546 : {
4547 24328652 : return *gimple_try_cleanup_ptr (const_cast <gimple *> (gs));
4548 : }
4549 :
4550 :
4551 : /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
4552 :
4553 : inline void
4554 165557 : gimple_try_set_catch_is_cleanup (gtry *g, bool catch_is_cleanup)
4555 : {
4556 165557 : gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
4557 165557 : if (catch_is_cleanup)
4558 215 : g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
4559 : else
4560 165342 : g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
4561 165557 : }
4562 :
4563 :
4564 : /* Set EVAL to be the sequence of statements to use as the body for
4565 : GIMPLE_TRY TRY_STMT. */
4566 :
4567 : inline void
4568 2968485 : gimple_try_set_eval (gtry *try_stmt, gimple_seq eval)
4569 : {
4570 24044 : try_stmt->eval = eval;
4571 2944441 : }
4572 :
4573 :
4574 : /* Set CLEANUP to be the sequence of statements to use as the cleanup
4575 : body for GIMPLE_TRY TRY_STMT. */
4576 :
4577 : inline void
4578 3116482 : gimple_try_set_cleanup (gtry *try_stmt, gimple_seq cleanup)
4579 : {
4580 66030 : try_stmt->cleanup = cleanup;
4581 3074495 : }
4582 :
4583 :
4584 : /* Return a pointer to the cleanup sequence for cleanup statement GS. */
4585 :
4586 : inline gimple_seq *
4587 590348 : gimple_wce_cleanup_ptr (gimple *gs)
4588 : {
4589 590348 : gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4590 590348 : return &wce_stmt->cleanup;
4591 : }
4592 :
4593 :
4594 : /* Return the cleanup sequence for cleanup statement GS. */
4595 :
4596 : inline gimple_seq
4597 590348 : gimple_wce_cleanup (gimple *gs)
4598 : {
4599 590348 : return *gimple_wce_cleanup_ptr (gs);
4600 : }
4601 :
4602 :
4603 : /* Set CLEANUP to be the cleanup sequence for GS. */
4604 :
4605 : inline void
4606 590348 : gimple_wce_set_cleanup (gimple *gs, gimple_seq cleanup)
4607 : {
4608 590348 : gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
4609 590348 : wce_stmt->cleanup = cleanup;
4610 590348 : }
4611 :
4612 :
4613 : /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
4614 :
4615 : inline bool
4616 590348 : gimple_wce_cleanup_eh_only (const gimple *gs)
4617 : {
4618 590348 : GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4619 590348 : return gs->subcode != 0;
4620 : }
4621 :
4622 :
4623 : /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
4624 :
4625 : inline void
4626 576845 : gimple_wce_set_cleanup_eh_only (gimple *gs, bool eh_only_p)
4627 : {
4628 576845 : GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
4629 576845 : gs->subcode = (unsigned int) eh_only_p;
4630 576845 : }
4631 :
4632 :
4633 : /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
4634 :
4635 : inline unsigned
4636 401846999 : gimple_phi_capacity (const gimple *gs)
4637 : {
4638 361221724 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4639 401846999 : return phi_stmt->capacity;
4640 : }
4641 :
4642 :
4643 : /* Return the number of arguments in GIMPLE_PHI GS. This must always
4644 : be exactly the number of incoming edges for the basic block holding
4645 : GS. */
4646 :
4647 : inline unsigned
4648 7134415447 : gimple_phi_num_args (const gimple *gs)
4649 : {
4650 7137114081 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4651 7137853772 : return phi_stmt->nargs;
4652 : }
4653 :
4654 :
4655 : /* Return the SSA name created by GIMPLE_PHI GS. */
4656 :
4657 : inline tree
4658 8530617923 : gimple_phi_result (const gphi *gs)
4659 : {
4660 7973184392 : return gs->result;
4661 : }
4662 :
4663 : inline tree
4664 726593577 : gimple_phi_result (const gimple *gs)
4665 : {
4666 719409182 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4667 728069348 : return gimple_phi_result (phi_stmt);
4668 : }
4669 :
4670 : /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
4671 :
4672 : inline tree *
4673 15776799 : gimple_phi_result_ptr (gphi *gs)
4674 : {
4675 15776799 : return &gs->result;
4676 : }
4677 :
4678 : inline tree *
4679 : gimple_phi_result_ptr (gimple *gs)
4680 : {
4681 : gphi *phi_stmt = as_a <gphi *> (gs);
4682 : return gimple_phi_result_ptr (phi_stmt);
4683 : }
4684 :
4685 : /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
4686 :
4687 : inline void
4688 14019034 : gimple_phi_set_result (gphi *phi, tree result)
4689 : {
4690 14019034 : phi->result = result;
4691 14019034 : if (result && TREE_CODE (result) == SSA_NAME)
4692 14019034 : SSA_NAME_DEF_STMT (result) = phi;
4693 : }
4694 :
4695 :
4696 : /* Return the PHI argument corresponding to incoming edge INDEX for
4697 : GIMPLE_PHI GS. */
4698 :
4699 : inline struct phi_arg_d *
4700 3319716209 : gimple_phi_arg (gphi *gs, unsigned index)
4701 : {
4702 403471268 : gcc_gimple_checking_assert (index < gs->nargs);
4703 1345092251 : return &(gs->args[index]);
4704 : }
4705 :
4706 : inline const phi_arg_d *
4707 7789501856 : gimple_phi_arg (const gphi *gs, unsigned index)
4708 : {
4709 25827 : gcc_gimple_checking_assert (index < gs->nargs);
4710 7789466819 : return &(gs->args[index]);
4711 : }
4712 :
4713 : inline const phi_arg_d *
4714 766780434 : gimple_phi_arg (const gimple *gs, unsigned index)
4715 : {
4716 766780434 : const gphi *phi_stmt = as_a <const gphi *> (gs);
4717 766780434 : return gimple_phi_arg (phi_stmt, index);
4718 : }
4719 :
4720 : inline struct phi_arg_d *
4721 2550476663 : gimple_phi_arg (gimple *gs, unsigned index)
4722 : {
4723 2550476663 : gphi *phi_stmt = as_a <gphi *> (gs);
4724 2550476663 : return gimple_phi_arg (phi_stmt, index);
4725 : }
4726 :
4727 : /* Set PHIARG to be the argument corresponding to incoming edge INDEX
4728 : for GIMPLE_PHI PHI. */
4729 :
4730 : inline void
4731 : gimple_phi_set_arg (gphi *phi, unsigned index, struct phi_arg_d * phiarg)
4732 : {
4733 : gcc_gimple_checking_assert (index < phi->nargs);
4734 : phi->args[index] = *phiarg;
4735 : }
4736 :
4737 : /* Return the PHI nodes for basic block BB, or NULL if there are no
4738 : PHI nodes. */
4739 :
4740 : inline gimple_seq
4741 681699875 : phi_nodes (const_basic_block bb)
4742 : {
4743 681699875 : gcc_checking_assert (!(bb->flags & BB_RTL));
4744 681699875 : return bb->il.gimple.phi_nodes;
4745 : }
4746 :
4747 : /* Return a pointer to the PHI nodes for basic block BB. */
4748 :
4749 : inline gimple_seq *
4750 11826971631 : phi_nodes_ptr (basic_block bb)
4751 : {
4752 11826971631 : gcc_checking_assert (!(bb->flags & BB_RTL));
4753 11826971631 : return &bb->il.gimple.phi_nodes;
4754 : }
4755 :
4756 : /* Return the tree operand for argument I of PHI node GS. */
4757 :
4758 : inline tree
4759 4282184363 : gimple_phi_arg_def (const gphi *gs, size_t index)
4760 : {
4761 4301371927 : return gimple_phi_arg (gs, index)->def;
4762 : }
4763 :
4764 : inline tree
4765 446492043 : gimple_phi_arg_def (const gimple *gs, size_t index)
4766 : {
4767 446485973 : return gimple_phi_arg (gs, index)->def;
4768 : }
4769 :
4770 : /* Return the tree operand for the argument associated with
4771 : edge E of PHI node GS. */
4772 :
4773 : inline tree
4774 928621350 : gimple_phi_arg_def_from_edge (const gphi *gs, const_edge e)
4775 : {
4776 928621350 : gcc_checking_assert (e->dest == gimple_bb (gs));
4777 928621350 : return gimple_phi_arg (gs, e->dest_idx)->def;
4778 : }
4779 :
4780 : inline tree
4781 320287528 : gimple_phi_arg_def_from_edge (const gimple *gs, const_edge e)
4782 : {
4783 320287528 : gcc_checking_assert (e->dest == gimple_bb (gs));
4784 320287528 : return gimple_phi_arg (gs, e->dest_idx)->def;
4785 : }
4786 :
4787 : /* Return a pointer to the tree operand for argument I of phi node PHI. */
4788 :
4789 : inline tree *
4790 99585481 : gimple_phi_arg_def_ptr (gphi *phi, size_t index)
4791 : {
4792 99585481 : return &gimple_phi_arg (phi, index)->def;
4793 : }
4794 :
4795 : /* Return the edge associated with argument I of phi node PHI. */
4796 :
4797 : inline edge
4798 592475619 : gimple_phi_arg_edge (const gphi *phi, size_t i)
4799 : {
4800 605972837 : return EDGE_PRED (gimple_bb (phi), i);
4801 : }
4802 :
4803 : /* Return the source location of gimple argument I of phi node PHI. */
4804 :
4805 : inline location_t
4806 1788048500 : gimple_phi_arg_location (const gphi *phi, size_t i)
4807 : {
4808 1788048500 : return gimple_phi_arg (phi, i)->locus;
4809 : }
4810 :
4811 : /* Return the source location of the argument on edge E of phi node PHI. */
4812 :
4813 : inline location_t
4814 14120831 : gimple_phi_arg_location_from_edge (gphi *phi, edge e)
4815 : {
4816 14120831 : return gimple_phi_arg (phi, e->dest_idx)->locus;
4817 : }
4818 :
4819 : /* Set the source location of gimple argument I of phi node PHI to LOC. */
4820 :
4821 : inline void
4822 251828627 : gimple_phi_arg_set_location (gphi *phi, size_t i, location_t loc)
4823 : {
4824 251828627 : gimple_phi_arg (phi, i)->locus = loc;
4825 251828627 : }
4826 :
4827 : /* Return address of source location of gimple argument I of phi node PHI. */
4828 :
4829 : inline location_t *
4830 180927 : gimple_phi_arg_location_ptr (gphi *phi, size_t i)
4831 : {
4832 180927 : return &gimple_phi_arg (phi, i)->locus;
4833 : }
4834 :
4835 : /* Return TRUE if argument I of phi node PHI has a location record. */
4836 :
4837 : inline bool
4838 7819935 : gimple_phi_arg_has_location (const gphi *phi, size_t i)
4839 : {
4840 7819935 : return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
4841 : }
4842 :
4843 : /* Return the number of arguments that can be accessed by gimple_arg. */
4844 :
4845 : inline unsigned
4846 23040750 : gimple_num_args (const gimple *gs)
4847 : {
4848 23040750 : if (auto phi = dyn_cast<const gphi *> (gs))
4849 1282839 : return gimple_phi_num_args (phi);
4850 21757911 : if (auto call = dyn_cast<const gcall *> (gs))
4851 132747 : return gimple_call_num_args (call);
4852 21625164 : return gimple_num_ops (as_a <const gassign *> (gs)) - 1;
4853 : }
4854 :
4855 : /* GS must be an assignment, a call, or a PHI.
4856 : If it's an assignment, return rhs operand I.
4857 : If it's a call, return function argument I.
4858 : If it's a PHI, return the value of PHI argument I. */
4859 :
4860 : inline tree
4861 33772752 : gimple_arg (const gimple *gs, unsigned int i)
4862 : {
4863 33772752 : if (auto phi = dyn_cast<const gphi *> (gs))
4864 1657897 : return gimple_phi_arg_def (phi, i);
4865 32114855 : if (auto call = dyn_cast<const gcall *> (gs))
4866 104002 : return gimple_call_arg (call, i);
4867 32010853 : return gimple_op (as_a <const gassign *> (gs), i + 1);
4868 : }
4869 :
4870 : /* Return a pointer to gimple_arg (GS, I). */
4871 :
4872 : inline tree *
4873 : gimple_arg_ptr (gimple *gs, unsigned int i)
4874 : {
4875 : if (auto phi = dyn_cast<gphi *> (gs))
4876 : return gimple_phi_arg_def_ptr (phi, i);
4877 : if (auto call = dyn_cast<gcall *> (gs))
4878 : return gimple_call_arg_ptr (call, i);
4879 : return gimple_op_ptr (as_a <gassign *> (gs), i + 1);
4880 : }
4881 :
4882 : /* Return the region number for GIMPLE_RESX RESX_STMT. */
4883 :
4884 : inline int
4885 1315132 : gimple_resx_region (const gresx *resx_stmt)
4886 : {
4887 1315132 : return resx_stmt->region;
4888 : }
4889 :
4890 : /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
4891 :
4892 : inline void
4893 70482 : gimple_resx_set_region (gresx *resx_stmt, int region)
4894 : {
4895 70482 : resx_stmt->region = region;
4896 70482 : }
4897 :
4898 : /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
4899 :
4900 : inline int
4901 2054357 : gimple_eh_dispatch_region (const geh_dispatch *eh_dispatch_stmt)
4902 : {
4903 2053962 : return eh_dispatch_stmt->region;
4904 : }
4905 :
4906 : /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
4907 : EH_DISPATCH_STMT. */
4908 :
4909 : inline void
4910 9387 : gimple_eh_dispatch_set_region (geh_dispatch *eh_dispatch_stmt, int region)
4911 : {
4912 9387 : eh_dispatch_stmt->region = region;
4913 9387 : }
4914 :
4915 : /* Return the number of labels associated with the switch statement GS. */
4916 :
4917 : inline unsigned
4918 13147408 : gimple_switch_num_labels (const gswitch *gs)
4919 : {
4920 13147408 : unsigned num_ops;
4921 13147408 : GIMPLE_CHECK (gs, GIMPLE_SWITCH);
4922 13147408 : num_ops = gimple_num_ops (gs);
4923 13147408 : gcc_gimple_checking_assert (num_ops > 1);
4924 13147408 : return num_ops - 1;
4925 : }
4926 :
4927 :
4928 : /* Set NLABELS to be the number of labels for the switch statement GS. */
4929 :
4930 : inline void
4931 23049 : gimple_switch_set_num_labels (gswitch *g, unsigned nlabels)
4932 : {
4933 23049 : GIMPLE_CHECK (g, GIMPLE_SWITCH);
4934 23049 : gimple_set_num_ops (g, nlabels + 1);
4935 23049 : }
4936 :
4937 :
4938 : /* Return the index variable used by the switch statement GS. */
4939 :
4940 : inline tree
4941 12283009 : gimple_switch_index (const gswitch *gs)
4942 : {
4943 12224904 : return gs->op[0];
4944 : }
4945 :
4946 :
4947 : /* Return a pointer to the index variable for the switch statement GS. */
4948 :
4949 : inline tree *
4950 0 : gimple_switch_index_ptr (gswitch *gs)
4951 : {
4952 0 : return &gs->op[0];
4953 : }
4954 :
4955 :
4956 : /* Set INDEX to be the index variable for switch statement GS. */
4957 :
4958 : inline void
4959 106568 : gimple_switch_set_index (gswitch *gs, tree index)
4960 : {
4961 106568 : gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
4962 106568 : gs->op[0] = index;
4963 106568 : }
4964 :
4965 :
4966 : /* Return the label numbered INDEX. The default label is 0, followed by any
4967 : labels in a switch statement. */
4968 :
4969 : inline tree
4970 129805653 : gimple_switch_label (const gswitch *gs, unsigned index)
4971 : {
4972 129763162 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
4973 9963636 : return gs->op[index + 1];
4974 : }
4975 :
4976 : /* Set the label number INDEX to LABEL. 0 is always the default label. */
4977 :
4978 : inline void
4979 1227634 : gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
4980 : {
4981 1227634 : gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
4982 : && (label == NULL_TREE
4983 : || TREE_CODE (label) == CASE_LABEL_EXPR));
4984 1227634 : gs->op[index + 1] = label;
4985 1227634 : }
4986 :
4987 : /* Return the default label for a switch statement. */
4988 :
4989 : inline tree
4990 42491 : gimple_switch_default_label (const gswitch *gs)
4991 : {
4992 42491 : tree label = gimple_switch_label (gs, 0);
4993 42491 : gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
4994 42491 : return label;
4995 : }
4996 :
4997 : /* Set the default label for a switch statement. */
4998 :
4999 : inline void
5000 65534 : gimple_switch_set_default_label (gswitch *gs, tree label)
5001 : {
5002 65534 : gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
5003 65534 : gimple_switch_set_label (gs, 0, label);
5004 65534 : }
5005 :
5006 : /* Return true if GS is a GIMPLE_DEBUG statement. */
5007 :
5008 : inline bool
5009 65794520634 : is_gimple_debug (const gimple *gs)
5010 : {
5011 55837337870 : return gimple_code (gs) == GIMPLE_DEBUG;
5012 : }
5013 :
5014 :
5015 : /* Return the first nondebug statement in GIMPLE sequence S. */
5016 :
5017 : inline gimple *
5018 4538370 : gimple_seq_first_nondebug_stmt (gimple_seq s)
5019 : {
5020 4538370 : gimple_seq_node n = gimple_seq_first (s);
5021 4605511 : while (n && is_gimple_debug (n))
5022 67141 : n = n->next;
5023 4538370 : return n;
5024 : }
5025 :
5026 :
5027 : /* Return the last nondebug statement in GIMPLE sequence S. */
5028 :
5029 : inline gimple *
5030 16302186 : gimple_seq_last_nondebug_stmt (gimple_seq s)
5031 : {
5032 16302186 : gimple_seq_node n;
5033 16302186 : for (n = gimple_seq_last (s);
5034 16432549 : n && is_gimple_debug (n);
5035 130363 : n = n->prev)
5036 133062 : if (n == s)
5037 : return NULL;
5038 : return n;
5039 : }
5040 :
5041 :
5042 : /* Return true if S is a GIMPLE_DEBUG BIND statement. */
5043 :
5044 : inline bool
5045 35186545406 : gimple_debug_bind_p (const gimple *s)
5046 : {
5047 16347324971 : if (is_gimple_debug (s))
5048 15771979551 : return s->subcode == GIMPLE_DEBUG_BIND;
5049 :
5050 : return false;
5051 : }
5052 :
5053 : /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
5054 :
5055 : inline tree
5056 959862791 : gimple_debug_bind_get_var (const gimple *dbg)
5057 : {
5058 959862791 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5059 959862791 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5060 959862791 : return gimple_op (dbg, 0);
5061 : }
5062 :
5063 : /* Return the value bound to the variable in a GIMPLE_DEBUG bind
5064 : statement. */
5065 :
5066 : inline tree
5067 558417262 : gimple_debug_bind_get_value (const gimple *dbg)
5068 : {
5069 558417262 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5070 558417262 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5071 558417262 : return gimple_op (dbg, 1);
5072 : }
5073 :
5074 : /* Return a pointer to the value bound to the variable in a
5075 : GIMPLE_DEBUG bind statement. */
5076 :
5077 : inline tree *
5078 2842293400 : gimple_debug_bind_get_value_ptr (gimple *dbg)
5079 : {
5080 2842293400 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5081 2842293400 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5082 2842293400 : return gimple_op_ptr (dbg, 1);
5083 : }
5084 :
5085 : /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
5086 :
5087 : inline void
5088 101382358 : gimple_debug_bind_set_var (gimple *dbg, tree var)
5089 : {
5090 101382358 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5091 101382358 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5092 101382358 : gimple_set_op (dbg, 0, var);
5093 101382358 : }
5094 :
5095 : /* Set the value bound to the variable in a GIMPLE_DEBUG bind
5096 : statement. */
5097 :
5098 : inline void
5099 61262161 : gimple_debug_bind_set_value (gimple *dbg, tree value)
5100 : {
5101 61262161 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5102 61262161 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5103 61262161 : gimple_set_op (dbg, 1, value);
5104 61262161 : }
5105 :
5106 : /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
5107 : optimized away. */
5108 : #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
5109 :
5110 : /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
5111 : statement. */
5112 :
5113 : inline void
5114 8797114 : gimple_debug_bind_reset_value (gimple *dbg)
5115 : {
5116 8797114 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5117 8797114 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5118 8797114 : gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
5119 8797114 : }
5120 :
5121 : /* Return true if the GIMPLE_DEBUG bind statement is bound to a
5122 : value. */
5123 :
5124 : inline bool
5125 9478326622 : gimple_debug_bind_has_value_p (gimple *dbg)
5126 : {
5127 9478326622 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5128 9478326622 : gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
5129 9478326622 : return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
5130 : }
5131 :
5132 : #undef GIMPLE_DEBUG_BIND_NOVALUE
5133 :
5134 : /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
5135 :
5136 : inline bool
5137 90320618 : gimple_debug_source_bind_p (const gimple *s)
5138 : {
5139 89332183 : if (is_gimple_debug (s))
5140 59937194 : return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
5141 :
5142 : return false;
5143 : }
5144 :
5145 : /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
5146 :
5147 : inline tree
5148 1252152 : gimple_debug_source_bind_get_var (const gimple *dbg)
5149 : {
5150 1252152 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5151 1252152 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5152 1252152 : return gimple_op (dbg, 0);
5153 : }
5154 :
5155 : /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
5156 : statement. */
5157 :
5158 : inline tree
5159 1209093 : gimple_debug_source_bind_get_value (const gimple *dbg)
5160 : {
5161 1209093 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5162 1209093 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5163 1209093 : return gimple_op (dbg, 1);
5164 : }
5165 :
5166 : /* Return a pointer to the value bound to the variable in a
5167 : GIMPLE_DEBUG source bind statement. */
5168 :
5169 : inline tree *
5170 141936 : gimple_debug_source_bind_get_value_ptr (gimple *dbg)
5171 : {
5172 141936 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5173 141936 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5174 141936 : return gimple_op_ptr (dbg, 1);
5175 : }
5176 :
5177 : /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
5178 :
5179 : inline void
5180 1184415 : gimple_debug_source_bind_set_var (gimple *dbg, tree var)
5181 : {
5182 1184415 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5183 1184415 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5184 1184415 : gimple_set_op (dbg, 0, var);
5185 1184415 : }
5186 :
5187 : /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
5188 : statement. */
5189 :
5190 : inline void
5191 660084 : gimple_debug_source_bind_set_value (gimple *dbg, tree value)
5192 : {
5193 660084 : GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
5194 660084 : gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
5195 660084 : gimple_set_op (dbg, 1, value);
5196 660084 : }
5197 :
5198 : /* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement. */
5199 :
5200 : inline bool
5201 285796970 : gimple_debug_begin_stmt_p (const gimple *s)
5202 : {
5203 296710363 : if (is_gimple_debug (s))
5204 79034375 : return s->subcode == GIMPLE_DEBUG_BEGIN_STMT;
5205 :
5206 : return false;
5207 : }
5208 :
5209 : /* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement. */
5210 :
5211 : inline bool
5212 1313408 : gimple_debug_inline_entry_p (const gimple *s)
5213 : {
5214 8273432 : if (is_gimple_debug (s))
5215 14068 : return s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5216 :
5217 : return false;
5218 : }
5219 :
5220 : /* Return true if S is a GIMPLE_DEBUG non-binding marker statement. */
5221 :
5222 : inline bool
5223 741627940 : gimple_debug_nonbind_marker_p (const gimple *s)
5224 : {
5225 699282328 : if (is_gimple_debug (s))
5226 578872300 : return s->subcode == GIMPLE_DEBUG_BEGIN_STMT
5227 578872300 : || s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
5228 :
5229 : return false;
5230 : }
5231 :
5232 : /* Return the line number for EXPR, or return -1 if we have no line
5233 : number information for it. */
5234 : inline int
5235 0 : get_lineno (const gimple *stmt)
5236 : {
5237 0 : location_t loc;
5238 :
5239 0 : if (!stmt)
5240 : return -1;
5241 :
5242 0 : loc = gimple_location (stmt);
5243 0 : if (loc == UNKNOWN_LOCATION)
5244 : return -1;
5245 :
5246 0 : return LOCATION_LINE (loc);
5247 : }
5248 :
5249 : /* Return a pointer to the body for the OMP statement GS. */
5250 :
5251 : inline gimple_seq *
5252 485284 : gimple_omp_body_ptr (gimple *gs)
5253 : {
5254 485201 : return &static_cast <gimple_statement_omp *> (gs)->body;
5255 : }
5256 :
5257 : /* Return the body for the OMP statement GS. */
5258 :
5259 : inline gimple_seq
5260 398587 : gimple_omp_body (const gimple *gs)
5261 : {
5262 398587 : return *gimple_omp_body_ptr (const_cast <gimple *> (gs));
5263 : }
5264 :
5265 : /* Set BODY to be the body for the OMP statement GS. */
5266 :
5267 : inline void
5268 293163 : gimple_omp_set_body (gimple *gs, gimple_seq body)
5269 : {
5270 170950 : static_cast <gimple_statement_omp *> (gs)->body = body;
5271 119700 : }
5272 :
5273 :
5274 : /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
5275 :
5276 : inline tree
5277 820 : gimple_omp_critical_name (const gomp_critical *crit_stmt)
5278 : {
5279 820 : return crit_stmt->name;
5280 : }
5281 :
5282 :
5283 : /* Return a pointer to the name associated with OMP critical statement
5284 : CRIT_STMT. */
5285 :
5286 : inline tree *
5287 1352 : gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
5288 : {
5289 1352 : return &crit_stmt->name;
5290 : }
5291 :
5292 :
5293 : /* Set NAME to be the name associated with OMP critical statement
5294 : CRIT_STMT. */
5295 :
5296 : inline void
5297 546 : gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
5298 : {
5299 546 : crit_stmt->name = name;
5300 : }
5301 :
5302 :
5303 : /* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
5304 :
5305 : inline tree
5306 16 : gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
5307 : {
5308 16 : return crit_stmt->clauses;
5309 : }
5310 :
5311 :
5312 : /* Return a pointer to the clauses associated with OMP critical statement
5313 : CRIT_STMT. */
5314 :
5315 : inline tree *
5316 1352 : gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
5317 : {
5318 1352 : return &crit_stmt->clauses;
5319 : }
5320 :
5321 :
5322 : /* Set CLAUSES to be the clauses associated with OMP critical statement
5323 : CRIT_STMT. */
5324 :
5325 : inline void
5326 546 : gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
5327 : {
5328 546 : crit_stmt->clauses = clauses;
5329 : }
5330 :
5331 :
5332 : /* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
5333 :
5334 : inline tree
5335 7082 : gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
5336 : {
5337 7082 : return ord_stmt->clauses;
5338 : }
5339 :
5340 :
5341 : /* Return a pointer to the clauses associated with OMP ordered statement
5342 : ORD_STMT. */
5343 :
5344 : inline tree *
5345 5463 : gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
5346 : {
5347 5463 : return &ord_stmt->clauses;
5348 : }
5349 :
5350 :
5351 : /* Set CLAUSES to be the clauses associated with OMP ordered statement
5352 : ORD_STMT. */
5353 :
5354 : inline void
5355 1848 : gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
5356 : {
5357 1848 : ord_stmt->clauses = clauses;
5358 : }
5359 :
5360 :
5361 : /* Return the clauses associated with OMP_SCAN statement SCAN_STMT. */
5362 :
5363 : inline tree
5364 3171 : gimple_omp_scan_clauses (const gomp_scan *scan_stmt)
5365 : {
5366 3171 : return scan_stmt->clauses;
5367 : }
5368 :
5369 :
5370 : /* Return a pointer to the clauses associated with OMP scan statement
5371 : ORD_STMT. */
5372 :
5373 : inline tree *
5374 824 : gimple_omp_scan_clauses_ptr (gomp_scan *scan_stmt)
5375 : {
5376 824 : return &scan_stmt->clauses;
5377 : }
5378 :
5379 :
5380 : /* Set CLAUSES to be the clauses associated with OMP scan statement
5381 : ORD_STMT. */
5382 :
5383 : inline void
5384 1284 : gimple_omp_scan_set_clauses (gomp_scan *scan_stmt, tree clauses)
5385 : {
5386 1284 : scan_stmt->clauses = clauses;
5387 : }
5388 :
5389 :
5390 : /* Return the clauses associated with OMP_TASKGROUP statement GS. */
5391 :
5392 : inline tree
5393 1143 : gimple_omp_taskgroup_clauses (const gimple *gs)
5394 : {
5395 1143 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5396 1143 : return
5397 1143 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5398 : }
5399 :
5400 :
5401 : /* Return a pointer to the clauses associated with OMP taskgroup statement
5402 : GS. */
5403 :
5404 : inline tree *
5405 76 : gimple_omp_taskgroup_clauses_ptr (gimple *gs)
5406 : {
5407 76 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5408 76 : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5409 : }
5410 :
5411 :
5412 : /* Set CLAUSES to be the clauses associated with OMP taskgroup statement
5413 : GS. */
5414 :
5415 : inline void
5416 611 : gimple_omp_taskgroup_set_clauses (gimple *gs, tree clauses)
5417 : {
5418 611 : GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
5419 611 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5420 611 : = clauses;
5421 611 : }
5422 :
5423 :
5424 : /* Return the clauses associated with OMP_MASKED statement GS. */
5425 :
5426 : inline tree
5427 830 : gimple_omp_masked_clauses (const gimple *gs)
5428 : {
5429 830 : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5430 830 : return
5431 830 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5432 : }
5433 :
5434 :
5435 : /* Return a pointer to the clauses associated with OMP masked statement
5436 : GS. */
5437 :
5438 : inline tree *
5439 : gimple_omp_masked_clauses_ptr (gimple *gs)
5440 : {
5441 : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5442 : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5443 : }
5444 :
5445 :
5446 : /* Set CLAUSES to be the clauses associated with OMP masked statement
5447 : GS. */
5448 :
5449 : inline void
5450 487 : gimple_omp_masked_set_clauses (gimple *gs, tree clauses)
5451 : {
5452 487 : GIMPLE_CHECK (gs, GIMPLE_OMP_MASKED);
5453 487 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5454 487 : = clauses;
5455 487 : }
5456 :
5457 :
5458 : /* Return the clauses associated with OMP_SCOPE statement GS. */
5459 :
5460 : inline tree
5461 864 : gimple_omp_scope_clauses (const gimple *gs)
5462 : {
5463 864 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5464 864 : return
5465 864 : static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
5466 : }
5467 :
5468 :
5469 : /* Return a pointer to the clauses associated with OMP scope statement
5470 : GS. */
5471 :
5472 : inline tree *
5473 0 : gimple_omp_scope_clauses_ptr (gimple *gs)
5474 : {
5475 0 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5476 0 : return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
5477 : }
5478 :
5479 :
5480 : /* Set CLAUSES to be the clauses associated with OMP scope statement
5481 : GS. */
5482 :
5483 : inline void
5484 260 : gimple_omp_scope_set_clauses (gimple *gs, tree clauses)
5485 : {
5486 260 : GIMPLE_CHECK (gs, GIMPLE_OMP_SCOPE);
5487 260 : static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
5488 260 : = clauses;
5489 260 : }
5490 :
5491 : /* Return the clauses associated with OMP_DISPATCH statement GS. */
5492 :
5493 : inline tree
5494 401 : gimple_omp_dispatch_clauses (const gimple *gs)
5495 : {
5496 401 : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5497 401 : return static_cast<const gimple_statement_omp_single_layout *> (gs)->clauses;
5498 : }
5499 :
5500 : /* Return a pointer to the clauses associated with OMP dispatch statement
5501 : GS. */
5502 :
5503 : inline tree *
5504 : gimple_omp_dispatch_clauses_ptr (gimple *gs)
5505 : {
5506 : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5507 : return &static_cast<gimple_statement_omp_single_layout *> (gs)->clauses;
5508 : }
5509 :
5510 : /* Set CLAUSES to be the clauses associated with OMP dispatch statement
5511 : GS. */
5512 :
5513 : inline void
5514 852 : gimple_omp_dispatch_set_clauses (gimple *gs, tree clauses)
5515 : {
5516 852 : GIMPLE_CHECK (gs, GIMPLE_OMP_DISPATCH);
5517 852 : static_cast<gimple_statement_omp_single_layout *> (gs)->clauses = clauses;
5518 852 : }
5519 :
5520 : /* Return the clauses associated with OMP_INTEROP statement GS. */
5521 :
5522 : inline tree
5523 164 : gimple_omp_interop_clauses (const gimple *gs)
5524 : {
5525 164 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5526 164 : return static_cast<const gimple_statement_omp_single_layout *> (gs)->clauses;
5527 : }
5528 :
5529 : /* Return a pointer to the clauses associated with OMP_INTEROP statement GS. */
5530 :
5531 : inline tree *
5532 35 : gimple_omp_interop_clauses_ptr (gimple *gs)
5533 : {
5534 35 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5535 35 : return &static_cast<gimple_statement_omp_single_layout *> (gs)->clauses;
5536 : }
5537 :
5538 : /* Set CLAUSES to be the clauses associated with OMP interop statement
5539 : GS. */
5540 :
5541 : inline void
5542 612 : gimple_omp_interop_set_clauses (gimple *gs, tree clauses)
5543 : {
5544 612 : GIMPLE_CHECK (gs, GIMPLE_OMP_INTEROP);
5545 612 : static_cast<gimple_statement_omp_single_layout *> (gs)->clauses = clauses;
5546 612 : }
5547 :
5548 : /* Return the kind of the OMP_FOR statemement G. */
5549 :
5550 : inline int
5551 1193320 : gimple_omp_for_kind (const gimple *g)
5552 : {
5553 1193320 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5554 1193320 : return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
5555 : }
5556 :
5557 :
5558 : /* Set the kind of the OMP_FOR statement G. */
5559 :
5560 : inline void
5561 53365 : gimple_omp_for_set_kind (gomp_for *g, int kind)
5562 : {
5563 53365 : g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
5564 53365 : | (kind & GF_OMP_FOR_KIND_MASK);
5565 : }
5566 :
5567 :
5568 : /* Return true if OMP_FOR statement G has the
5569 : GF_OMP_FOR_COMBINED flag set. */
5570 :
5571 : inline bool
5572 162931 : gimple_omp_for_combined_p (const gimple *g)
5573 : {
5574 162931 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5575 162931 : return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
5576 : }
5577 :
5578 :
5579 : /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
5580 : the boolean value of COMBINED_P. */
5581 :
5582 : inline void
5583 15512 : gimple_omp_for_set_combined_p (gomp_for *g, bool combined_p)
5584 : {
5585 15512 : if (combined_p)
5586 1586 : g->subcode |= GF_OMP_FOR_COMBINED;
5587 : else
5588 : g->subcode &= ~GF_OMP_FOR_COMBINED;
5589 13926 : }
5590 :
5591 :
5592 : /* Return true if the OMP_FOR statement G has the
5593 : GF_OMP_FOR_COMBINED_INTO flag set. */
5594 :
5595 : inline bool
5596 171398 : gimple_omp_for_combined_into_p (const gimple *g)
5597 : {
5598 171398 : GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
5599 171398 : return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
5600 : }
5601 :
5602 :
5603 : /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
5604 : on the boolean value of COMBINED_P. */
5605 :
5606 : inline void
5607 15512 : gimple_omp_for_set_combined_into_p (gomp_for *g, bool combined_p)
5608 : {
5609 15512 : if (combined_p)
5610 15512 : g->subcode |= GF_OMP_FOR_COMBINED_INTO;
5611 : else
5612 : g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
5613 : }
5614 :
5615 :
5616 : /* Return the clauses associated with the OMP_FOR statement GS. */
5617 :
5618 : inline tree
5619 607122 : gimple_omp_for_clauses (const gimple *gs)
5620 : {
5621 607122 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5622 607122 : return omp_for_stmt->clauses;
5623 : }
5624 :
5625 :
5626 : /* Return a pointer to the clauses associated with the OMP_FOR statement
5627 : GS. */
5628 :
5629 : inline tree *
5630 257257 : gimple_omp_for_clauses_ptr (gimple *gs)
5631 : {
5632 257257 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5633 257257 : return &omp_for_stmt->clauses;
5634 : }
5635 :
5636 :
5637 : /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
5638 : GS. */
5639 :
5640 : inline void
5641 67821 : gimple_omp_for_set_clauses (gimple *gs, tree clauses)
5642 : {
5643 67821 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5644 67821 : omp_for_stmt->clauses = clauses;
5645 11583 : }
5646 :
5647 :
5648 : /* Get the collapse count of the OMP_FOR statement GS. */
5649 :
5650 : inline size_t
5651 784728 : gimple_omp_for_collapse (const gimple *gs)
5652 : {
5653 784728 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5654 784728 : return omp_for_stmt->collapse;
5655 : }
5656 :
5657 :
5658 : /* Return the condition code associated with the OMP_FOR statement GS. */
5659 :
5660 : inline enum tree_code
5661 199588 : gimple_omp_for_cond (const gimple *gs, size_t i)
5662 : {
5663 199588 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5664 199588 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5665 199588 : return omp_for_stmt->iter[i].cond;
5666 : }
5667 :
5668 :
5669 : /* Set COND to be the condition code for the OMP_FOR statement GS. */
5670 :
5671 : inline void
5672 75665 : gimple_omp_for_set_cond (gimple *gs, size_t i, enum tree_code cond)
5673 : {
5674 75665 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5675 75665 : gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
5676 : && i < omp_for_stmt->collapse);
5677 75665 : omp_for_stmt->iter[i].cond = cond;
5678 75665 : }
5679 :
5680 :
5681 : /* Return the index variable for the OMP_FOR statement GS. */
5682 :
5683 : inline tree
5684 217331 : gimple_omp_for_index (const gimple *gs, size_t i)
5685 : {
5686 217331 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5687 217331 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5688 217331 : return omp_for_stmt->iter[i].index;
5689 : }
5690 :
5691 :
5692 : /* Return a pointer to the index variable for the OMP_FOR statement GS. */
5693 :
5694 : inline tree *
5695 355417 : gimple_omp_for_index_ptr (gimple *gs, size_t i)
5696 : {
5697 355417 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5698 355417 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5699 355417 : return &omp_for_stmt->iter[i].index;
5700 : }
5701 :
5702 :
5703 : /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
5704 :
5705 : inline void
5706 75665 : gimple_omp_for_set_index (gimple *gs, size_t i, tree index)
5707 : {
5708 75665 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5709 75665 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5710 75665 : omp_for_stmt->iter[i].index = index;
5711 75665 : }
5712 :
5713 :
5714 : /* Return the initial value for the OMP_FOR statement GS. */
5715 :
5716 : inline tree
5717 264234 : gimple_omp_for_initial (const gimple *gs, size_t i)
5718 : {
5719 264234 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5720 264234 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5721 264234 : return omp_for_stmt->iter[i].initial;
5722 : }
5723 :
5724 :
5725 : /* Return a pointer to the initial value for the OMP_FOR statement GS. */
5726 :
5727 : inline tree *
5728 423589 : gimple_omp_for_initial_ptr (gimple *gs, size_t i)
5729 : {
5730 423589 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5731 423589 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5732 423589 : return &omp_for_stmt->iter[i].initial;
5733 : }
5734 :
5735 :
5736 : /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
5737 :
5738 : inline void
5739 75665 : gimple_omp_for_set_initial (gimple *gs, size_t i, tree initial)
5740 : {
5741 75665 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5742 75665 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5743 75665 : omp_for_stmt->iter[i].initial = initial;
5744 75665 : }
5745 :
5746 :
5747 : /* Return the final value for the OMP_FOR statement GS. */
5748 :
5749 : inline tree
5750 264052 : gimple_omp_for_final (const gimple *gs, size_t i)
5751 : {
5752 264052 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5753 264052 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5754 264052 : return omp_for_stmt->iter[i].final;
5755 : }
5756 :
5757 :
5758 : /* Return a pointer to the final value for the OMP_FOR statement GS. */
5759 :
5760 : inline tree *
5761 423589 : gimple_omp_for_final_ptr (gimple *gs, size_t i)
5762 : {
5763 423589 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5764 423589 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5765 423589 : return &omp_for_stmt->iter[i].final;
5766 : }
5767 :
5768 :
5769 : /* Set FINAL to be the final value for the OMP_FOR statement GS. */
5770 :
5771 : inline void
5772 75665 : gimple_omp_for_set_final (gimple *gs, size_t i, tree final)
5773 : {
5774 75665 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5775 75665 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5776 75665 : omp_for_stmt->iter[i].final = final;
5777 75665 : }
5778 :
5779 :
5780 : /* Return the increment value for the OMP_FOR statement GS. */
5781 :
5782 : inline tree
5783 272068 : gimple_omp_for_incr (const gimple *gs, size_t i)
5784 : {
5785 272068 : const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
5786 272068 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5787 272068 : return omp_for_stmt->iter[i].incr;
5788 : }
5789 :
5790 :
5791 : /* Return a pointer to the increment value for the OMP_FOR statement GS. */
5792 :
5793 : inline tree *
5794 351291 : gimple_omp_for_incr_ptr (gimple *gs, size_t i)
5795 : {
5796 351291 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5797 351291 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5798 351291 : return &omp_for_stmt->iter[i].incr;
5799 : }
5800 :
5801 :
5802 : /* Set INCR to be the increment value for the OMP_FOR statement GS. */
5803 :
5804 : inline void
5805 75665 : gimple_omp_for_set_incr (gimple *gs, size_t i, tree incr)
5806 : {
5807 75665 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5808 75665 : gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5809 75665 : omp_for_stmt->iter[i].incr = incr;
5810 75665 : }
5811 :
5812 :
5813 : /* Return a pointer to the sequence of statements to execute before the OMP_FOR
5814 : statement GS starts. */
5815 :
5816 : inline gimple_seq *
5817 308896 : gimple_omp_for_pre_body_ptr (gimple *gs)
5818 : {
5819 209247 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5820 209247 : return &omp_for_stmt->pre_body;
5821 : }
5822 :
5823 :
5824 : /* Return the sequence of statements to execute before the OMP_FOR
5825 : statement GS starts. */
5826 :
5827 : inline gimple_seq
5828 128180 : gimple_omp_for_pre_body (const gimple *gs)
5829 : {
5830 128180 : return *gimple_omp_for_pre_body_ptr (const_cast <gimple *> (gs));
5831 : }
5832 :
5833 :
5834 : /* Set PRE_BODY to be the sequence of statements to execute before the
5835 : OMP_FOR statement GS starts. */
5836 :
5837 : inline void
5838 52310 : gimple_omp_for_set_pre_body (gimple *gs, gimple_seq pre_body)
5839 : {
5840 52310 : gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
5841 52310 : omp_for_stmt->pre_body = pre_body;
5842 3571 : }
5843 :
5844 : /* Return the clauses associated with OMP_PARALLEL GS. */
5845 :
5846 : inline tree
5847 116361 : gimple_omp_parallel_clauses (const gimple *gs)
5848 : {
5849 116361 : const gomp_parallel *omp_parallel_stmt = as_a <const gomp_parallel *> (gs);
5850 116361 : return omp_parallel_stmt->clauses;
5851 : }
5852 :
5853 :
5854 : /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
5855 :
5856 : inline tree *
5857 65764 : gimple_omp_parallel_clauses_ptr (gomp_parallel *omp_parallel_stmt)
5858 : {
5859 65764 : return &omp_parallel_stmt->clauses;
5860 : }
5861 :
5862 :
5863 : /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
5864 :
5865 : inline void
5866 18492 : gimple_omp_parallel_set_clauses (gomp_parallel *omp_parallel_stmt,
5867 : tree clauses)
5868 : {
5869 67 : omp_parallel_stmt->clauses = clauses;
5870 67 : }
5871 :
5872 :
5873 : /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
5874 :
5875 : inline tree
5876 18411 : gimple_omp_parallel_child_fn (const gomp_parallel *omp_parallel_stmt)
5877 : {
5878 18411 : return omp_parallel_stmt->child_fn;
5879 : }
5880 :
5881 : /* Return a pointer to the child function used to hold the body of
5882 : OMP_PARALLEL_STMT. */
5883 :
5884 : inline tree *
5885 65764 : gimple_omp_parallel_child_fn_ptr (gomp_parallel *omp_parallel_stmt)
5886 : {
5887 65764 : return &omp_parallel_stmt->child_fn;
5888 : }
5889 :
5890 :
5891 : /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
5892 :
5893 : inline void
5894 36544 : gimple_omp_parallel_set_child_fn (gomp_parallel *omp_parallel_stmt,
5895 : tree child_fn)
5896 : {
5897 18119 : omp_parallel_stmt->child_fn = child_fn;
5898 : }
5899 :
5900 :
5901 : /* Return the artificial argument used to send variables and values
5902 : from the parent to the children threads in OMP_PARALLEL_STMT. */
5903 :
5904 : inline tree
5905 16403 : gimple_omp_parallel_data_arg (const gomp_parallel *omp_parallel_stmt)
5906 : {
5907 16403 : return omp_parallel_stmt->data_arg;
5908 : }
5909 :
5910 :
5911 : /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
5912 :
5913 : inline tree *
5914 65764 : gimple_omp_parallel_data_arg_ptr (gomp_parallel *omp_parallel_stmt)
5915 : {
5916 65764 : return &omp_parallel_stmt->data_arg;
5917 : }
5918 :
5919 :
5920 : /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
5921 :
5922 : inline void
5923 18425 : gimple_omp_parallel_set_data_arg (gomp_parallel *omp_parallel_stmt,
5924 : tree data_arg)
5925 : {
5926 0 : omp_parallel_stmt->data_arg = data_arg;
5927 : }
5928 :
5929 : /* Return the clauses associated with OMP_TASK GS. */
5930 :
5931 : inline tree
5932 27746 : gimple_omp_task_clauses (const gimple *gs)
5933 : {
5934 27746 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
5935 27746 : return omp_task_stmt->clauses;
5936 : }
5937 :
5938 :
5939 : /* Return a pointer to the clauses associated with OMP_TASK GS. */
5940 :
5941 : inline tree *
5942 16924 : gimple_omp_task_clauses_ptr (gimple *gs)
5943 : {
5944 16924 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5945 16924 : return &omp_task_stmt->clauses;
5946 : }
5947 :
5948 :
5949 : /* Set CLAUSES to be the list of clauses associated with OMP_TASK
5950 : GS. */
5951 :
5952 : inline void
5953 5951 : gimple_omp_task_set_clauses (gimple *gs, tree clauses)
5954 : {
5955 5951 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
5956 5951 : omp_task_stmt->clauses = clauses;
5957 517 : }
5958 :
5959 :
5960 : /* Return true if OMP task statement G has the
5961 : GF_OMP_TASK_TASKLOOP flag set. */
5962 :
5963 : inline bool
5964 21880 : gimple_omp_task_taskloop_p (const gimple *g)
5965 : {
5966 21880 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5967 21880 : return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
5968 : }
5969 :
5970 :
5971 : /* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
5972 : value of TASKLOOP_P. */
5973 :
5974 : inline void
5975 1586 : gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
5976 : {
5977 1586 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5978 1586 : if (taskloop_p)
5979 1586 : g->subcode |= GF_OMP_TASK_TASKLOOP;
5980 : else
5981 0 : g->subcode &= ~GF_OMP_TASK_TASKLOOP;
5982 1586 : }
5983 :
5984 :
5985 : /* Return true if OMP task statement G has the
5986 : GF_OMP_TASK_TASKWAIT flag set. */
5987 :
5988 : inline bool
5989 24752 : gimple_omp_task_taskwait_p (const gimple *g)
5990 : {
5991 24752 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
5992 24752 : return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKWAIT) != 0;
5993 : }
5994 :
5995 :
5996 : /* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
5997 : value of TASKWAIT_P. */
5998 :
5999 : inline void
6000 92 : gimple_omp_task_set_taskwait_p (gimple *g, bool taskwait_p)
6001 : {
6002 92 : GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
6003 92 : if (taskwait_p)
6004 92 : g->subcode |= GF_OMP_TASK_TASKWAIT;
6005 : else
6006 0 : g->subcode &= ~GF_OMP_TASK_TASKWAIT;
6007 92 : }
6008 :
6009 :
6010 : /* Return the child function used to hold the body of OMP_TASK GS. */
6011 :
6012 : inline tree
6013 4120 : gimple_omp_task_child_fn (const gimple *gs)
6014 : {
6015 4120 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6016 4120 : return omp_task_stmt->child_fn;
6017 : }
6018 :
6019 : /* Return a pointer to the child function used to hold the body of
6020 : OMP_TASK GS. */
6021 :
6022 : inline tree *
6023 15737 : gimple_omp_task_child_fn_ptr (gimple *gs)
6024 : {
6025 15737 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6026 15737 : return &omp_task_stmt->child_fn;
6027 : }
6028 :
6029 :
6030 : /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6031 :
6032 : inline void
6033 10695 : gimple_omp_task_set_child_fn (gimple *gs, tree child_fn)
6034 : {
6035 10695 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6036 10695 : omp_task_stmt->child_fn = child_fn;
6037 : }
6038 :
6039 :
6040 : /* Return the artificial argument used to send variables and values
6041 : from the parent to the children threads in OMP_TASK GS. */
6042 :
6043 : inline tree
6044 3781 : gimple_omp_task_data_arg (const gimple *gs)
6045 : {
6046 3781 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6047 3781 : return omp_task_stmt->data_arg;
6048 : }
6049 :
6050 :
6051 : /* Return a pointer to the data argument for OMP_TASK GS. */
6052 :
6053 : inline tree *
6054 15737 : gimple_omp_task_data_arg_ptr (gimple *gs)
6055 : {
6056 15737 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6057 15737 : return &omp_task_stmt->data_arg;
6058 : }
6059 :
6060 :
6061 : /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6062 :
6063 : inline void
6064 5434 : gimple_omp_task_set_data_arg (gimple *gs, tree data_arg)
6065 : {
6066 5434 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6067 5434 : omp_task_stmt->data_arg = data_arg;
6068 : }
6069 :
6070 :
6071 : /* Return the clauses associated with OMP_TASK GS. */
6072 :
6073 : inline tree
6074 58972 : gimple_omp_taskreg_clauses (const gimple *gs)
6075 : {
6076 58972 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6077 58972 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6078 58972 : return omp_taskreg_stmt->clauses;
6079 : }
6080 :
6081 :
6082 : /* Return a pointer to the clauses associated with OMP_TASK GS. */
6083 :
6084 : inline tree *
6085 2784 : gimple_omp_taskreg_clauses_ptr (gimple *gs)
6086 : {
6087 2784 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6088 2784 : = as_a <gimple_statement_omp_taskreg *> (gs);
6089 2784 : return &omp_taskreg_stmt->clauses;
6090 : }
6091 :
6092 :
6093 : /* Set CLAUSES to be the list of clauses associated with OMP_TASK
6094 : GS. */
6095 :
6096 : inline void
6097 19806 : gimple_omp_taskreg_set_clauses (gimple *gs, tree clauses)
6098 : {
6099 19806 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6100 19806 : = as_a <gimple_statement_omp_taskreg *> (gs);
6101 19806 : omp_taskreg_stmt->clauses = clauses;
6102 964 : }
6103 :
6104 :
6105 : /* Return the child function used to hold the body of OMP_TASK GS. */
6106 :
6107 : inline tree
6108 29368 : gimple_omp_taskreg_child_fn (const gimple *gs)
6109 : {
6110 29368 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6111 29368 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6112 29368 : return omp_taskreg_stmt->child_fn;
6113 : }
6114 :
6115 : /* Return a pointer to the child function used to hold the body of
6116 : OMP_TASK GS. */
6117 :
6118 : inline tree *
6119 : gimple_omp_taskreg_child_fn_ptr (gimple *gs)
6120 : {
6121 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6122 : = as_a <gimple_statement_omp_taskreg *> (gs);
6123 : return &omp_taskreg_stmt->child_fn;
6124 : }
6125 :
6126 :
6127 : /* Set CHILD_FN to be the child function for OMP_TASK GS. */
6128 :
6129 : inline void
6130 : gimple_omp_taskreg_set_child_fn (gimple *gs, tree child_fn)
6131 : {
6132 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6133 : = as_a <gimple_statement_omp_taskreg *> (gs);
6134 : omp_taskreg_stmt->child_fn = child_fn;
6135 : }
6136 :
6137 :
6138 : /* Return the artificial argument used to send variables and values
6139 : from the parent to the children threads in OMP_TASK GS. */
6140 :
6141 : inline tree
6142 40612 : gimple_omp_taskreg_data_arg (const gimple *gs)
6143 : {
6144 40612 : const gimple_statement_omp_taskreg *omp_taskreg_stmt
6145 18076 : = as_a <const gimple_statement_omp_taskreg *> (gs);
6146 40612 : return omp_taskreg_stmt->data_arg;
6147 : }
6148 :
6149 :
6150 : /* Return a pointer to the data argument for OMP_TASK GS. */
6151 :
6152 : inline tree *
6153 : gimple_omp_taskreg_data_arg_ptr (gimple *gs)
6154 : {
6155 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6156 : = as_a <gimple_statement_omp_taskreg *> (gs);
6157 : return &omp_taskreg_stmt->data_arg;
6158 : }
6159 :
6160 :
6161 : /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
6162 :
6163 : inline void
6164 17922 : gimple_omp_taskreg_set_data_arg (gimple *gs, tree data_arg)
6165 : {
6166 17922 : gimple_statement_omp_taskreg *omp_taskreg_stmt
6167 17922 : = as_a <gimple_statement_omp_taskreg *> (gs);
6168 17922 : omp_taskreg_stmt->data_arg = data_arg;
6169 17922 : }
6170 :
6171 :
6172 : /* Return the copy function used to hold the body of OMP_TASK GS. */
6173 :
6174 : inline tree
6175 4785 : gimple_omp_task_copy_fn (const gimple *gs)
6176 : {
6177 4785 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6178 4785 : return omp_task_stmt->copy_fn;
6179 : }
6180 :
6181 : /* Return a pointer to the copy function used to hold the body of
6182 : OMP_TASK GS. */
6183 :
6184 : inline tree *
6185 15737 : gimple_omp_task_copy_fn_ptr (gimple *gs)
6186 : {
6187 15737 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6188 15737 : return &omp_task_stmt->copy_fn;
6189 : }
6190 :
6191 :
6192 : /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
6193 :
6194 : inline void
6195 5978 : gimple_omp_task_set_copy_fn (gimple *gs, tree copy_fn)
6196 : {
6197 5978 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6198 5978 : omp_task_stmt->copy_fn = copy_fn;
6199 544 : }
6200 :
6201 :
6202 : /* Return size of the data block in bytes in OMP_TASK GS. */
6203 :
6204 : inline tree
6205 3777 : gimple_omp_task_arg_size (const gimple *gs)
6206 : {
6207 3777 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6208 3777 : return omp_task_stmt->arg_size;
6209 : }
6210 :
6211 :
6212 : /* Return a pointer to the data block size for OMP_TASK GS. */
6213 :
6214 : inline tree *
6215 15737 : gimple_omp_task_arg_size_ptr (gimple *gs)
6216 : {
6217 15737 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6218 15737 : return &omp_task_stmt->arg_size;
6219 : }
6220 :
6221 :
6222 : /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
6223 :
6224 : inline void
6225 10695 : gimple_omp_task_set_arg_size (gimple *gs, tree arg_size)
6226 : {
6227 10695 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6228 10695 : omp_task_stmt->arg_size = arg_size;
6229 : }
6230 :
6231 :
6232 : /* Return align of the data block in bytes in OMP_TASK GS. */
6233 :
6234 : inline tree
6235 3777 : gimple_omp_task_arg_align (const gimple *gs)
6236 : {
6237 3777 : const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
6238 3777 : return omp_task_stmt->arg_align;
6239 : }
6240 :
6241 :
6242 : /* Return a pointer to the data block align for OMP_TASK GS. */
6243 :
6244 : inline tree *
6245 15737 : gimple_omp_task_arg_align_ptr (gimple *gs)
6246 : {
6247 15737 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6248 15737 : return &omp_task_stmt->arg_align;
6249 : }
6250 :
6251 :
6252 : /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
6253 :
6254 : inline void
6255 10695 : gimple_omp_task_set_arg_align (gimple *gs, tree arg_align)
6256 : {
6257 10695 : gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
6258 5261 : omp_task_stmt->arg_align = arg_align;
6259 1838 : }
6260 :
6261 :
6262 : /* Return the clauses associated with OMP_SINGLE GS. */
6263 :
6264 : inline tree
6265 3610 : gimple_omp_single_clauses (const gimple *gs)
6266 : {
6267 3610 : const gomp_single *omp_single_stmt = as_a <const gomp_single *> (gs);
6268 3610 : return omp_single_stmt->clauses;
6269 : }
6270 :
6271 :
6272 : /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
6273 :
6274 : inline tree *
6275 5036 : gimple_omp_single_clauses_ptr (gimple *gs)
6276 : {
6277 5036 : gomp_single *omp_single_stmt = as_a <gomp_single *> (gs);
6278 5036 : return &omp_single_stmt->clauses;
6279 : }
6280 :
6281 :
6282 : /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
6283 :
6284 : inline void
6285 1275 : gimple_omp_single_set_clauses (gomp_single *omp_single_stmt, tree clauses)
6286 : {
6287 0 : omp_single_stmt->clauses = clauses;
6288 : }
6289 :
6290 :
6291 : /* Return the clauses associated with OMP_TARGET GS. */
6292 :
6293 : inline tree
6294 182759 : gimple_omp_target_clauses (const gimple *gs)
6295 : {
6296 182759 : const gomp_target *omp_target_stmt = as_a <const gomp_target *> (gs);
6297 182759 : return omp_target_stmt->clauses;
6298 : }
6299 :
6300 :
6301 : /* Return a pointer to the clauses associated with OMP_TARGET GS. */
6302 :
6303 : inline tree *
6304 163500 : gimple_omp_target_clauses_ptr (gimple *gs)
6305 : {
6306 163500 : gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
6307 163500 : return &omp_target_stmt->clauses;
6308 : }
6309 :
6310 :
6311 : /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
6312 :
6313 : inline void
6314 43245 : gimple_omp_target_set_clauses (gomp_target *omp_target_stmt,
6315 : tree clauses)
6316 : {
6317 659 : omp_target_stmt->clauses = clauses;
6318 88 : }
6319 :
6320 :
6321 : /* Return the kind of the OMP_TARGET G. */
6322 :
6323 : inline int
6324 1563132 : gimple_omp_target_kind (const gimple *g)
6325 : {
6326 1563132 : GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
6327 1563132 : return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
6328 : }
6329 :
6330 :
6331 : /* Set the kind of the OMP_TARGET G. */
6332 :
6333 : inline void
6334 42498 : gimple_omp_target_set_kind (gomp_target *g, int kind)
6335 : {
6336 42498 : g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
6337 42498 : | (kind & GF_OMP_TARGET_KIND_MASK);
6338 : }
6339 :
6340 :
6341 : /* Return the child function used to hold the body of OMP_TARGET_STMT. */
6342 :
6343 : inline tree
6344 27858 : gimple_omp_target_child_fn (const gomp_target *omp_target_stmt)
6345 : {
6346 27858 : return omp_target_stmt->child_fn;
6347 : }
6348 :
6349 : /* Return a pointer to the child function used to hold the body of
6350 : OMP_TARGET_STMT. */
6351 :
6352 : inline tree *
6353 147955 : gimple_omp_target_child_fn_ptr (gomp_target *omp_target_stmt)
6354 : {
6355 147955 : return &omp_target_stmt->child_fn;
6356 : }
6357 :
6358 :
6359 : /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
6360 :
6361 : inline void
6362 24487 : gimple_omp_target_set_child_fn (gomp_target *omp_target_stmt,
6363 : tree child_fn)
6364 : {
6365 24487 : omp_target_stmt->child_fn = child_fn;
6366 24487 : }
6367 :
6368 :
6369 : /* Return the artificial argument used to send variables and values
6370 : from the parent to the children threads in OMP_TARGET_STMT. */
6371 :
6372 : inline tree
6373 57411 : gimple_omp_target_data_arg (const gomp_target *omp_target_stmt)
6374 : {
6375 57411 : return omp_target_stmt->data_arg;
6376 : }
6377 :
6378 :
6379 : /* Return a pointer to the data argument for OMP_TARGET GS. */
6380 :
6381 : inline tree *
6382 147955 : gimple_omp_target_data_arg_ptr (gomp_target *omp_target_stmt)
6383 : {
6384 147955 : return &omp_target_stmt->data_arg;
6385 : }
6386 :
6387 :
6388 : /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
6389 :
6390 : inline void
6391 31687 : gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
6392 : tree data_arg)
6393 : {
6394 31687 : omp_target_stmt->data_arg = data_arg;
6395 : }
6396 :
6397 :
6398 : /* Return the Gimple sequence used to store loops for OpenMP iterators used
6399 : by OMP_TARGET_STMT. */
6400 :
6401 : inline gimple_seq
6402 39018 : gimple_omp_target_iterator_loops (const gomp_target *omp_target_stmt)
6403 : {
6404 39018 : return omp_target_stmt->iterator_loops;
6405 : }
6406 :
6407 :
6408 : /* Return a pointer to the Gimple sequence used to store loops for OpenMP
6409 : iterators used by OMP_TARGET GS. */
6410 :
6411 : inline gimple_seq *
6412 5285 : gimple_omp_target_iterator_loops_ptr (gimple *gs)
6413 : {
6414 5285 : gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
6415 5285 : return &omp_target_stmt->iterator_loops;
6416 : }
6417 :
6418 :
6419 : /* Set ITERATOR_LOOPS to be the Gimple sequence used to store loops
6420 : constructed for OpenMP iterators in OMP_TARGET_STMT. */
6421 :
6422 : inline void
6423 79052 : gimple_omp_target_set_iterator_loops (gomp_target *omp_target_stmt,
6424 : gimple_seq iterator_loops)
6425 : {
6426 79052 : omp_target_stmt->iterator_loops = iterator_loops;
6427 : }
6428 :
6429 :
6430 : /* Return the clauses associated with OMP_TEAMS GS. */
6431 :
6432 : inline tree
6433 35405 : gimple_omp_teams_clauses (const gimple *gs)
6434 : {
6435 35405 : const gomp_teams *omp_teams_stmt = as_a <const gomp_teams *> (gs);
6436 35405 : return omp_teams_stmt->clauses;
6437 : }
6438 :
6439 :
6440 : /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
6441 :
6442 : inline tree *
6443 33787 : gimple_omp_teams_clauses_ptr (gimple *gs)
6444 : {
6445 33787 : gomp_teams *omp_teams_stmt = as_a <gomp_teams *> (gs);
6446 33787 : return &omp_teams_stmt->clauses;
6447 : }
6448 :
6449 :
6450 : /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
6451 :
6452 : inline void
6453 8793 : gimple_omp_teams_set_clauses (gomp_teams *omp_teams_stmt, tree clauses)
6454 : {
6455 8793 : omp_teams_stmt->clauses = clauses;
6456 0 : }
6457 :
6458 : /* Return the child function used to hold the body of OMP_TEAMS_STMT. */
6459 :
6460 : inline tree
6461 2496 : gimple_omp_teams_child_fn (const gomp_teams *omp_teams_stmt)
6462 : {
6463 2496 : return omp_teams_stmt->child_fn;
6464 : }
6465 :
6466 : /* Return a pointer to the child function used to hold the body of
6467 : OMP_TEAMS_STMT. */
6468 :
6469 : inline tree *
6470 : gimple_omp_teams_child_fn_ptr (gomp_teams *omp_teams_stmt)
6471 : {
6472 : return &omp_teams_stmt->child_fn;
6473 : }
6474 :
6475 :
6476 : /* Set CHILD_FN to be the child function for OMP_TEAMS_STMT. */
6477 :
6478 : inline void
6479 2618 : gimple_omp_teams_set_child_fn (gomp_teams *omp_teams_stmt, tree child_fn)
6480 : {
6481 2618 : omp_teams_stmt->child_fn = child_fn;
6482 : }
6483 :
6484 :
6485 : /* Return the artificial argument used to send variables and values
6486 : from the parent to the children threads in OMP_TEAMS_STMT. */
6487 :
6488 : inline tree
6489 2496 : gimple_omp_teams_data_arg (const gomp_teams *omp_teams_stmt)
6490 : {
6491 2496 : return omp_teams_stmt->data_arg;
6492 : }
6493 :
6494 :
6495 : /* Return a pointer to the data argument for OMP_TEAMS_STMT. */
6496 :
6497 : inline tree *
6498 : gimple_omp_teams_data_arg_ptr (gomp_teams *omp_teams_stmt)
6499 : {
6500 : return &omp_teams_stmt->data_arg;
6501 : }
6502 :
6503 :
6504 : /* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT. */
6505 :
6506 : inline void
6507 : gimple_omp_teams_set_data_arg (gomp_teams *omp_teams_stmt, tree data_arg)
6508 : {
6509 : omp_teams_stmt->data_arg = data_arg;
6510 : }
6511 :
6512 : /* Return the host flag of an OMP_TEAMS_STMT. */
6513 :
6514 : inline bool
6515 106217 : gimple_omp_teams_host (const gomp_teams *omp_teams_stmt)
6516 : {
6517 106217 : return (gimple_omp_subcode (omp_teams_stmt) & GF_OMP_TEAMS_HOST) != 0;
6518 : }
6519 :
6520 : /* Set host flag of an OMP_TEAMS_STMT to VALUE. */
6521 :
6522 : inline void
6523 2632 : gimple_omp_teams_set_host (gomp_teams *omp_teams_stmt, bool value)
6524 : {
6525 2632 : if (value)
6526 2632 : omp_teams_stmt->subcode |= GF_OMP_TEAMS_HOST;
6527 : else
6528 : omp_teams_stmt->subcode &= ~GF_OMP_TEAMS_HOST;
6529 : }
6530 :
6531 : /* Return the clauses associated with OMP_SECTIONS GS. */
6532 :
6533 : inline tree
6534 3297 : gimple_omp_sections_clauses (const gimple *gs)
6535 : {
6536 2919 : const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6537 3297 : return omp_sections_stmt->clauses;
6538 : }
6539 :
6540 :
6541 : /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
6542 :
6543 : inline tree *
6544 2016 : gimple_omp_sections_clauses_ptr (gimple *gs)
6545 : {
6546 2016 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6547 2016 : return &omp_sections_stmt->clauses;
6548 : }
6549 :
6550 :
6551 : /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
6552 : GS. */
6553 :
6554 : inline void
6555 634 : gimple_omp_sections_set_clauses (gimple *gs, tree clauses)
6556 : {
6557 634 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6558 8 : omp_sections_stmt->clauses = clauses;
6559 : }
6560 :
6561 :
6562 : /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
6563 : in GS. */
6564 :
6565 : inline tree
6566 420 : gimple_omp_sections_control (const gimple *gs)
6567 : {
6568 420 : const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
6569 420 : return omp_sections_stmt->control;
6570 : }
6571 :
6572 :
6573 : /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
6574 : GS. */
6575 :
6576 : inline tree *
6577 1554 : gimple_omp_sections_control_ptr (gimple *gs)
6578 : {
6579 1554 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6580 1554 : return &omp_sections_stmt->control;
6581 : }
6582 :
6583 :
6584 : /* Set CONTROL to be the set of clauses associated with the
6585 : GIMPLE_OMP_SECTIONS in GS. */
6586 :
6587 : inline void
6588 378 : gimple_omp_sections_set_control (gimple *gs, tree control)
6589 : {
6590 378 : gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
6591 378 : omp_sections_stmt->control = control;
6592 : }
6593 :
6594 :
6595 : /* Set the value being stored in an atomic store. */
6596 :
6597 : inline void
6598 10304 : gimple_omp_atomic_store_set_val (gomp_atomic_store *store_stmt, tree val)
6599 : {
6600 10304 : store_stmt->val = val;
6601 0 : }
6602 :
6603 :
6604 : /* Return the value being stored in an atomic store. */
6605 :
6606 : inline tree
6607 10178 : gimple_omp_atomic_store_val (const gomp_atomic_store *store_stmt)
6608 : {
6609 10178 : return store_stmt->val;
6610 : }
6611 :
6612 :
6613 : /* Return a pointer to the value being stored in an atomic store. */
6614 :
6615 : inline tree *
6616 50012 : gimple_omp_atomic_store_val_ptr (gomp_atomic_store *store_stmt)
6617 : {
6618 50012 : return &store_stmt->val;
6619 : }
6620 :
6621 :
6622 : /* Set the LHS of an atomic load. */
6623 :
6624 : inline void
6625 10304 : gimple_omp_atomic_load_set_lhs (gomp_atomic_load *load_stmt, tree lhs)
6626 : {
6627 10304 : load_stmt->lhs = lhs;
6628 : }
6629 :
6630 :
6631 : /* Get the LHS of an atomic load. */
6632 :
6633 : inline tree
6634 10178 : gimple_omp_atomic_load_lhs (const gomp_atomic_load *load_stmt)
6635 : {
6636 10178 : return load_stmt->lhs;
6637 : }
6638 :
6639 :
6640 : /* Return a pointer to the LHS of an atomic load. */
6641 :
6642 : inline tree *
6643 49006 : gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load *load_stmt)
6644 : {
6645 49006 : return &load_stmt->lhs;
6646 : }
6647 :
6648 :
6649 : /* Set the RHS of an atomic load. */
6650 :
6651 : inline void
6652 10304 : gimple_omp_atomic_load_set_rhs (gomp_atomic_load *load_stmt, tree rhs)
6653 : {
6654 10304 : load_stmt->rhs = rhs;
6655 0 : }
6656 :
6657 :
6658 : /* Get the RHS of an atomic load. */
6659 :
6660 : inline tree
6661 10178 : gimple_omp_atomic_load_rhs (const gomp_atomic_load *load_stmt)
6662 : {
6663 10178 : return load_stmt->rhs;
6664 : }
6665 :
6666 :
6667 : /* Return a pointer to the RHS of an atomic load. */
6668 :
6669 : inline tree *
6670 52862 : gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load *load_stmt)
6671 : {
6672 52862 : return &load_stmt->rhs;
6673 : }
6674 :
6675 :
6676 : /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6677 :
6678 : inline tree
6679 25079 : gimple_omp_continue_control_def (const gomp_continue *cont_stmt)
6680 : {
6681 25079 : return cont_stmt->control_def;
6682 : }
6683 :
6684 : /* The same as above, but return the address. */
6685 :
6686 : inline tree *
6687 196568 : gimple_omp_continue_control_def_ptr (gomp_continue *cont_stmt)
6688 : {
6689 196568 : return &cont_stmt->control_def;
6690 : }
6691 :
6692 : /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
6693 :
6694 : inline void
6695 51827 : gimple_omp_continue_set_control_def (gomp_continue *cont_stmt, tree def)
6696 : {
6697 51827 : cont_stmt->control_def = def;
6698 : }
6699 :
6700 :
6701 : /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6702 :
6703 : inline tree
6704 25079 : gimple_omp_continue_control_use (const gomp_continue *cont_stmt)
6705 : {
6706 25079 : return cont_stmt->control_use;
6707 : }
6708 :
6709 :
6710 : /* The same as above, but return the address. */
6711 :
6712 : inline tree *
6713 196568 : gimple_omp_continue_control_use_ptr (gomp_continue *cont_stmt)
6714 : {
6715 196568 : return &cont_stmt->control_use;
6716 : }
6717 :
6718 :
6719 : /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
6720 :
6721 : inline void
6722 51827 : gimple_omp_continue_set_control_use (gomp_continue *cont_stmt, tree use)
6723 : {
6724 51827 : cont_stmt->control_use = use;
6725 : }
6726 :
6727 : /* Return the guard associated with the GIMPLE_ASSUME statement GS. */
6728 :
6729 : inline tree
6730 124 : gimple_assume_guard (const gimple *gs)
6731 : {
6732 124 : const gimple_statement_assume *assume_stmt
6733 124 : = as_a <const gimple_statement_assume *> (gs);
6734 124 : return assume_stmt->guard;
6735 : }
6736 :
6737 : /* Set the guard associated with the GIMPLE_ASSUME statement GS. */
6738 :
6739 : inline void
6740 124 : gimple_assume_set_guard (gimple *gs, tree guard)
6741 : {
6742 124 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6743 124 : assume_stmt->guard = guard;
6744 0 : }
6745 :
6746 : inline tree *
6747 12 : gimple_assume_guard_ptr (gimple *gs)
6748 : {
6749 12 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6750 12 : return &assume_stmt->guard;
6751 : }
6752 :
6753 : /* Return the address of the GIMPLE sequence contained in the GIMPLE_ASSUME
6754 : statement GS. */
6755 :
6756 : inline gimple_seq *
6757 275 : gimple_assume_body_ptr (gimple *gs)
6758 : {
6759 275 : gimple_statement_assume *assume_stmt = as_a <gimple_statement_assume *> (gs);
6760 151 : return &assume_stmt->body;
6761 : }
6762 :
6763 : /* Return the GIMPLE sequence contained in the GIMPLE_ASSUME statement GS. */
6764 :
6765 : inline gimple_seq
6766 502 : gimple_assume_body (const gimple *gs)
6767 : {
6768 502 : const gimple_statement_assume *assume_stmt
6769 502 : = as_a <const gimple_statement_assume *> (gs);
6770 502 : return assume_stmt->body;
6771 : }
6772 :
6773 : /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
6774 : TRANSACTION_STMT. */
6775 :
6776 : inline gimple_seq *
6777 1759 : gimple_transaction_body_ptr (gtransaction *transaction_stmt)
6778 : {
6779 1759 : return &transaction_stmt->body;
6780 : }
6781 :
6782 : /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
6783 :
6784 : inline gimple_seq
6785 35375 : gimple_transaction_body (const gtransaction *transaction_stmt)
6786 : {
6787 35375 : return transaction_stmt->body;
6788 : }
6789 :
6790 : /* Return the label associated with a GIMPLE_TRANSACTION. */
6791 :
6792 : inline tree
6793 35651 : gimple_transaction_label_norm (const gtransaction *transaction_stmt)
6794 : {
6795 35651 : return transaction_stmt->label_norm;
6796 : }
6797 :
6798 : inline tree *
6799 62324 : gimple_transaction_label_norm_ptr (gtransaction *transaction_stmt)
6800 : {
6801 62324 : return &transaction_stmt->label_norm;
6802 : }
6803 :
6804 : inline tree
6805 35651 : gimple_transaction_label_uninst (const gtransaction *transaction_stmt)
6806 : {
6807 35651 : return transaction_stmt->label_uninst;
6808 : }
6809 :
6810 : inline tree *
6811 62324 : gimple_transaction_label_uninst_ptr (gtransaction *transaction_stmt)
6812 : {
6813 62324 : return &transaction_stmt->label_uninst;
6814 : }
6815 :
6816 : inline tree
6817 35651 : gimple_transaction_label_over (const gtransaction *transaction_stmt)
6818 : {
6819 35651 : return transaction_stmt->label_over;
6820 : }
6821 :
6822 : inline tree *
6823 62324 : gimple_transaction_label_over_ptr (gtransaction *transaction_stmt)
6824 : {
6825 62324 : return &transaction_stmt->label_over;
6826 : }
6827 :
6828 : /* Return the subcode associated with a GIMPLE_TRANSACTION. */
6829 :
6830 : inline unsigned int
6831 3932 : gimple_transaction_subcode (const gtransaction *transaction_stmt)
6832 : {
6833 3924 : return transaction_stmt->subcode;
6834 : }
6835 :
6836 : /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
6837 : TRANSACTION_STMT. */
6838 :
6839 : inline void
6840 1025 : gimple_transaction_set_body (gtransaction *transaction_stmt,
6841 : gimple_seq body)
6842 : {
6843 480 : transaction_stmt->body = body;
6844 6 : }
6845 :
6846 : /* Set the label associated with a GIMPLE_TRANSACTION. */
6847 :
6848 : inline void
6849 1159 : gimple_transaction_set_label_norm (gtransaction *transaction_stmt, tree label)
6850 : {
6851 1159 : transaction_stmt->label_norm = label;
6852 145 : }
6853 :
6854 : inline void
6855 1140 : gimple_transaction_set_label_uninst (gtransaction *transaction_stmt, tree label)
6856 : {
6857 1140 : transaction_stmt->label_uninst = label;
6858 527 : }
6859 :
6860 : inline void
6861 1104 : gimple_transaction_set_label_over (gtransaction *transaction_stmt, tree label)
6862 : {
6863 1104 : transaction_stmt->label_over = label;
6864 559 : }
6865 :
6866 : /* Set the subcode associated with a GIMPLE_TRANSACTION. */
6867 :
6868 : inline void
6869 1977 : gimple_transaction_set_subcode (gtransaction *transaction_stmt,
6870 : unsigned int subcode)
6871 : {
6872 946 : transaction_stmt->subcode = subcode;
6873 1031 : }
6874 :
6875 : /* Return a pointer to the return value for GIMPLE_RETURN GS. */
6876 :
6877 : inline tree *
6878 559343 : gimple_return_retval_ptr (greturn *gs)
6879 : {
6880 559343 : return &gs->op[0];
6881 : }
6882 :
6883 : /* Return the return value for GIMPLE_RETURN GS. */
6884 :
6885 : inline tree
6886 362192048 : gimple_return_retval (const greturn *gs)
6887 : {
6888 362192048 : return gs->op[0];
6889 : }
6890 :
6891 :
6892 : /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
6893 :
6894 : inline void
6895 2154280 : gimple_return_set_retval (greturn *gs, tree retval)
6896 : {
6897 2154280 : gs->op[0] = retval;
6898 2133003 : }
6899 :
6900 :
6901 : /* Returns true when the gimple statement STMT is any of the OMP types. */
6902 :
6903 : #define CASE_GIMPLE_OMP \
6904 : case GIMPLE_OMP_PARALLEL: \
6905 : case GIMPLE_OMP_TASK: \
6906 : case GIMPLE_OMP_FOR: \
6907 : case GIMPLE_OMP_SECTIONS: \
6908 : case GIMPLE_OMP_SECTIONS_SWITCH: \
6909 : case GIMPLE_OMP_SINGLE: \
6910 : case GIMPLE_OMP_TARGET: \
6911 : case GIMPLE_OMP_TEAMS: \
6912 : case GIMPLE_OMP_SCOPE: \
6913 : case GIMPLE_OMP_DISPATCH: \
6914 : case GIMPLE_OMP_INTEROP: \
6915 : case GIMPLE_OMP_SECTION: \
6916 : case GIMPLE_OMP_STRUCTURED_BLOCK: \
6917 : case GIMPLE_OMP_MASTER: \
6918 : case GIMPLE_OMP_MASKED: \
6919 : case GIMPLE_OMP_TASKGROUP: \
6920 : case GIMPLE_OMP_ORDERED: \
6921 : case GIMPLE_OMP_CRITICAL: \
6922 : case GIMPLE_OMP_SCAN: \
6923 : case GIMPLE_OMP_RETURN: \
6924 : case GIMPLE_OMP_ATOMIC_LOAD: \
6925 : case GIMPLE_OMP_ATOMIC_STORE: \
6926 : case GIMPLE_OMP_CONTINUE
6927 :
6928 : inline bool
6929 8823146 : is_gimple_omp (const gimple *stmt)
6930 : {
6931 7420456 : switch (gimple_code (stmt))
6932 : {
6933 : CASE_GIMPLE_OMP:
6934 : return true;
6935 3221957 : default:
6936 3221957 : return false;
6937 : }
6938 : }
6939 :
6940 : /* Return true if the OMP gimple statement STMT is any of the OpenACC types
6941 : specifically. */
6942 :
6943 : inline bool
6944 1116914 : is_gimple_omp_oacc (const gimple *stmt)
6945 : {
6946 1116914 : gcc_assert (is_gimple_omp (stmt));
6947 1116914 : switch (gimple_code (stmt))
6948 : {
6949 0 : case GIMPLE_OMP_ATOMIC_LOAD:
6950 0 : case GIMPLE_OMP_ATOMIC_STORE:
6951 0 : case GIMPLE_OMP_CONTINUE:
6952 0 : case GIMPLE_OMP_RETURN:
6953 : /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
6954 : the two. */
6955 0 : gcc_unreachable ();
6956 :
6957 398482 : case GIMPLE_OMP_FOR:
6958 398482 : switch (gimple_omp_for_kind (stmt))
6959 : {
6960 : case GF_OMP_FOR_KIND_OACC_LOOP:
6961 : return true;
6962 : default:
6963 : return false;
6964 : }
6965 480879 : case GIMPLE_OMP_TARGET:
6966 480879 : switch (gimple_omp_target_kind (stmt))
6967 : {
6968 : case GF_OMP_TARGET_KIND_OACC_PARALLEL:
6969 : case GF_OMP_TARGET_KIND_OACC_KERNELS:
6970 : case GF_OMP_TARGET_KIND_OACC_SERIAL:
6971 : case GF_OMP_TARGET_KIND_OACC_DATA:
6972 : case GF_OMP_TARGET_KIND_OACC_UPDATE:
6973 : case GF_OMP_TARGET_KIND_OACC_ENTER_DATA:
6974 : case GF_OMP_TARGET_KIND_OACC_EXIT_DATA:
6975 : case GF_OMP_TARGET_KIND_OACC_DECLARE:
6976 : case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
6977 : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
6978 : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
6979 : case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS:
6980 : return true;
6981 : default:
6982 : return false;
6983 : }
6984 : default:
6985 : return false;
6986 : }
6987 : }
6988 :
6989 :
6990 : /* Return true if the OMP gimple statement STMT is offloaded. */
6991 :
6992 : inline bool
6993 695745 : is_gimple_omp_offloaded (const gimple *stmt)
6994 : {
6995 695745 : gcc_assert (is_gimple_omp (stmt));
6996 695745 : switch (gimple_code (stmt))
6997 : {
6998 497709 : case GIMPLE_OMP_TARGET:
6999 497709 : switch (gimple_omp_target_kind (stmt))
7000 : {
7001 : case GF_OMP_TARGET_KIND_REGION:
7002 : case GF_OMP_TARGET_KIND_OACC_PARALLEL:
7003 : case GF_OMP_TARGET_KIND_OACC_KERNELS:
7004 : case GF_OMP_TARGET_KIND_OACC_SERIAL:
7005 : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED:
7006 : case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE:
7007 : return true;
7008 : default:
7009 : return false;
7010 : }
7011 : default:
7012 : return false;
7013 : }
7014 : }
7015 :
7016 :
7017 : /* Returns TRUE if statement G is a GIMPLE_NOP. */
7018 :
7019 : inline bool
7020 24436833441 : gimple_nop_p (const gimple *g)
7021 : {
7022 24782664050 : return gimple_code (g) == GIMPLE_NOP;
7023 : }
7024 :
7025 :
7026 : /* Return true if GS is a GIMPLE_RESX. */
7027 :
7028 : inline bool
7029 2358153 : is_gimple_resx (const gimple *gs)
7030 : {
7031 2358153 : return gimple_code (gs) == GIMPLE_RESX;
7032 : }
7033 :
7034 :
7035 : /* Enum and arrays used for allocation stats. Keep in sync with
7036 : gimple.cc:gimple_alloc_kind_names. */
7037 : enum gimple_alloc_kind
7038 : {
7039 : gimple_alloc_kind_assign, /* Assignments. */
7040 : gimple_alloc_kind_phi, /* PHI nodes. */
7041 : gimple_alloc_kind_cond, /* Conditionals. */
7042 : gimple_alloc_kind_rest, /* Everything else. */
7043 : gimple_alloc_kind_all
7044 : };
7045 :
7046 : extern uint64_t gimple_alloc_counts[];
7047 : extern uint64_t gimple_alloc_sizes[];
7048 :
7049 : /* Return the allocation kind for a given stmt CODE. */
7050 : inline enum gimple_alloc_kind
7051 : gimple_alloc_kind (enum gimple_code code)
7052 : {
7053 : switch (code)
7054 : {
7055 : case GIMPLE_ASSIGN:
7056 : return gimple_alloc_kind_assign;
7057 : case GIMPLE_PHI:
7058 : return gimple_alloc_kind_phi;
7059 : case GIMPLE_COND:
7060 : return gimple_alloc_kind_cond;
7061 : default:
7062 : return gimple_alloc_kind_rest;
7063 : }
7064 : }
7065 :
7066 : /* Return true if a location should not be emitted for this statement
7067 : by annotate_all_with_location. */
7068 :
7069 : inline bool
7070 336068526 : gimple_do_not_emit_location_p (gimple *g)
7071 : {
7072 336068526 : return gimple_plf (g, GF_PLF_1);
7073 : }
7074 :
7075 : /* Mark statement G so a location will not be emitted by
7076 : annotate_one_with_location. */
7077 :
7078 : inline void
7079 1906696 : gimple_set_do_not_emit_location (gimple *g)
7080 : {
7081 : /* The PLF flags are initialized to 0 when a new tuple is created,
7082 : so no need to initialize it anywhere. */
7083 1906696 : gimple_set_plf (g, GF_PLF_1, true);
7084 : }
7085 :
7086 : #endif /* GCC_GIMPLE_H */
|