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