cond.md (stzx_16): Use register_operand for operand 0.
[gcc.git] / gcc / gimple.h
1 /* Gimple IR definitions.
2
3 Copyright (C) 2007-2013 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 "pointer-set.h"
26 #include "hash-table.h"
27 #include "vec.h"
28 #include "ggc.h"
29 #include "basic-block.h"
30 #include "tree-ssa-alias.h"
31 #include "internal-fn.h"
32 #include "gimple-fold.h"
33 #include "tree-eh.h"
34 #include "gimple-expr.h"
35 #include "is-a.h"
36
37 typedef gimple gimple_seq_node;
38
39 /* For each block, the PHI nodes that need to be rewritten are stored into
40 these vectors. */
41 typedef vec<gimple> gimple_vec;
42
43 enum gimple_code {
44 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
45 #include "gimple.def"
46 #undef DEFGSCODE
47 LAST_AND_UNUSED_GIMPLE_CODE
48 };
49
50 extern const char *const gimple_code_name[];
51 extern const unsigned char gimple_rhs_class_table[];
52
53 /* Error out if a gimple tuple is addressed incorrectly. */
54 #if defined ENABLE_GIMPLE_CHECKING
55 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
56 extern void gimple_check_failed (const_gimple, const char *, int, \
57 const char *, enum gimple_code, \
58 enum tree_code) ATTRIBUTE_NORETURN;
59
60 #define GIMPLE_CHECK(GS, CODE) \
61 do { \
62 const_gimple __gs = (GS); \
63 if (gimple_code (__gs) != (CODE)) \
64 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
65 (CODE), ERROR_MARK); \
66 } while (0)
67 #else /* not ENABLE_GIMPLE_CHECKING */
68 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
69 #define GIMPLE_CHECK(GS, CODE) (void)0
70 #endif
71
72 /* Class of GIMPLE expressions suitable for the RHS of assignments. See
73 get_gimple_rhs_class. */
74 enum gimple_rhs_class
75 {
76 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
77 GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
78 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
79 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
80 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
81 name, a _DECL, a _REF, etc. */
82 };
83
84 /* Specific flags for individual GIMPLE statements. These flags are
85 always stored in gimple_statement_base.subcode and they may only be
86 defined for statement codes that do not use subcodes.
87
88 Values for the masks can overlap as long as the overlapping values
89 are never used in the same statement class.
90
91 The maximum mask value that can be defined is 1 << 15 (i.e., each
92 statement code can hold up to 16 bitflags).
93
94 Keep this list sorted. */
95 enum gf_mask {
96 GF_ASM_INPUT = 1 << 0,
97 GF_ASM_VOLATILE = 1 << 1,
98 GF_CALL_FROM_THUNK = 1 << 0,
99 GF_CALL_RETURN_SLOT_OPT = 1 << 1,
100 GF_CALL_TAILCALL = 1 << 2,
101 GF_CALL_VA_ARG_PACK = 1 << 3,
102 GF_CALL_NOTHROW = 1 << 4,
103 GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
104 GF_CALL_INTERNAL = 1 << 6,
105 GF_CALL_WITH_BOUNDS = 1 << 7,
106 GF_OMP_PARALLEL_COMBINED = 1 << 0,
107 GF_OMP_FOR_KIND_MASK = 3 << 0,
108 GF_OMP_FOR_KIND_FOR = 0 << 0,
109 GF_OMP_FOR_KIND_DISTRIBUTE = 1 << 0,
110 GF_OMP_FOR_KIND_SIMD = 2 << 0,
111 GF_OMP_FOR_KIND_CILKSIMD = 3 << 0,
112 GF_OMP_FOR_COMBINED = 1 << 2,
113 GF_OMP_FOR_COMBINED_INTO = 1 << 3,
114 GF_OMP_TARGET_KIND_MASK = 3 << 0,
115 GF_OMP_TARGET_KIND_REGION = 0 << 0,
116 GF_OMP_TARGET_KIND_DATA = 1 << 0,
117 GF_OMP_TARGET_KIND_UPDATE = 2 << 0,
118
119 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
120 a thread synchronization via some sort of barrier. The exact barrier
121 that would otherwise be emitted is dependent on the OMP statement with
122 which this return is associated. */
123 GF_OMP_RETURN_NOWAIT = 1 << 0,
124
125 GF_OMP_SECTION_LAST = 1 << 0,
126 GF_OMP_ATOMIC_NEED_VALUE = 1 << 0,
127 GF_OMP_ATOMIC_SEQ_CST = 1 << 1,
128 GF_PREDICT_TAKEN = 1 << 15
129 };
130
131 /* Currently, there are only two types of gimple debug stmt. Others are
132 envisioned, for example, to enable the generation of is_stmt notes
133 in line number information, to mark sequence points, etc. This
134 subcode is to be used to tell them apart. */
135 enum gimple_debug_subcode {
136 GIMPLE_DEBUG_BIND = 0,
137 GIMPLE_DEBUG_SOURCE_BIND = 1
138 };
139
140 /* Masks for selecting a pass local flag (PLF) to work on. These
141 masks are used by gimple_set_plf and gimple_plf. */
142 enum plf_mask {
143 GF_PLF_1 = 1 << 0,
144 GF_PLF_2 = 1 << 1
145 };
146
147 /* Data structure definitions for GIMPLE tuples. NOTE: word markers
148 are for 64 bit hosts. */
149
150 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
151 chain_next ("%h.next"), variable_size))
152 gimple_statement_base
153 {
154 /* [ WORD 1 ]
155 Main identifying code for a tuple. */
156 ENUM_BITFIELD(gimple_code) code : 8;
157
158 /* Nonzero if a warning should not be emitted on this tuple. */
159 unsigned int no_warning : 1;
160
161 /* Nonzero if this tuple has been visited. Passes are responsible
162 for clearing this bit before using it. */
163 unsigned int visited : 1;
164
165 /* Nonzero if this tuple represents a non-temporal move. */
166 unsigned int nontemporal_move : 1;
167
168 /* Pass local flags. These flags are free for any pass to use as
169 they see fit. Passes should not assume that these flags contain
170 any useful value when the pass starts. Any initial state that
171 the pass requires should be set on entry to the pass. See
172 gimple_set_plf and gimple_plf for usage. */
173 unsigned int plf : 2;
174
175 /* Nonzero if this statement has been modified and needs to have its
176 operands rescanned. */
177 unsigned modified : 1;
178
179 /* Nonzero if this statement contains volatile operands. */
180 unsigned has_volatile_ops : 1;
181
182 /* The SUBCODE field can be used for tuple-specific flags for tuples
183 that do not require subcodes. Note that SUBCODE should be at
184 least as wide as tree codes, as several tuples store tree codes
185 in there. */
186 unsigned int subcode : 16;
187
188 /* UID of this statement. This is used by passes that want to
189 assign IDs to statements. It must be assigned and used by each
190 pass. By default it should be assumed to contain garbage. */
191 unsigned uid;
192
193 /* [ WORD 2 ]
194 Locus information for debug info. */
195 location_t location;
196
197 /* Number of operands in this tuple. */
198 unsigned num_ops;
199
200 /* [ WORD 3 ]
201 Basic block holding this statement. */
202 basic_block bb;
203
204 /* [ WORD 4-5 ]
205 Linked lists of gimple statements. The next pointers form
206 a NULL terminated list, the prev pointers are a cyclic list.
207 A gimple statement is hence also a double-ended list of
208 statements, with the pointer itself being the first element,
209 and the prev pointer being the last. */
210 gimple next;
211 gimple GTY((skip)) prev;
212 };
213
214
215 /* Base structure for tuples with operands. */
216
217 /* This gimple subclass has no tag value. */
218 struct GTY(())
219 gimple_statement_with_ops_base : public gimple_statement_base
220 {
221 /* [ WORD 1-6 ] : base class */
222
223 /* [ WORD 7 ]
224 SSA operand vectors. NOTE: It should be possible to
225 amalgamate these vectors with the operand vector OP. However,
226 the SSA operand vectors are organized differently and contain
227 more information (like immediate use chaining). */
228 struct use_optype_d GTY((skip (""))) *use_ops;
229 };
230
231
232 /* Statements that take register operands. */
233
234 struct GTY((tag("GSS_WITH_OPS")))
235 gimple_statement_with_ops : public gimple_statement_with_ops_base
236 {
237 /* [ WORD 1-7 ] : base class */
238
239 /* [ WORD 8 ]
240 Operand vector. NOTE! This must always be the last field
241 of this structure. In particular, this means that this
242 structure cannot be embedded inside another one. */
243 tree GTY((length ("%h.num_ops"))) op[1];
244 };
245
246
247 /* Base for statements that take both memory and register operands. */
248
249 struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
250 gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
251 {
252 /* [ WORD 1-7 ] : base class */
253
254 /* [ WORD 8-9 ]
255 Virtual operands for this statement. The GC will pick them
256 up via the ssa_names array. */
257 tree GTY((skip (""))) vdef;
258 tree GTY((skip (""))) vuse;
259 };
260
261
262 /* Statements that take both memory and register operands. */
263
264 struct GTY((tag("GSS_WITH_MEM_OPS")))
265 gimple_statement_with_memory_ops :
266 public gimple_statement_with_memory_ops_base
267 {
268 /* [ WORD 1-9 ] : base class */
269
270 /* [ WORD 10 ]
271 Operand vector. NOTE! This must always be the last field
272 of this structure. In particular, this means that this
273 structure cannot be embedded inside another one. */
274 tree GTY((length ("%h.num_ops"))) op[1];
275 };
276
277
278 /* Call statements that take both memory and register operands. */
279
280 struct GTY((tag("GSS_CALL")))
281 gimple_statement_call : public gimple_statement_with_memory_ops_base
282 {
283 /* [ WORD 1-9 ] : base class */
284
285 /* [ WORD 10-13 ] */
286 struct pt_solution call_used;
287 struct pt_solution call_clobbered;
288
289 /* [ WORD 14 ] */
290 union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
291 tree GTY ((tag ("0"))) fntype;
292 enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
293 } u;
294
295 /* [ WORD 15 ]
296 Operand vector. NOTE! This must always be the last field
297 of this structure. In particular, this means that this
298 structure cannot be embedded inside another one. */
299 tree GTY((length ("%h.num_ops"))) op[1];
300 };
301
302
303 /* OpenMP statements (#pragma omp). */
304
305 struct GTY((tag("GSS_OMP")))
306 gimple_statement_omp : public gimple_statement_base
307 {
308 /* [ WORD 1-6 ] : base class */
309
310 /* [ WORD 7 ] */
311 gimple_seq body;
312 };
313
314
315 /* GIMPLE_BIND */
316
317 struct GTY((tag("GSS_BIND")))
318 gimple_statement_bind : public gimple_statement_base
319 {
320 /* [ WORD 1-6 ] : base class */
321
322 /* [ WORD 7 ]
323 Variables declared in this scope. */
324 tree vars;
325
326 /* [ WORD 8 ]
327 This is different than the BLOCK field in gimple_statement_base,
328 which is analogous to TREE_BLOCK (i.e., the lexical block holding
329 this statement). This field is the equivalent of BIND_EXPR_BLOCK
330 in tree land (i.e., the lexical scope defined by this bind). See
331 gimple-low.c. */
332 tree block;
333
334 /* [ WORD 9 ] */
335 gimple_seq body;
336 };
337
338
339 /* GIMPLE_CATCH */
340
341 struct GTY((tag("GSS_CATCH")))
342 gimple_statement_catch : public gimple_statement_base
343 {
344 /* [ WORD 1-6 ] : base class */
345
346 /* [ WORD 7 ] */
347 tree types;
348
349 /* [ WORD 8 ] */
350 gimple_seq handler;
351 };
352
353
354 /* GIMPLE_EH_FILTER */
355
356 struct GTY((tag("GSS_EH_FILTER")))
357 gimple_statement_eh_filter : public gimple_statement_base
358 {
359 /* [ WORD 1-6 ] : base class */
360
361 /* [ WORD 7 ]
362 Filter types. */
363 tree types;
364
365 /* [ WORD 8 ]
366 Failure actions. */
367 gimple_seq failure;
368 };
369
370 /* GIMPLE_EH_ELSE */
371
372 struct GTY((tag("GSS_EH_ELSE")))
373 gimple_statement_eh_else : public gimple_statement_base
374 {
375 /* [ WORD 1-6 ] : base class */
376
377 /* [ WORD 7,8 ] */
378 gimple_seq n_body, e_body;
379 };
380
381 /* GIMPLE_EH_MUST_NOT_THROW */
382
383 struct GTY((tag("GSS_EH_MNT")))
384 gimple_statement_eh_mnt : public gimple_statement_base
385 {
386 /* [ WORD 1-6 ] : base class */
387
388 /* [ WORD 7 ] Abort function decl. */
389 tree fndecl;
390 };
391
392 /* GIMPLE_PHI */
393
394 struct GTY((tag("GSS_PHI")))
395 gimple_statement_phi : public gimple_statement_base
396 {
397 /* [ WORD 1-6 ] : base class */
398
399 /* [ WORD 7 ] */
400 unsigned capacity;
401 unsigned nargs;
402
403 /* [ WORD 8 ] */
404 tree result;
405
406 /* [ WORD 9 ] */
407 struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
408 };
409
410
411 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
412
413 struct GTY((tag("GSS_EH_CTRL")))
414 gimple_statement_eh_ctrl : public gimple_statement_base
415 {
416 /* [ WORD 1-6 ] : base class */
417
418 /* [ WORD 7 ]
419 Exception region number. */
420 int region;
421 };
422
423
424 /* GIMPLE_TRY */
425
426 struct GTY((tag("GSS_TRY")))
427 gimple_statement_try : public gimple_statement_base
428 {
429 /* [ WORD 1-6 ] : base class */
430
431 /* [ WORD 7 ]
432 Expression to evaluate. */
433 gimple_seq eval;
434
435 /* [ WORD 8 ]
436 Cleanup expression. */
437 gimple_seq cleanup;
438 };
439
440 /* Kind of GIMPLE_TRY statements. */
441 enum gimple_try_flags
442 {
443 /* A try/catch. */
444 GIMPLE_TRY_CATCH = 1 << 0,
445
446 /* A try/finally. */
447 GIMPLE_TRY_FINALLY = 1 << 1,
448 GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
449
450 /* Analogous to TRY_CATCH_IS_CLEANUP. */
451 GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
452 };
453
454 /* GIMPLE_WITH_CLEANUP_EXPR */
455
456 struct GTY((tag("GSS_WCE")))
457 gimple_statement_wce : public gimple_statement_base
458 {
459 /* [ WORD 1-6 ] : base class */
460
461 /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
462 executed if an exception is thrown, not on normal exit of its
463 scope. This flag is analogous to the CLEANUP_EH_ONLY flag
464 in TARGET_EXPRs. */
465
466 /* [ WORD 7 ]
467 Cleanup expression. */
468 gimple_seq cleanup;
469 };
470
471
472 /* GIMPLE_ASM */
473
474 struct GTY((tag("GSS_ASM")))
475 gimple_statement_asm : public gimple_statement_with_memory_ops_base
476 {
477 /* [ WORD 1-9 ] : base class */
478
479 /* [ WORD 10 ]
480 __asm__ statement. */
481 const char *string;
482
483 /* [ WORD 11 ]
484 Number of inputs, outputs, clobbers, labels. */
485 unsigned char ni;
486 unsigned char no;
487 unsigned char nc;
488 unsigned char nl;
489
490 /* [ WORD 12 ]
491 Operand vector. NOTE! This must always be the last field
492 of this structure. In particular, this means that this
493 structure cannot be embedded inside another one. */
494 tree GTY((length ("%h.num_ops"))) op[1];
495 };
496
497 /* GIMPLE_OMP_CRITICAL */
498
499 struct GTY((tag("GSS_OMP_CRITICAL")))
500 gimple_statement_omp_critical : public gimple_statement_omp
501 {
502 /* [ WORD 1-7 ] : base class */
503
504 /* [ WORD 8 ]
505 Critical section name. */
506 tree name;
507 };
508
509
510 struct GTY(()) gimple_omp_for_iter {
511 /* Condition code. */
512 enum tree_code cond;
513
514 /* Index variable. */
515 tree index;
516
517 /* Initial value. */
518 tree initial;
519
520 /* Final value. */
521 tree final;
522
523 /* Increment. */
524 tree incr;
525 };
526
527 /* GIMPLE_OMP_FOR */
528
529 struct GTY((tag("GSS_OMP_FOR")))
530 gimple_statement_omp_for : public gimple_statement_omp
531 {
532 /* [ WORD 1-7 ] : base class */
533
534 /* [ WORD 8 ] */
535 tree clauses;
536
537 /* [ WORD 9 ]
538 Number of elements in iter array. */
539 size_t collapse;
540
541 /* [ WORD 10 ] */
542 struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
543
544 /* [ WORD 11 ]
545 Pre-body evaluated before the loop body begins. */
546 gimple_seq pre_body;
547 };
548
549
550 /* GIMPLE_OMP_PARALLEL */
551
552 struct GTY((tag("GSS_OMP_PARALLEL")))
553 gimple_statement_omp_parallel : public gimple_statement_omp
554 {
555 /* [ WORD 1-7 ] : base class */
556
557 /* [ WORD 8 ]
558 Clauses. */
559 tree clauses;
560
561 /* [ WORD 9 ]
562 Child function holding the body of the parallel region. */
563 tree child_fn;
564
565 /* [ WORD 10 ]
566 Shared data argument. */
567 tree data_arg;
568 };
569
570
571 /* GIMPLE_OMP_TASK */
572
573 struct GTY((tag("GSS_OMP_TASK")))
574 gimple_statement_omp_task : public gimple_statement_omp_parallel
575 {
576 /* [ WORD 1-10 ] : base class */
577
578 /* [ WORD 11 ]
579 Child function holding firstprivate initialization if needed. */
580 tree copy_fn;
581
582 /* [ WORD 12-13 ]
583 Size and alignment in bytes of the argument data block. */
584 tree arg_size;
585 tree arg_align;
586 };
587
588
589 /* GIMPLE_OMP_SECTION */
590 /* Uses struct gimple_statement_omp. */
591
592
593 /* GIMPLE_OMP_SECTIONS */
594
595 struct GTY((tag("GSS_OMP_SECTIONS")))
596 gimple_statement_omp_sections : public gimple_statement_omp
597 {
598 /* [ WORD 1-7 ] : base class */
599
600 /* [ WORD 8 ] */
601 tree clauses;
602
603 /* [ WORD 9 ]
604 The control variable used for deciding which of the sections to
605 execute. */
606 tree control;
607 };
608
609 /* GIMPLE_OMP_CONTINUE.
610
611 Note: This does not inherit from gimple_statement_omp, because we
612 do not need the body field. */
613
614 struct GTY((tag("GSS_OMP_CONTINUE")))
615 gimple_statement_omp_continue : public gimple_statement_base
616 {
617 /* [ WORD 1-6 ] : base class */
618
619 /* [ WORD 7 ] */
620 tree control_def;
621
622 /* [ WORD 8 ] */
623 tree control_use;
624 };
625
626 /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS */
627
628 struct GTY((tag("GSS_OMP_SINGLE")))
629 gimple_statement_omp_single : public gimple_statement_omp
630 {
631 /* [ WORD 1-7 ] : base class */
632
633 /* [ WORD 7 ] */
634 tree clauses;
635 };
636
637
638 /* GIMPLE_OMP_ATOMIC_LOAD.
639 Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
640 contains a sequence, which we don't need here. */
641
642 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
643 gimple_statement_omp_atomic_load : public gimple_statement_base
644 {
645 /* [ WORD 1-6 ] : base class */
646
647 /* [ WORD 7-8 ] */
648 tree rhs, lhs;
649 };
650
651 /* GIMPLE_OMP_ATOMIC_STORE.
652 See note on GIMPLE_OMP_ATOMIC_LOAD. */
653
654 struct GTY((tag("GSS_OMP_ATOMIC_STORE")))
655 gimple_statement_omp_atomic_store : public gimple_statement_base
656 {
657 /* [ WORD 1-6 ] : base class */
658
659 /* [ WORD 7 ] */
660 tree val;
661 };
662
663 /* GIMPLE_TRANSACTION. */
664
665 /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
666
667 /* The __transaction_atomic was declared [[outer]] or it is
668 __transaction_relaxed. */
669 #define GTMA_IS_OUTER (1u << 0)
670 #define GTMA_IS_RELAXED (1u << 1)
671 #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
672
673 /* The transaction is seen to not have an abort. */
674 #define GTMA_HAVE_ABORT (1u << 2)
675 /* The transaction is seen to have loads or stores. */
676 #define GTMA_HAVE_LOAD (1u << 3)
677 #define GTMA_HAVE_STORE (1u << 4)
678 /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
679 #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
680 /* The transaction WILL enter serial irrevocable mode.
681 An irrevocable block post-dominates the entire transaction, such
682 that all invocations of the transaction will go serial-irrevocable.
683 In such case, we don't bother instrumenting the transaction, and
684 tell the runtime that it should begin the transaction in
685 serial-irrevocable mode. */
686 #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
687 /* The transaction contains no instrumentation code whatsover, most
688 likely because it is guaranteed to go irrevocable upon entry. */
689 #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
690
691 struct GTY((tag("GSS_TRANSACTION")))
692 gimple_statement_transaction : public gimple_statement_with_memory_ops_base
693 {
694 /* [ WORD 1-9 ] : base class */
695
696 /* [ WORD 10 ] */
697 gimple_seq body;
698
699 /* [ WORD 11 ] */
700 tree label;
701 };
702
703 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
704 enum gimple_statement_structure_enum {
705 #include "gsstruct.def"
706 LAST_GSS_ENUM
707 };
708 #undef DEFGSSTRUCT
709
710 template <>
711 template <>
712 inline bool
713 is_a_helper <gimple_statement_asm>::test (gimple gs)
714 {
715 return gs->code == GIMPLE_ASM;
716 }
717
718 template <>
719 template <>
720 inline bool
721 is_a_helper <gimple_statement_bind>::test (gimple gs)
722 {
723 return gs->code == GIMPLE_BIND;
724 }
725
726 template <>
727 template <>
728 inline bool
729 is_a_helper <gimple_statement_call>::test (gimple gs)
730 {
731 return gs->code == GIMPLE_CALL;
732 }
733
734 template <>
735 template <>
736 inline bool
737 is_a_helper <gimple_statement_catch>::test (gimple gs)
738 {
739 return gs->code == GIMPLE_CATCH;
740 }
741
742 template <>
743 template <>
744 inline bool
745 is_a_helper <gimple_statement_eh_ctrl>::test (gimple gs)
746 {
747 return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
748 }
749
750 template <>
751 template <>
752 inline bool
753 is_a_helper <gimple_statement_eh_else>::test (gimple gs)
754 {
755 return gs->code == GIMPLE_EH_ELSE;
756 }
757
758 template <>
759 template <>
760 inline bool
761 is_a_helper <gimple_statement_eh_filter>::test (gimple gs)
762 {
763 return gs->code == GIMPLE_EH_FILTER;
764 }
765
766 template <>
767 template <>
768 inline bool
769 is_a_helper <gimple_statement_eh_mnt>::test (gimple gs)
770 {
771 return gs->code == GIMPLE_EH_MUST_NOT_THROW;
772 }
773
774 template <>
775 template <>
776 inline bool
777 is_a_helper <gimple_statement_omp_atomic_load>::test (gimple gs)
778 {
779 return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
780 }
781
782 template <>
783 template <>
784 inline bool
785 is_a_helper <gimple_statement_omp_atomic_store>::test (gimple gs)
786 {
787 return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
788 }
789
790 template <>
791 template <>
792 inline bool
793 is_a_helper <gimple_statement_omp_continue>::test (gimple gs)
794 {
795 return gs->code == GIMPLE_OMP_CONTINUE;
796 }
797
798 template <>
799 template <>
800 inline bool
801 is_a_helper <gimple_statement_omp_critical>::test (gimple gs)
802 {
803 return gs->code == GIMPLE_OMP_CRITICAL;
804 }
805
806 template <>
807 template <>
808 inline bool
809 is_a_helper <gimple_statement_omp_for>::test (gimple gs)
810 {
811 return gs->code == GIMPLE_OMP_FOR;
812 }
813
814 template <>
815 template <>
816 inline bool
817 is_a_helper <gimple_statement_omp_parallel>::test (gimple gs)
818 {
819 return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
820 }
821
822 template <>
823 template <>
824 inline bool
825 is_a_helper <gimple_statement_omp_sections>::test (gimple gs)
826 {
827 return gs->code == GIMPLE_OMP_SECTIONS;
828 }
829
830 template <>
831 template <>
832 inline bool
833 is_a_helper <gimple_statement_omp_single>::test (gimple gs)
834 {
835 return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
836 }
837
838 template <>
839 template <>
840 inline bool
841 is_a_helper <gimple_statement_omp_task>::test (gimple gs)
842 {
843 return gs->code == GIMPLE_OMP_TASK;
844 }
845
846 template <>
847 template <>
848 inline bool
849 is_a_helper <gimple_statement_phi>::test (gimple gs)
850 {
851 return gs->code == GIMPLE_PHI;
852 }
853
854 template <>
855 template <>
856 inline bool
857 is_a_helper <gimple_statement_transaction>::test (gimple gs)
858 {
859 return gs->code == GIMPLE_TRANSACTION;
860 }
861
862 template <>
863 template <>
864 inline bool
865 is_a_helper <gimple_statement_try>::test (gimple gs)
866 {
867 return gs->code == GIMPLE_TRY;
868 }
869
870 template <>
871 template <>
872 inline bool
873 is_a_helper <gimple_statement_wce>::test (gimple gs)
874 {
875 return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
876 }
877
878 template <>
879 template <>
880 inline bool
881 is_a_helper <const gimple_statement_asm>::test (const_gimple gs)
882 {
883 return gs->code == GIMPLE_ASM;
884 }
885
886 template <>
887 template <>
888 inline bool
889 is_a_helper <const gimple_statement_bind>::test (const_gimple gs)
890 {
891 return gs->code == GIMPLE_BIND;
892 }
893
894 template <>
895 template <>
896 inline bool
897 is_a_helper <const gimple_statement_call>::test (const_gimple gs)
898 {
899 return gs->code == GIMPLE_CALL;
900 }
901
902 template <>
903 template <>
904 inline bool
905 is_a_helper <const gimple_statement_catch>::test (const_gimple gs)
906 {
907 return gs->code == GIMPLE_CATCH;
908 }
909
910 template <>
911 template <>
912 inline bool
913 is_a_helper <const gimple_statement_eh_ctrl>::test (const_gimple gs)
914 {
915 return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
916 }
917
918 template <>
919 template <>
920 inline bool
921 is_a_helper <const gimple_statement_eh_filter>::test (const_gimple gs)
922 {
923 return gs->code == GIMPLE_EH_FILTER;
924 }
925
926 template <>
927 template <>
928 inline bool
929 is_a_helper <const gimple_statement_omp_atomic_load>::test (const_gimple gs)
930 {
931 return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
932 }
933
934 template <>
935 template <>
936 inline bool
937 is_a_helper <const gimple_statement_omp_atomic_store>::test (const_gimple gs)
938 {
939 return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
940 }
941
942 template <>
943 template <>
944 inline bool
945 is_a_helper <const gimple_statement_omp_continue>::test (const_gimple gs)
946 {
947 return gs->code == GIMPLE_OMP_CONTINUE;
948 }
949
950 template <>
951 template <>
952 inline bool
953 is_a_helper <const gimple_statement_omp_critical>::test (const_gimple gs)
954 {
955 return gs->code == GIMPLE_OMP_CRITICAL;
956 }
957
958 template <>
959 template <>
960 inline bool
961 is_a_helper <const gimple_statement_omp_for>::test (const_gimple gs)
962 {
963 return gs->code == GIMPLE_OMP_FOR;
964 }
965
966 template <>
967 template <>
968 inline bool
969 is_a_helper <const gimple_statement_omp_parallel>::test (const_gimple gs)
970 {
971 return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
972 }
973
974 template <>
975 template <>
976 inline bool
977 is_a_helper <const gimple_statement_omp_sections>::test (const_gimple gs)
978 {
979 return gs->code == GIMPLE_OMP_SECTIONS;
980 }
981
982 template <>
983 template <>
984 inline bool
985 is_a_helper <const gimple_statement_omp_single>::test (const_gimple gs)
986 {
987 return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
988 }
989
990 template <>
991 template <>
992 inline bool
993 is_a_helper <const gimple_statement_omp_task>::test (const_gimple gs)
994 {
995 return gs->code == GIMPLE_OMP_TASK;
996 }
997
998 template <>
999 template <>
1000 inline bool
1001 is_a_helper <const gimple_statement_phi>::test (const_gimple gs)
1002 {
1003 return gs->code == GIMPLE_PHI;
1004 }
1005
1006 template <>
1007 template <>
1008 inline bool
1009 is_a_helper <const gimple_statement_transaction>::test (const_gimple gs)
1010 {
1011 return gs->code == GIMPLE_TRANSACTION;
1012 }
1013
1014 /* Offset in bytes to the location of the operand vector.
1015 Zero if there is no operand vector for this tuple structure. */
1016 extern size_t const gimple_ops_offset_[];
1017
1018 /* Map GIMPLE codes to GSS codes. */
1019 extern enum gimple_statement_structure_enum const gss_for_code_[];
1020
1021 /* This variable holds the currently expanded gimple statement for purposes
1022 of comminucating the profile info to the builtin expanders. */
1023 extern gimple currently_expanding_gimple_stmt;
1024
1025 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
1026 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
1027 gimple gimple_build_return (tree);
1028 void gimple_call_reset_alias_info (gimple);
1029 gimple gimple_build_call_vec (tree, vec<tree> );
1030 gimple gimple_build_call (tree, unsigned, ...);
1031 gimple gimple_build_call_valist (tree, unsigned, va_list);
1032 gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
1033 gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
1034 gimple gimple_build_call_from_tree (tree);
1035 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
1036 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
1037 gimple gimple_build_assign_with_ops (enum tree_code, tree,
1038 tree, tree, tree CXX_MEM_STAT_INFO);
1039 gimple gimple_build_assign_with_ops (enum tree_code, tree,
1040 tree, tree CXX_MEM_STAT_INFO);
1041 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
1042 gimple gimple_build_cond_from_tree (tree, tree, tree);
1043 void gimple_cond_set_condition_from_tree (gimple, tree);
1044 gimple gimple_build_label (tree label);
1045 gimple gimple_build_goto (tree dest);
1046 gimple gimple_build_nop (void);
1047 gimple gimple_build_bind (tree, gimple_seq, tree);
1048 gimple gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
1049 vec<tree, va_gc> *, vec<tree, va_gc> *,
1050 vec<tree, va_gc> *);
1051 gimple gimple_build_catch (tree, gimple_seq);
1052 gimple gimple_build_eh_filter (tree, gimple_seq);
1053 gimple gimple_build_eh_must_not_throw (tree);
1054 gimple gimple_build_eh_else (gimple_seq, gimple_seq);
1055 gimple_statement_try *gimple_build_try (gimple_seq, gimple_seq,
1056 enum gimple_try_flags);
1057 gimple gimple_build_wce (gimple_seq);
1058 gimple gimple_build_resx (int);
1059 gimple gimple_build_switch_nlabels (unsigned, tree, tree);
1060 gimple gimple_build_switch (tree, tree, vec<tree> );
1061 gimple gimple_build_eh_dispatch (int);
1062 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
1063 #define gimple_build_debug_bind(var,val,stmt) \
1064 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1065 gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
1066 #define gimple_build_debug_source_bind(var,val,stmt) \
1067 gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
1068 gimple gimple_build_omp_critical (gimple_seq, tree);
1069 gimple gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
1070 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
1071 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
1072 gimple gimple_build_omp_section (gimple_seq);
1073 gimple gimple_build_omp_master (gimple_seq);
1074 gimple gimple_build_omp_taskgroup (gimple_seq);
1075 gimple gimple_build_omp_continue (tree, tree);
1076 gimple gimple_build_omp_ordered (gimple_seq);
1077 gimple gimple_build_omp_return (bool);
1078 gimple gimple_build_omp_sections (gimple_seq, tree);
1079 gimple gimple_build_omp_sections_switch (void);
1080 gimple gimple_build_omp_single (gimple_seq, tree);
1081 gimple gimple_build_omp_target (gimple_seq, int, tree);
1082 gimple gimple_build_omp_teams (gimple_seq, tree);
1083 gimple gimple_build_omp_atomic_load (tree, tree);
1084 gimple gimple_build_omp_atomic_store (tree);
1085 gimple gimple_build_transaction (gimple_seq, tree);
1086 gimple gimple_build_predict (enum br_predictor, enum prediction);
1087 extern void gimple_seq_add_stmt (gimple_seq *, gimple);
1088 extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
1089 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
1090 extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
1091 location_t);
1092 extern void annotate_all_with_location (gimple_seq, location_t);
1093 bool empty_body_p (gimple_seq);
1094 gimple_seq gimple_seq_copy (gimple_seq);
1095 bool gimple_call_same_target_p (const_gimple, const_gimple);
1096 int gimple_call_flags (const_gimple);
1097 int gimple_call_arg_flags (const_gimple, unsigned);
1098 int gimple_call_return_flags (const_gimple);
1099 bool gimple_assign_copy_p (gimple);
1100 bool gimple_assign_ssa_name_copy_p (gimple);
1101 bool gimple_assign_unary_nop_p (gimple);
1102 void gimple_set_bb (gimple, basic_block);
1103 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
1104 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
1105 tree, tree, tree);
1106 tree gimple_get_lhs (const_gimple);
1107 void gimple_set_lhs (gimple, tree);
1108 gimple gimple_copy (gimple);
1109 bool gimple_has_side_effects (const_gimple);
1110 bool gimple_could_trap_p_1 (gimple, bool, bool);
1111 bool gimple_could_trap_p (gimple);
1112 bool gimple_assign_rhs_could_trap_p (gimple);
1113 extern void dump_gimple_statistics (void);
1114 unsigned get_gimple_rhs_num_ops (enum tree_code);
1115 extern void recalculate_side_effects (tree);
1116 extern tree canonicalize_cond_expr_cond (tree);
1117 gimple gimple_call_copy_skip_args (gimple, bitmap);
1118 extern bool gimple_compare_field_offset (tree, tree);
1119 extern tree gimple_unsigned_type (tree);
1120 extern tree gimple_signed_type (tree);
1121 extern alias_set_type gimple_get_alias_set (tree);
1122 extern bool gimple_ior_addresses_taken (bitmap, gimple);
1123 extern bool is_gimple_builtin_call (gimple stmt);
1124 extern bool gimple_call_builtin_p (gimple, enum built_in_class);
1125 extern bool gimple_call_builtin_p (gimple, enum built_in_function);
1126 extern bool gimple_asm_clobbers_memory_p (const_gimple);
1127 extern void dump_decl_set (FILE *, bitmap);
1128 extern bool nonfreeing_call_p (gimple);
1129 extern bool infer_nonnull_range (gimple, tree);
1130 extern void sort_case_labels (vec<tree> );
1131 extern void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
1132 extern void gimple_seq_set_location (gimple_seq , location_t);
1133
1134 /* Formal (expression) temporary table handling: multiple occurrences of
1135 the same scalar expression are evaluated into the same temporary. */
1136
1137 typedef struct gimple_temp_hash_elt
1138 {
1139 tree val; /* Key */
1140 tree temp; /* Value */
1141 } elt_t;
1142
1143 /* Get the number of the next statement uid to be allocated. */
1144 static inline unsigned int
1145 gimple_stmt_max_uid (struct function *fn)
1146 {
1147 return fn->last_stmt_uid;
1148 }
1149
1150 /* Set the number of the next statement uid to be allocated. */
1151 static inline void
1152 set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
1153 {
1154 fn->last_stmt_uid = maxid;
1155 }
1156
1157 /* Set the number of the next statement uid to be allocated. */
1158 static inline unsigned int
1159 inc_gimple_stmt_max_uid (struct function *fn)
1160 {
1161 return fn->last_stmt_uid++;
1162 }
1163
1164 /* Return the first node in GIMPLE sequence S. */
1165
1166 static inline gimple_seq_node
1167 gimple_seq_first (gimple_seq s)
1168 {
1169 return s;
1170 }
1171
1172
1173 /* Return the first statement in GIMPLE sequence S. */
1174
1175 static inline gimple
1176 gimple_seq_first_stmt (gimple_seq s)
1177 {
1178 gimple_seq_node n = gimple_seq_first (s);
1179 return n;
1180 }
1181
1182
1183 /* Return the last node in GIMPLE sequence S. */
1184
1185 static inline gimple_seq_node
1186 gimple_seq_last (gimple_seq s)
1187 {
1188 return s ? s->prev : NULL;
1189 }
1190
1191
1192 /* Return the last statement in GIMPLE sequence S. */
1193
1194 static inline gimple
1195 gimple_seq_last_stmt (gimple_seq s)
1196 {
1197 gimple_seq_node n = gimple_seq_last (s);
1198 return n;
1199 }
1200
1201
1202 /* Set the last node in GIMPLE sequence *PS to LAST. */
1203
1204 static inline void
1205 gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
1206 {
1207 (*ps)->prev = last;
1208 }
1209
1210
1211 /* Set the first node in GIMPLE sequence *PS to FIRST. */
1212
1213 static inline void
1214 gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
1215 {
1216 *ps = first;
1217 }
1218
1219
1220 /* Return true if GIMPLE sequence S is empty. */
1221
1222 static inline bool
1223 gimple_seq_empty_p (gimple_seq s)
1224 {
1225 return s == NULL;
1226 }
1227
1228 /* Allocate a new sequence and initialize its first element with STMT. */
1229
1230 static inline gimple_seq
1231 gimple_seq_alloc_with_stmt (gimple stmt)
1232 {
1233 gimple_seq seq = NULL;
1234 gimple_seq_add_stmt (&seq, stmt);
1235 return seq;
1236 }
1237
1238
1239 /* Returns the sequence of statements in BB. */
1240
1241 static inline gimple_seq
1242 bb_seq (const_basic_block bb)
1243 {
1244 return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
1245 }
1246
1247 static inline gimple_seq *
1248 bb_seq_addr (basic_block bb)
1249 {
1250 return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
1251 }
1252
1253 /* Sets the sequence of statements in BB to SEQ. */
1254
1255 static inline void
1256 set_bb_seq (basic_block bb, gimple_seq seq)
1257 {
1258 gcc_checking_assert (!(bb->flags & BB_RTL));
1259 bb->il.gimple.seq = seq;
1260 }
1261
1262
1263 /* Return the code for GIMPLE statement G. */
1264
1265 static inline enum gimple_code
1266 gimple_code (const_gimple g)
1267 {
1268 return g->code;
1269 }
1270
1271
1272 /* Return the GSS code used by a GIMPLE code. */
1273
1274 static inline enum gimple_statement_structure_enum
1275 gss_for_code (enum gimple_code code)
1276 {
1277 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1278 return gss_for_code_[code];
1279 }
1280
1281
1282 /* Return which GSS code is used by GS. */
1283
1284 static inline enum gimple_statement_structure_enum
1285 gimple_statement_structure (gimple gs)
1286 {
1287 return gss_for_code (gimple_code (gs));
1288 }
1289
1290
1291 /* Return true if statement G has sub-statements. This is only true for
1292 High GIMPLE statements. */
1293
1294 static inline bool
1295 gimple_has_substatements (gimple g)
1296 {
1297 switch (gimple_code (g))
1298 {
1299 case GIMPLE_BIND:
1300 case GIMPLE_CATCH:
1301 case GIMPLE_EH_FILTER:
1302 case GIMPLE_EH_ELSE:
1303 case GIMPLE_TRY:
1304 case GIMPLE_OMP_FOR:
1305 case GIMPLE_OMP_MASTER:
1306 case GIMPLE_OMP_TASKGROUP:
1307 case GIMPLE_OMP_ORDERED:
1308 case GIMPLE_OMP_SECTION:
1309 case GIMPLE_OMP_PARALLEL:
1310 case GIMPLE_OMP_TASK:
1311 case GIMPLE_OMP_SECTIONS:
1312 case GIMPLE_OMP_SINGLE:
1313 case GIMPLE_OMP_TARGET:
1314 case GIMPLE_OMP_TEAMS:
1315 case GIMPLE_OMP_CRITICAL:
1316 case GIMPLE_WITH_CLEANUP_EXPR:
1317 case GIMPLE_TRANSACTION:
1318 return true;
1319
1320 default:
1321 return false;
1322 }
1323 }
1324
1325
1326 /* Return the basic block holding statement G. */
1327
1328 static inline basic_block
1329 gimple_bb (const_gimple g)
1330 {
1331 return g->bb;
1332 }
1333
1334
1335 /* Return the lexical scope block holding statement G. */
1336
1337 static inline tree
1338 gimple_block (const_gimple g)
1339 {
1340 return LOCATION_BLOCK (g->location);
1341 }
1342
1343
1344 /* Set BLOCK to be the lexical scope block holding statement G. */
1345
1346 static inline void
1347 gimple_set_block (gimple g, tree block)
1348 {
1349 if (block)
1350 g->location =
1351 COMBINE_LOCATION_DATA (line_table, g->location, block);
1352 else
1353 g->location = LOCATION_LOCUS (g->location);
1354 }
1355
1356
1357 /* Return location information for statement G. */
1358
1359 static inline location_t
1360 gimple_location (const_gimple g)
1361 {
1362 return g->location;
1363 }
1364
1365 /* Return pointer to location information for statement G. */
1366
1367 static inline const location_t *
1368 gimple_location_ptr (const_gimple g)
1369 {
1370 return &g->location;
1371 }
1372
1373
1374 /* Set location information for statement G. */
1375
1376 static inline void
1377 gimple_set_location (gimple g, location_t location)
1378 {
1379 g->location = location;
1380 }
1381
1382
1383 /* Return true if G contains location information. */
1384
1385 static inline bool
1386 gimple_has_location (const_gimple g)
1387 {
1388 return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
1389 }
1390
1391
1392 /* Return the file name of the location of STMT. */
1393
1394 static inline const char *
1395 gimple_filename (const_gimple stmt)
1396 {
1397 return LOCATION_FILE (gimple_location (stmt));
1398 }
1399
1400
1401 /* Return the line number of the location of STMT. */
1402
1403 static inline int
1404 gimple_lineno (const_gimple stmt)
1405 {
1406 return LOCATION_LINE (gimple_location (stmt));
1407 }
1408
1409
1410 /* Determine whether SEQ is a singleton. */
1411
1412 static inline bool
1413 gimple_seq_singleton_p (gimple_seq seq)
1414 {
1415 return ((gimple_seq_first (seq) != NULL)
1416 && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1417 }
1418
1419 /* Return true if no warnings should be emitted for statement STMT. */
1420
1421 static inline bool
1422 gimple_no_warning_p (const_gimple stmt)
1423 {
1424 return stmt->no_warning;
1425 }
1426
1427 /* Set the no_warning flag of STMT to NO_WARNING. */
1428
1429 static inline void
1430 gimple_set_no_warning (gimple stmt, bool no_warning)
1431 {
1432 stmt->no_warning = (unsigned) no_warning;
1433 }
1434
1435 /* Set the visited status on statement STMT to VISITED_P. */
1436
1437 static inline void
1438 gimple_set_visited (gimple stmt, bool visited_p)
1439 {
1440 stmt->visited = (unsigned) visited_p;
1441 }
1442
1443
1444 /* Return the visited status for statement STMT. */
1445
1446 static inline bool
1447 gimple_visited_p (gimple stmt)
1448 {
1449 return stmt->visited;
1450 }
1451
1452
1453 /* Set pass local flag PLF on statement STMT to VAL_P. */
1454
1455 static inline void
1456 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1457 {
1458 if (val_p)
1459 stmt->plf |= (unsigned int) plf;
1460 else
1461 stmt->plf &= ~((unsigned int) plf);
1462 }
1463
1464
1465 /* Return the value of pass local flag PLF on statement STMT. */
1466
1467 static inline unsigned int
1468 gimple_plf (gimple stmt, enum plf_mask plf)
1469 {
1470 return stmt->plf & ((unsigned int) plf);
1471 }
1472
1473
1474 /* Set the UID of statement. */
1475
1476 static inline void
1477 gimple_set_uid (gimple g, unsigned uid)
1478 {
1479 g->uid = uid;
1480 }
1481
1482
1483 /* Return the UID of statement. */
1484
1485 static inline unsigned
1486 gimple_uid (const_gimple g)
1487 {
1488 return g->uid;
1489 }
1490
1491
1492 /* Make statement G a singleton sequence. */
1493
1494 static inline void
1495 gimple_init_singleton (gimple g)
1496 {
1497 g->next = NULL;
1498 g->prev = g;
1499 }
1500
1501
1502 /* Return true if GIMPLE statement G has register or memory operands. */
1503
1504 static inline bool
1505 gimple_has_ops (const_gimple g)
1506 {
1507 return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1508 }
1509
1510 template <>
1511 template <>
1512 inline bool
1513 is_a_helper <const gimple_statement_with_ops>::test (const_gimple gs)
1514 {
1515 return gimple_has_ops (gs);
1516 }
1517
1518 template <>
1519 template <>
1520 inline bool
1521 is_a_helper <gimple_statement_with_ops>::test (gimple gs)
1522 {
1523 return gimple_has_ops (gs);
1524 }
1525
1526 /* Return true if GIMPLE statement G has memory operands. */
1527
1528 static inline bool
1529 gimple_has_mem_ops (const_gimple g)
1530 {
1531 return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1532 }
1533
1534 template <>
1535 template <>
1536 inline bool
1537 is_a_helper <const gimple_statement_with_memory_ops>::test (const_gimple gs)
1538 {
1539 return gimple_has_mem_ops (gs);
1540 }
1541
1542 template <>
1543 template <>
1544 inline bool
1545 is_a_helper <gimple_statement_with_memory_ops>::test (gimple gs)
1546 {
1547 return gimple_has_mem_ops (gs);
1548 }
1549
1550 /* Return the set of USE operands for statement G. */
1551
1552 static inline struct use_optype_d *
1553 gimple_use_ops (const_gimple g)
1554 {
1555 const gimple_statement_with_ops *ops_stmt =
1556 dyn_cast <const gimple_statement_with_ops> (g);
1557 if (!ops_stmt)
1558 return NULL;
1559 return ops_stmt->use_ops;
1560 }
1561
1562
1563 /* Set USE to be the set of USE operands for statement G. */
1564
1565 static inline void
1566 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1567 {
1568 gimple_statement_with_ops *ops_stmt =
1569 as_a <gimple_statement_with_ops> (g);
1570 ops_stmt->use_ops = use;
1571 }
1572
1573
1574 /* Return the single VUSE operand of the statement G. */
1575
1576 static inline tree
1577 gimple_vuse (const_gimple g)
1578 {
1579 const gimple_statement_with_memory_ops *mem_ops_stmt =
1580 dyn_cast <const gimple_statement_with_memory_ops> (g);
1581 if (!mem_ops_stmt)
1582 return NULL_TREE;
1583 return mem_ops_stmt->vuse;
1584 }
1585
1586 /* Return the single VDEF operand of the statement G. */
1587
1588 static inline tree
1589 gimple_vdef (const_gimple g)
1590 {
1591 const gimple_statement_with_memory_ops *mem_ops_stmt =
1592 dyn_cast <const gimple_statement_with_memory_ops> (g);
1593 if (!mem_ops_stmt)
1594 return NULL_TREE;
1595 return mem_ops_stmt->vdef;
1596 }
1597
1598 /* Return the single VUSE operand of the statement G. */
1599
1600 static inline tree *
1601 gimple_vuse_ptr (gimple g)
1602 {
1603 gimple_statement_with_memory_ops *mem_ops_stmt =
1604 dyn_cast <gimple_statement_with_memory_ops> (g);
1605 if (!mem_ops_stmt)
1606 return NULL;
1607 return &mem_ops_stmt->vuse;
1608 }
1609
1610 /* Return the single VDEF operand of the statement G. */
1611
1612 static inline tree *
1613 gimple_vdef_ptr (gimple g)
1614 {
1615 gimple_statement_with_memory_ops *mem_ops_stmt =
1616 dyn_cast <gimple_statement_with_memory_ops> (g);
1617 if (!mem_ops_stmt)
1618 return NULL;
1619 return &mem_ops_stmt->vdef;
1620 }
1621
1622 /* Set the single VUSE operand of the statement G. */
1623
1624 static inline void
1625 gimple_set_vuse (gimple g, tree vuse)
1626 {
1627 gimple_statement_with_memory_ops *mem_ops_stmt =
1628 as_a <gimple_statement_with_memory_ops> (g);
1629 mem_ops_stmt->vuse = vuse;
1630 }
1631
1632 /* Set the single VDEF operand of the statement G. */
1633
1634 static inline void
1635 gimple_set_vdef (gimple g, tree vdef)
1636 {
1637 gimple_statement_with_memory_ops *mem_ops_stmt =
1638 as_a <gimple_statement_with_memory_ops> (g);
1639 mem_ops_stmt->vdef = vdef;
1640 }
1641
1642
1643 /* Return true if statement G has operands and the modified field has
1644 been set. */
1645
1646 static inline bool
1647 gimple_modified_p (const_gimple g)
1648 {
1649 return (gimple_has_ops (g)) ? (bool) g->modified : false;
1650 }
1651
1652
1653 /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
1654 a MODIFIED field. */
1655
1656 static inline void
1657 gimple_set_modified (gimple s, bool modifiedp)
1658 {
1659 if (gimple_has_ops (s))
1660 s->modified = (unsigned) modifiedp;
1661 }
1662
1663
1664 /* Return the tree code for the expression computed by STMT. This is
1665 only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
1666 GIMPLE_CALL, return CALL_EXPR as the expression code for
1667 consistency. This is useful when the caller needs to deal with the
1668 three kinds of computation that GIMPLE supports. */
1669
1670 static inline enum tree_code
1671 gimple_expr_code (const_gimple stmt)
1672 {
1673 enum gimple_code code = gimple_code (stmt);
1674 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1675 return (enum tree_code) stmt->subcode;
1676 else
1677 {
1678 gcc_gimple_checking_assert (code == GIMPLE_CALL);
1679 return CALL_EXPR;
1680 }
1681 }
1682
1683
1684 /* Return true if statement STMT contains volatile operands. */
1685
1686 static inline bool
1687 gimple_has_volatile_ops (const_gimple stmt)
1688 {
1689 if (gimple_has_mem_ops (stmt))
1690 return stmt->has_volatile_ops;
1691 else
1692 return false;
1693 }
1694
1695
1696 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
1697
1698 static inline void
1699 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1700 {
1701 if (gimple_has_mem_ops (stmt))
1702 stmt->has_volatile_ops = (unsigned) volatilep;
1703 }
1704
1705 /* Return true if STMT is in a transaction. */
1706
1707 static inline bool
1708 gimple_in_transaction (gimple stmt)
1709 {
1710 return bb_in_transaction (gimple_bb (stmt));
1711 }
1712
1713 /* Return true if statement STMT may access memory. */
1714
1715 static inline bool
1716 gimple_references_memory_p (gimple stmt)
1717 {
1718 return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1719 }
1720
1721
1722 /* Return the subcode for OMP statement S. */
1723
1724 static inline unsigned
1725 gimple_omp_subcode (const_gimple s)
1726 {
1727 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1728 && gimple_code (s) <= GIMPLE_OMP_TEAMS);
1729 return s->subcode;
1730 }
1731
1732 /* Set the subcode for OMP statement S to SUBCODE. */
1733
1734 static inline void
1735 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1736 {
1737 /* We only have 16 bits for the subcode. Assert that we are not
1738 overflowing it. */
1739 gcc_gimple_checking_assert (subcode < (1 << 16));
1740 s->subcode = subcode;
1741 }
1742
1743 /* Set the nowait flag on OMP_RETURN statement S. */
1744
1745 static inline void
1746 gimple_omp_return_set_nowait (gimple s)
1747 {
1748 GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1749 s->subcode |= GF_OMP_RETURN_NOWAIT;
1750 }
1751
1752
1753 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1754 flag set. */
1755
1756 static inline bool
1757 gimple_omp_return_nowait_p (const_gimple g)
1758 {
1759 GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1760 return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1761 }
1762
1763
1764 /* Set the LHS of OMP return. */
1765
1766 static inline void
1767 gimple_omp_return_set_lhs (gimple g, tree lhs)
1768 {
1769 gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
1770 as_a <gimple_statement_omp_atomic_store> (g);
1771 omp_atomic_store_stmt->val = lhs;
1772 }
1773
1774
1775 /* Get the LHS of OMP return. */
1776
1777 static inline tree
1778 gimple_omp_return_lhs (const_gimple g)
1779 {
1780 const gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
1781 as_a <const gimple_statement_omp_atomic_store> (g);
1782 return omp_atomic_store_stmt->val;
1783 }
1784
1785
1786 /* Return a pointer to the LHS of OMP return. */
1787
1788 static inline tree *
1789 gimple_omp_return_lhs_ptr (gimple g)
1790 {
1791 gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
1792 as_a <gimple_statement_omp_atomic_store> (g);
1793 return &omp_atomic_store_stmt->val;
1794 }
1795
1796
1797 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1798 flag set. */
1799
1800 static inline bool
1801 gimple_omp_section_last_p (const_gimple g)
1802 {
1803 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1804 return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1805 }
1806
1807
1808 /* Set the GF_OMP_SECTION_LAST flag on G. */
1809
1810 static inline void
1811 gimple_omp_section_set_last (gimple g)
1812 {
1813 GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1814 g->subcode |= GF_OMP_SECTION_LAST;
1815 }
1816
1817
1818 /* Return true if OMP parallel statement G has the
1819 GF_OMP_PARALLEL_COMBINED flag set. */
1820
1821 static inline bool
1822 gimple_omp_parallel_combined_p (const_gimple g)
1823 {
1824 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1825 return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1826 }
1827
1828
1829 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1830 value of COMBINED_P. */
1831
1832 static inline void
1833 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1834 {
1835 GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1836 if (combined_p)
1837 g->subcode |= GF_OMP_PARALLEL_COMBINED;
1838 else
1839 g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
1840 }
1841
1842
1843 /* Return true if OMP atomic load/store statement G has the
1844 GF_OMP_ATOMIC_NEED_VALUE flag set. */
1845
1846 static inline bool
1847 gimple_omp_atomic_need_value_p (const_gimple g)
1848 {
1849 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1850 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1851 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
1852 }
1853
1854
1855 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
1856
1857 static inline void
1858 gimple_omp_atomic_set_need_value (gimple g)
1859 {
1860 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1861 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1862 g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
1863 }
1864
1865
1866 /* Return true if OMP atomic load/store statement G has the
1867 GF_OMP_ATOMIC_SEQ_CST flag set. */
1868
1869 static inline bool
1870 gimple_omp_atomic_seq_cst_p (const_gimple g)
1871 {
1872 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1873 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1874 return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_SEQ_CST) != 0;
1875 }
1876
1877
1878 /* Set the GF_OMP_ATOMIC_SEQ_CST flag on G. */
1879
1880 static inline void
1881 gimple_omp_atomic_set_seq_cst (gimple g)
1882 {
1883 if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
1884 GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
1885 g->subcode |= GF_OMP_ATOMIC_SEQ_CST;
1886 }
1887
1888
1889 /* Return the number of operands for statement GS. */
1890
1891 static inline unsigned
1892 gimple_num_ops (const_gimple gs)
1893 {
1894 return gs->num_ops;
1895 }
1896
1897
1898 /* Set the number of operands for statement GS. */
1899
1900 static inline void
1901 gimple_set_num_ops (gimple gs, unsigned num_ops)
1902 {
1903 gs->num_ops = num_ops;
1904 }
1905
1906
1907 /* Return the array of operands for statement GS. */
1908
1909 static inline tree *
1910 gimple_ops (gimple gs)
1911 {
1912 size_t off;
1913
1914 /* All the tuples have their operand vector at the very bottom
1915 of the structure. Note that those structures that do not
1916 have an operand vector have a zero offset. */
1917 off = gimple_ops_offset_[gimple_statement_structure (gs)];
1918 gcc_gimple_checking_assert (off != 0);
1919
1920 return (tree *) ((char *) gs + off);
1921 }
1922
1923
1924 /* Return operand I for statement GS. */
1925
1926 static inline tree
1927 gimple_op (const_gimple gs, unsigned i)
1928 {
1929 if (gimple_has_ops (gs))
1930 {
1931 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1932 return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1933 }
1934 else
1935 return NULL_TREE;
1936 }
1937
1938 /* Return a pointer to operand I for statement GS. */
1939
1940 static inline tree *
1941 gimple_op_ptr (const_gimple gs, unsigned i)
1942 {
1943 if (gimple_has_ops (gs))
1944 {
1945 gcc_gimple_checking_assert (i < gimple_num_ops (gs));
1946 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1947 }
1948 else
1949 return NULL;
1950 }
1951
1952 /* Set operand I of statement GS to OP. */
1953
1954 static inline void
1955 gimple_set_op (gimple gs, unsigned i, tree op)
1956 {
1957 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1958
1959 /* Note. It may be tempting to assert that OP matches
1960 is_gimple_operand, but that would be wrong. Different tuples
1961 accept slightly different sets of tree operands. Each caller
1962 should perform its own validation. */
1963 gimple_ops (gs)[i] = op;
1964 }
1965
1966 /* Return true if GS is a GIMPLE_ASSIGN. */
1967
1968 static inline bool
1969 is_gimple_assign (const_gimple gs)
1970 {
1971 return gimple_code (gs) == GIMPLE_ASSIGN;
1972 }
1973
1974 /* Determine if expression CODE is one of the valid expressions that can
1975 be used on the RHS of GIMPLE assignments. */
1976
1977 static inline enum gimple_rhs_class
1978 get_gimple_rhs_class (enum tree_code code)
1979 {
1980 return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1981 }
1982
1983 /* Return the LHS of assignment statement GS. */
1984
1985 static inline tree
1986 gimple_assign_lhs (const_gimple gs)
1987 {
1988 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1989 return gimple_op (gs, 0);
1990 }
1991
1992
1993 /* Return a pointer to the LHS of assignment statement GS. */
1994
1995 static inline tree *
1996 gimple_assign_lhs_ptr (const_gimple gs)
1997 {
1998 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1999 return gimple_op_ptr (gs, 0);
2000 }
2001
2002
2003 /* Set LHS to be the LHS operand of assignment statement GS. */
2004
2005 static inline void
2006 gimple_assign_set_lhs (gimple gs, tree lhs)
2007 {
2008 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2009 gimple_set_op (gs, 0, lhs);
2010
2011 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2012 SSA_NAME_DEF_STMT (lhs) = gs;
2013 }
2014
2015
2016 /* Return the first operand on the RHS of assignment statement GS. */
2017
2018 static inline tree
2019 gimple_assign_rhs1 (const_gimple gs)
2020 {
2021 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2022 return gimple_op (gs, 1);
2023 }
2024
2025
2026 /* Return a pointer to the first operand on the RHS of assignment
2027 statement GS. */
2028
2029 static inline tree *
2030 gimple_assign_rhs1_ptr (const_gimple gs)
2031 {
2032 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2033 return gimple_op_ptr (gs, 1);
2034 }
2035
2036 /* Set RHS to be the first operand on the RHS of assignment statement GS. */
2037
2038 static inline void
2039 gimple_assign_set_rhs1 (gimple gs, tree rhs)
2040 {
2041 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2042
2043 gimple_set_op (gs, 1, rhs);
2044 }
2045
2046
2047 /* Return the second operand on the RHS of assignment statement GS.
2048 If GS does not have two operands, NULL is returned instead. */
2049
2050 static inline tree
2051 gimple_assign_rhs2 (const_gimple gs)
2052 {
2053 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2054
2055 if (gimple_num_ops (gs) >= 3)
2056 return gimple_op (gs, 2);
2057 else
2058 return NULL_TREE;
2059 }
2060
2061
2062 /* Return a pointer to the second operand on the RHS of assignment
2063 statement GS. */
2064
2065 static inline tree *
2066 gimple_assign_rhs2_ptr (const_gimple gs)
2067 {
2068 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2069 return gimple_op_ptr (gs, 2);
2070 }
2071
2072
2073 /* Set RHS to be the second operand on the RHS of assignment statement GS. */
2074
2075 static inline void
2076 gimple_assign_set_rhs2 (gimple gs, tree rhs)
2077 {
2078 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2079
2080 gimple_set_op (gs, 2, rhs);
2081 }
2082
2083 /* Return the third operand on the RHS of assignment statement GS.
2084 If GS does not have two operands, NULL is returned instead. */
2085
2086 static inline tree
2087 gimple_assign_rhs3 (const_gimple gs)
2088 {
2089 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2090
2091 if (gimple_num_ops (gs) >= 4)
2092 return gimple_op (gs, 3);
2093 else
2094 return NULL_TREE;
2095 }
2096
2097 /* Return a pointer to the third operand on the RHS of assignment
2098 statement GS. */
2099
2100 static inline tree *
2101 gimple_assign_rhs3_ptr (const_gimple gs)
2102 {
2103 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2104 return gimple_op_ptr (gs, 3);
2105 }
2106
2107
2108 /* Set RHS to be the third operand on the RHS of assignment statement GS. */
2109
2110 static inline void
2111 gimple_assign_set_rhs3 (gimple gs, tree rhs)
2112 {
2113 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2114
2115 gimple_set_op (gs, 3, rhs);
2116 }
2117
2118 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect
2119 to see only a maximum of two operands. */
2120
2121 static inline void
2122 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
2123 tree op1, tree op2)
2124 {
2125 gimple_assign_set_rhs_with_ops_1 (gsi, code, op1, op2, NULL);
2126 }
2127
2128 /* Returns true if GS is a nontemporal move. */
2129
2130 static inline bool
2131 gimple_assign_nontemporal_move_p (const_gimple gs)
2132 {
2133 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2134 return gs->nontemporal_move;
2135 }
2136
2137 /* Sets nontemporal move flag of GS to NONTEMPORAL. */
2138
2139 static inline void
2140 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
2141 {
2142 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2143 gs->nontemporal_move = nontemporal;
2144 }
2145
2146
2147 /* Return the code of the expression computed on the rhs of assignment
2148 statement GS. In case that the RHS is a single object, returns the
2149 tree code of the object. */
2150
2151 static inline enum tree_code
2152 gimple_assign_rhs_code (const_gimple gs)
2153 {
2154 enum tree_code code;
2155 GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
2156
2157 code = (enum tree_code) gs->subcode;
2158 /* While we initially set subcode to the TREE_CODE of the rhs for
2159 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
2160 in sync when we rewrite stmts into SSA form or do SSA propagations. */
2161 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
2162 code = TREE_CODE (gimple_assign_rhs1 (gs));
2163
2164 return code;
2165 }
2166
2167
2168 /* Set CODE to be the code for the expression computed on the RHS of
2169 assignment S. */
2170
2171 static inline void
2172 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
2173 {
2174 GIMPLE_CHECK (s, GIMPLE_ASSIGN);
2175 s->subcode = code;
2176 }
2177
2178
2179 /* Return the gimple rhs class of the code of the expression computed on
2180 the rhs of assignment statement GS.
2181 This will never return GIMPLE_INVALID_RHS. */
2182
2183 static inline enum gimple_rhs_class
2184 gimple_assign_rhs_class (const_gimple gs)
2185 {
2186 return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
2187 }
2188
2189 /* Return true if GS is an assignment with a singleton RHS, i.e.,
2190 there is no operator associated with the assignment itself.
2191 Unlike gimple_assign_copy_p, this predicate returns true for
2192 any RHS operand, including those that perform an operation
2193 and do not have the semantics of a copy, such as COND_EXPR. */
2194
2195 static inline bool
2196 gimple_assign_single_p (gimple gs)
2197 {
2198 return (is_gimple_assign (gs)
2199 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
2200 }
2201
2202 /* Return true if GS performs a store to its lhs. */
2203
2204 static inline bool
2205 gimple_store_p (gimple gs)
2206 {
2207 tree lhs = gimple_get_lhs (gs);
2208 return lhs && !is_gimple_reg (lhs);
2209 }
2210
2211 /* Return true if GS is an assignment that loads from its rhs1. */
2212
2213 static inline bool
2214 gimple_assign_load_p (gimple gs)
2215 {
2216 tree rhs;
2217 if (!gimple_assign_single_p (gs))
2218 return false;
2219 rhs = gimple_assign_rhs1 (gs);
2220 if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
2221 return true;
2222 rhs = get_base_address (rhs);
2223 return (DECL_P (rhs)
2224 || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
2225 }
2226
2227
2228 /* Return true if S is a type-cast assignment. */
2229
2230 static inline bool
2231 gimple_assign_cast_p (gimple s)
2232 {
2233 if (is_gimple_assign (s))
2234 {
2235 enum tree_code sc = gimple_assign_rhs_code (s);
2236 return CONVERT_EXPR_CODE_P (sc)
2237 || sc == VIEW_CONVERT_EXPR
2238 || sc == FIX_TRUNC_EXPR;
2239 }
2240
2241 return false;
2242 }
2243
2244 /* Return true if S is a clobber statement. */
2245
2246 static inline bool
2247 gimple_clobber_p (gimple s)
2248 {
2249 return gimple_assign_single_p (s)
2250 && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
2251 }
2252
2253 /* Return true if GS is a GIMPLE_CALL. */
2254
2255 static inline bool
2256 is_gimple_call (const_gimple gs)
2257 {
2258 return gimple_code (gs) == GIMPLE_CALL;
2259 }
2260
2261 /* Return the LHS of call statement GS. */
2262
2263 static inline tree
2264 gimple_call_lhs (const_gimple gs)
2265 {
2266 GIMPLE_CHECK (gs, GIMPLE_CALL);
2267 return gimple_op (gs, 0);
2268 }
2269
2270
2271 /* Return a pointer to the LHS of call statement GS. */
2272
2273 static inline tree *
2274 gimple_call_lhs_ptr (const_gimple gs)
2275 {
2276 GIMPLE_CHECK (gs, GIMPLE_CALL);
2277 return gimple_op_ptr (gs, 0);
2278 }
2279
2280
2281 /* Set LHS to be the LHS operand of call statement GS. */
2282
2283 static inline void
2284 gimple_call_set_lhs (gimple gs, tree lhs)
2285 {
2286 GIMPLE_CHECK (gs, GIMPLE_CALL);
2287 gimple_set_op (gs, 0, lhs);
2288 if (lhs && TREE_CODE (lhs) == SSA_NAME)
2289 SSA_NAME_DEF_STMT (lhs) = gs;
2290 }
2291
2292
2293 /* Return true if call GS calls an internal-only function, as enumerated
2294 by internal_fn. */
2295
2296 static inline bool
2297 gimple_call_internal_p (const_gimple gs)
2298 {
2299 GIMPLE_CHECK (gs, GIMPLE_CALL);
2300 return (gs->subcode & GF_CALL_INTERNAL) != 0;
2301 }
2302
2303
2304 /* Return true if call GS is marked as instrumented by
2305 Pointer Bounds Checker. */
2306
2307 static inline bool
2308 gimple_call_with_bounds_p (const_gimple gs)
2309 {
2310 GIMPLE_CHECK (gs, GIMPLE_CALL);
2311 return (gs->subcode & GF_CALL_WITH_BOUNDS) != 0;
2312 }
2313
2314
2315 /* If INSTRUMENTED_P is true, marm statement GS as instrumented by
2316 Pointer Bounds Checker. */
2317
2318 static inline void
2319 gimple_call_set_with_bounds (gimple gs, bool with_bounds)
2320 {
2321 GIMPLE_CHECK (gs, GIMPLE_CALL);
2322 if (with_bounds)
2323 gs->subcode |= GF_CALL_WITH_BOUNDS;
2324 else
2325 gs->subcode &= ~GF_CALL_WITH_BOUNDS;
2326 }
2327
2328
2329 /* Return the target of internal call GS. */
2330
2331 static inline enum internal_fn
2332 gimple_call_internal_fn (const_gimple gs)
2333 {
2334 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2335 return static_cast <const gimple_statement_call *> (gs)->u.internal_fn;
2336 }
2337
2338
2339 /* Return the function type of the function called by GS. */
2340
2341 static inline tree
2342 gimple_call_fntype (const_gimple gs)
2343 {
2344 const gimple_statement_call *call_stmt =
2345 as_a <const gimple_statement_call> (gs);
2346 if (gimple_call_internal_p (gs))
2347 return NULL_TREE;
2348 return call_stmt->u.fntype;
2349 }
2350
2351 /* Set the type of the function called by GS to FNTYPE. */
2352
2353 static inline void
2354 gimple_call_set_fntype (gimple gs, tree fntype)
2355 {
2356 gimple_statement_call *call_stmt = as_a <gimple_statement_call> (gs);
2357 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2358 call_stmt->u.fntype = fntype;
2359 }
2360
2361
2362 /* Return the tree node representing the function called by call
2363 statement GS. */
2364
2365 static inline tree
2366 gimple_call_fn (const_gimple gs)
2367 {
2368 GIMPLE_CHECK (gs, GIMPLE_CALL);
2369 return gimple_op (gs, 1);
2370 }
2371
2372 /* Return a pointer to the tree node representing the function called by call
2373 statement GS. */
2374
2375 static inline tree *
2376 gimple_call_fn_ptr (const_gimple gs)
2377 {
2378 GIMPLE_CHECK (gs, GIMPLE_CALL);
2379 return gimple_op_ptr (gs, 1);
2380 }
2381
2382
2383 /* Set FN to be the function called by call statement GS. */
2384
2385 static inline void
2386 gimple_call_set_fn (gimple gs, tree fn)
2387 {
2388 GIMPLE_CHECK (gs, GIMPLE_CALL);
2389 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2390 gimple_set_op (gs, 1, fn);
2391 }
2392
2393
2394 /* Set FNDECL to be the function called by call statement GS. */
2395
2396 static inline void
2397 gimple_call_set_fndecl (gimple gs, tree decl)
2398 {
2399 GIMPLE_CHECK (gs, GIMPLE_CALL);
2400 gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
2401 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
2402 }
2403
2404
2405 /* Set internal function FN to be the function called by call statement GS. */
2406
2407 static inline void
2408 gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
2409 {
2410 gimple_statement_call *call_stmt = as_a <gimple_statement_call> (gs);
2411 gcc_gimple_checking_assert (gimple_call_internal_p (gs));
2412 call_stmt->u.internal_fn = fn;
2413 }
2414
2415
2416 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
2417 Otherwise return NULL. This function is analogous to
2418 get_callee_fndecl in tree land. */
2419
2420 static inline tree
2421 gimple_call_fndecl (const_gimple gs)
2422 {
2423 return gimple_call_addr_fndecl (gimple_call_fn (gs));
2424 }
2425
2426
2427 /* Return the type returned by call statement GS. */
2428
2429 static inline tree
2430 gimple_call_return_type (const_gimple gs)
2431 {
2432 tree type = gimple_call_fntype (gs);
2433
2434 if (type == NULL_TREE)
2435 return TREE_TYPE (gimple_call_lhs (gs));
2436
2437 /* The type returned by a function is the type of its
2438 function type. */
2439 return TREE_TYPE (type);
2440 }
2441
2442
2443 /* Return the static chain for call statement GS. */
2444
2445 static inline tree
2446 gimple_call_chain (const_gimple gs)
2447 {
2448 GIMPLE_CHECK (gs, GIMPLE_CALL);
2449 return gimple_op (gs, 2);
2450 }
2451
2452
2453 /* Return a pointer to the static chain for call statement GS. */
2454
2455 static inline tree *
2456 gimple_call_chain_ptr (const_gimple gs)
2457 {
2458 GIMPLE_CHECK (gs, GIMPLE_CALL);
2459 return gimple_op_ptr (gs, 2);
2460 }
2461
2462 /* Set CHAIN to be the static chain for call statement GS. */
2463
2464 static inline void
2465 gimple_call_set_chain (gimple gs, tree chain)
2466 {
2467 GIMPLE_CHECK (gs, GIMPLE_CALL);
2468
2469 gimple_set_op (gs, 2, chain);
2470 }
2471
2472
2473 /* Return the number of arguments used by call statement GS. */
2474
2475 static inline unsigned
2476 gimple_call_num_args (const_gimple gs)
2477 {
2478 unsigned num_ops;
2479 GIMPLE_CHECK (gs, GIMPLE_CALL);
2480 num_ops = gimple_num_ops (gs);
2481 return num_ops - 3;
2482 }
2483
2484
2485 /* Return the argument at position INDEX for call statement GS. */
2486
2487 static inline tree
2488 gimple_call_arg (const_gimple gs, unsigned index)
2489 {
2490 GIMPLE_CHECK (gs, GIMPLE_CALL);
2491 return gimple_op (gs, index + 3);
2492 }
2493
2494
2495 /* Return a pointer to the argument at position INDEX for call
2496 statement GS. */
2497
2498 static inline tree *
2499 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2500 {
2501 GIMPLE_CHECK (gs, GIMPLE_CALL);
2502 return gimple_op_ptr (gs, index + 3);
2503 }
2504
2505
2506 /* Set ARG to be the argument at position INDEX for call statement GS. */
2507
2508 static inline void
2509 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2510 {
2511 GIMPLE_CHECK (gs, GIMPLE_CALL);
2512 gimple_set_op (gs, index + 3, arg);
2513 }
2514
2515
2516 /* If TAIL_P is true, mark call statement S as being a tail call
2517 (i.e., a call just before the exit of a function). These calls are
2518 candidate for tail call optimization. */
2519
2520 static inline void
2521 gimple_call_set_tail (gimple s, bool tail_p)
2522 {
2523 GIMPLE_CHECK (s, GIMPLE_CALL);
2524 if (tail_p)
2525 s->subcode |= GF_CALL_TAILCALL;
2526 else
2527 s->subcode &= ~GF_CALL_TAILCALL;
2528 }
2529
2530
2531 /* Return true if GIMPLE_CALL S is marked as a tail call. */
2532
2533 static inline bool
2534 gimple_call_tail_p (gimple s)
2535 {
2536 GIMPLE_CHECK (s, GIMPLE_CALL);
2537 return (s->subcode & GF_CALL_TAILCALL) != 0;
2538 }
2539
2540
2541 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2542 slot optimization. This transformation uses the target of the call
2543 expansion as the return slot for calls that return in memory. */
2544
2545 static inline void
2546 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2547 {
2548 GIMPLE_CHECK (s, GIMPLE_CALL);
2549 if (return_slot_opt_p)
2550 s->subcode |= GF_CALL_RETURN_SLOT_OPT;
2551 else
2552 s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2553 }
2554
2555
2556 /* Return true if S is marked for return slot optimization. */
2557
2558 static inline bool
2559 gimple_call_return_slot_opt_p (gimple s)
2560 {
2561 GIMPLE_CHECK (s, GIMPLE_CALL);
2562 return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2563 }
2564
2565
2566 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2567 thunk to the thunked-to function. */
2568
2569 static inline void
2570 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2571 {
2572 GIMPLE_CHECK (s, GIMPLE_CALL);
2573 if (from_thunk_p)
2574 s->subcode |= GF_CALL_FROM_THUNK;
2575 else
2576 s->subcode &= ~GF_CALL_FROM_THUNK;
2577 }
2578
2579
2580 /* Return true if GIMPLE_CALL S is a jump from a thunk. */
2581
2582 static inline bool
2583 gimple_call_from_thunk_p (gimple s)
2584 {
2585 GIMPLE_CHECK (s, GIMPLE_CALL);
2586 return (s->subcode & GF_CALL_FROM_THUNK) != 0;
2587 }
2588
2589
2590 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2591 argument pack in its argument list. */
2592
2593 static inline void
2594 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2595 {
2596 GIMPLE_CHECK (s, GIMPLE_CALL);
2597 if (pass_arg_pack_p)
2598 s->subcode |= GF_CALL_VA_ARG_PACK;
2599 else
2600 s->subcode &= ~GF_CALL_VA_ARG_PACK;
2601 }
2602
2603
2604 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2605 argument pack in its argument list. */
2606
2607 static inline bool
2608 gimple_call_va_arg_pack_p (gimple s)
2609 {
2610 GIMPLE_CHECK (s, GIMPLE_CALL);
2611 return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
2612 }
2613
2614
2615 /* Return true if S is a noreturn call. */
2616
2617 static inline bool
2618 gimple_call_noreturn_p (gimple s)
2619 {
2620 GIMPLE_CHECK (s, GIMPLE_CALL);
2621 return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2622 }
2623
2624
2625 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
2626 even if the called function can throw in other cases. */
2627
2628 static inline void
2629 gimple_call_set_nothrow (gimple s, bool nothrow_p)
2630 {
2631 GIMPLE_CHECK (s, GIMPLE_CALL);
2632 if (nothrow_p)
2633 s->subcode |= GF_CALL_NOTHROW;
2634 else
2635 s->subcode &= ~GF_CALL_NOTHROW;
2636 }
2637
2638 /* Return true if S is a nothrow call. */
2639
2640 static inline bool
2641 gimple_call_nothrow_p (gimple s)
2642 {
2643 GIMPLE_CHECK (s, GIMPLE_CALL);
2644 return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2645 }
2646
2647 /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
2648 is known to be emitted for VLA objects. Those are wrapped by
2649 stack_save/stack_restore calls and hence can't lead to unbounded
2650 stack growth even when they occur in loops. */
2651
2652 static inline void
2653 gimple_call_set_alloca_for_var (gimple s, bool for_var)
2654 {
2655 GIMPLE_CHECK (s, GIMPLE_CALL);
2656 if (for_var)
2657 s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
2658 else
2659 s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
2660 }
2661
2662 /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
2663
2664 static inline bool
2665 gimple_call_alloca_for_var_p (gimple s)
2666 {
2667 GIMPLE_CHECK (s, GIMPLE_CALL);
2668 return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
2669 }
2670
2671 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
2672
2673 static inline void
2674 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2675 {
2676 GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2677 GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2678 dest_call->subcode = orig_call->subcode;
2679 }
2680
2681
2682 /* Return a pointer to the points-to solution for the set of call-used
2683 variables of the call CALL. */
2684
2685 static inline struct pt_solution *
2686 gimple_call_use_set (gimple call)
2687 {
2688 gimple_statement_call *call_stmt = as_a <gimple_statement_call> (call);
2689 return &call_stmt->call_used;
2690 }
2691
2692
2693 /* Return a pointer to the points-to solution for the set of call-used
2694 variables of the call CALL. */
2695
2696 static inline struct pt_solution *
2697 gimple_call_clobber_set (gimple call)
2698 {
2699 gimple_statement_call *call_stmt = as_a <gimple_statement_call> (call);
2700 return &call_stmt->call_clobbered;
2701 }
2702
2703
2704 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2705 non-NULL lhs. */
2706
2707 static inline bool
2708 gimple_has_lhs (gimple stmt)
2709 {
2710 return (is_gimple_assign (stmt)
2711 || (is_gimple_call (stmt)
2712 && gimple_call_lhs (stmt) != NULL_TREE));
2713 }
2714
2715
2716 /* Return the code of the predicate computed by conditional statement GS. */
2717
2718 static inline enum tree_code
2719 gimple_cond_code (const_gimple gs)
2720 {
2721 GIMPLE_CHECK (gs, GIMPLE_COND);
2722 return (enum tree_code) gs->subcode;
2723 }
2724
2725
2726 /* Set CODE to be the predicate code for the conditional statement GS. */
2727
2728 static inline void
2729 gimple_cond_set_code (gimple gs, enum tree_code code)
2730 {
2731 GIMPLE_CHECK (gs, GIMPLE_COND);
2732 gs->subcode = code;
2733 }
2734
2735
2736 /* Return the LHS of the predicate computed by conditional statement GS. */
2737
2738 static inline tree
2739 gimple_cond_lhs (const_gimple gs)
2740 {
2741 GIMPLE_CHECK (gs, GIMPLE_COND);
2742 return gimple_op (gs, 0);
2743 }
2744
2745 /* Return the pointer to the LHS of the predicate computed by conditional
2746 statement GS. */
2747
2748 static inline tree *
2749 gimple_cond_lhs_ptr (const_gimple gs)
2750 {
2751 GIMPLE_CHECK (gs, GIMPLE_COND);
2752 return gimple_op_ptr (gs, 0);
2753 }
2754
2755 /* Set LHS to be the LHS operand of the predicate computed by
2756 conditional statement GS. */
2757
2758 static inline void
2759 gimple_cond_set_lhs (gimple gs, tree lhs)
2760 {
2761 GIMPLE_CHECK (gs, GIMPLE_COND);
2762 gimple_set_op (gs, 0, lhs);
2763 }
2764
2765
2766 /* Return the RHS operand of the predicate computed by conditional GS. */
2767
2768 static inline tree
2769 gimple_cond_rhs (const_gimple gs)
2770 {
2771 GIMPLE_CHECK (gs, GIMPLE_COND);
2772 return gimple_op (gs, 1);
2773 }
2774
2775 /* Return the pointer to the RHS operand of the predicate computed by
2776 conditional GS. */
2777
2778 static inline tree *
2779 gimple_cond_rhs_ptr (const_gimple gs)
2780 {
2781 GIMPLE_CHECK (gs, GIMPLE_COND);
2782 return gimple_op_ptr (gs, 1);
2783 }
2784
2785
2786 /* Set RHS to be the RHS operand of the predicate computed by
2787 conditional statement GS. */
2788
2789 static inline void
2790 gimple_cond_set_rhs (gimple gs, tree rhs)
2791 {
2792 GIMPLE_CHECK (gs, GIMPLE_COND);
2793 gimple_set_op (gs, 1, rhs);
2794 }
2795
2796
2797 /* Return the label used by conditional statement GS when its
2798 predicate evaluates to true. */
2799
2800 static inline tree
2801 gimple_cond_true_label (const_gimple gs)
2802 {
2803 GIMPLE_CHECK (gs, GIMPLE_COND);
2804 return gimple_op (gs, 2);
2805 }
2806
2807
2808 /* Set LABEL to be the label used by conditional statement GS when its
2809 predicate evaluates to true. */
2810
2811 static inline void
2812 gimple_cond_set_true_label (gimple gs, tree label)
2813 {
2814 GIMPLE_CHECK (gs, GIMPLE_COND);
2815 gimple_set_op (gs, 2, label);
2816 }
2817
2818
2819 /* Set LABEL to be the label used by conditional statement GS when its
2820 predicate evaluates to false. */
2821
2822 static inline void
2823 gimple_cond_set_false_label (gimple gs, tree label)
2824 {
2825 GIMPLE_CHECK (gs, GIMPLE_COND);
2826 gimple_set_op (gs, 3, label);
2827 }
2828
2829
2830 /* Return the label used by conditional statement GS when its
2831 predicate evaluates to false. */
2832
2833 static inline tree
2834 gimple_cond_false_label (const_gimple gs)
2835 {
2836 GIMPLE_CHECK (gs, GIMPLE_COND);
2837 return gimple_op (gs, 3);
2838 }
2839
2840
2841 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
2842
2843 static inline void
2844 gimple_cond_make_false (gimple gs)
2845 {
2846 gimple_cond_set_lhs (gs, boolean_true_node);
2847 gimple_cond_set_rhs (gs, boolean_false_node);
2848 gs->subcode = EQ_EXPR;
2849 }
2850
2851
2852 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
2853
2854 static inline void
2855 gimple_cond_make_true (gimple gs)
2856 {
2857 gimple_cond_set_lhs (gs, boolean_true_node);
2858 gimple_cond_set_rhs (gs, boolean_true_node);
2859 gs->subcode = EQ_EXPR;
2860 }
2861
2862 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2863 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2864
2865 static inline bool
2866 gimple_cond_true_p (const_gimple gs)
2867 {
2868 tree lhs = gimple_cond_lhs (gs);
2869 tree rhs = gimple_cond_rhs (gs);
2870 enum tree_code code = gimple_cond_code (gs);
2871
2872 if (lhs != boolean_true_node && lhs != boolean_false_node)
2873 return false;
2874
2875 if (rhs != boolean_true_node && rhs != boolean_false_node)
2876 return false;
2877
2878 if (code == NE_EXPR && lhs != rhs)
2879 return true;
2880
2881 if (code == EQ_EXPR && lhs == rhs)
2882 return true;
2883
2884 return false;
2885 }
2886
2887 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2888 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2889
2890 static inline bool
2891 gimple_cond_false_p (const_gimple gs)
2892 {
2893 tree lhs = gimple_cond_lhs (gs);
2894 tree rhs = gimple_cond_rhs (gs);
2895 enum tree_code code = gimple_cond_code (gs);
2896
2897 if (lhs != boolean_true_node && lhs != boolean_false_node)
2898 return false;
2899
2900 if (rhs != boolean_true_node && rhs != boolean_false_node)
2901 return false;
2902
2903 if (code == NE_EXPR && lhs == rhs)
2904 return true;
2905
2906 if (code == EQ_EXPR && lhs != rhs)
2907 return true;
2908
2909 return false;
2910 }
2911
2912 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
2913
2914 static inline void
2915 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2916 {
2917 gimple_cond_set_code (stmt, code);
2918 gimple_cond_set_lhs (stmt, lhs);
2919 gimple_cond_set_rhs (stmt, rhs);
2920 }
2921
2922 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
2923
2924 static inline tree
2925 gimple_label_label (const_gimple gs)
2926 {
2927 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2928 return gimple_op (gs, 0);
2929 }
2930
2931
2932 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2933 GS. */
2934
2935 static inline void
2936 gimple_label_set_label (gimple gs, tree label)
2937 {
2938 GIMPLE_CHECK (gs, GIMPLE_LABEL);
2939 gimple_set_op (gs, 0, label);
2940 }
2941
2942
2943 /* Return the destination of the unconditional jump GS. */
2944
2945 static inline tree
2946 gimple_goto_dest (const_gimple gs)
2947 {
2948 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2949 return gimple_op (gs, 0);
2950 }
2951
2952
2953 /* Set DEST to be the destination of the unconditonal jump GS. */
2954
2955 static inline void
2956 gimple_goto_set_dest (gimple gs, tree dest)
2957 {
2958 GIMPLE_CHECK (gs, GIMPLE_GOTO);
2959 gimple_set_op (gs, 0, dest);
2960 }
2961
2962
2963 /* Return the variables declared in the GIMPLE_BIND statement GS. */
2964
2965 static inline tree
2966 gimple_bind_vars (const_gimple gs)
2967 {
2968 const gimple_statement_bind *bind_stmt =
2969 as_a <const gimple_statement_bind> (gs);
2970 return bind_stmt->vars;
2971 }
2972
2973
2974 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2975 statement GS. */
2976
2977 static inline void
2978 gimple_bind_set_vars (gimple gs, tree vars)
2979 {
2980 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
2981 bind_stmt->vars = vars;
2982 }
2983
2984
2985 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2986 statement GS. */
2987
2988 static inline void
2989 gimple_bind_append_vars (gimple gs, tree vars)
2990 {
2991 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
2992 bind_stmt->vars = chainon (bind_stmt->vars, vars);
2993 }
2994
2995
2996 static inline gimple_seq *
2997 gimple_bind_body_ptr (gimple gs)
2998 {
2999 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
3000 return &bind_stmt->body;
3001 }
3002
3003 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
3004
3005 static inline gimple_seq
3006 gimple_bind_body (gimple gs)
3007 {
3008 return *gimple_bind_body_ptr (gs);
3009 }
3010
3011
3012 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
3013 statement GS. */
3014
3015 static inline void
3016 gimple_bind_set_body (gimple gs, gimple_seq seq)
3017 {
3018 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
3019 bind_stmt->body = seq;
3020 }
3021
3022
3023 /* Append a statement to the end of a GIMPLE_BIND's body. */
3024
3025 static inline void
3026 gimple_bind_add_stmt (gimple gs, gimple stmt)
3027 {
3028 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
3029 gimple_seq_add_stmt (&bind_stmt->body, stmt);
3030 }
3031
3032
3033 /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
3034
3035 static inline void
3036 gimple_bind_add_seq (gimple gs, gimple_seq seq)
3037 {
3038 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
3039 gimple_seq_add_seq (&bind_stmt->body, seq);
3040 }
3041
3042
3043 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
3044 GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
3045
3046 static inline tree
3047 gimple_bind_block (const_gimple gs)
3048 {
3049 const gimple_statement_bind *bind_stmt =
3050 as_a <const gimple_statement_bind> (gs);
3051 return bind_stmt->block;
3052 }
3053
3054
3055 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
3056 statement GS. */
3057
3058 static inline void
3059 gimple_bind_set_block (gimple gs, tree block)
3060 {
3061 gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
3062 gcc_gimple_checking_assert (block == NULL_TREE
3063 || TREE_CODE (block) == BLOCK);
3064 bind_stmt->block = block;
3065 }
3066
3067
3068 /* Return the number of input operands for GIMPLE_ASM GS. */
3069
3070 static inline unsigned
3071 gimple_asm_ninputs (const_gimple gs)
3072 {
3073 const gimple_statement_asm *asm_stmt =
3074 as_a <const gimple_statement_asm> (gs);
3075 return asm_stmt->ni;
3076 }
3077
3078
3079 /* Return the number of output operands for GIMPLE_ASM GS. */
3080
3081 static inline unsigned
3082 gimple_asm_noutputs (const_gimple gs)
3083 {
3084 const gimple_statement_asm *asm_stmt =
3085 as_a <const gimple_statement_asm> (gs);
3086 return asm_stmt->no;
3087 }
3088
3089
3090 /* Return the number of clobber operands for GIMPLE_ASM GS. */
3091
3092 static inline unsigned
3093 gimple_asm_nclobbers (const_gimple gs)
3094 {
3095 const gimple_statement_asm *asm_stmt =
3096 as_a <const gimple_statement_asm> (gs);
3097 return asm_stmt->nc;
3098 }
3099
3100 /* Return the number of label operands for GIMPLE_ASM GS. */
3101
3102 static inline unsigned
3103 gimple_asm_nlabels (const_gimple gs)
3104 {
3105 const gimple_statement_asm *asm_stmt =
3106 as_a <const gimple_statement_asm> (gs);
3107 return asm_stmt->nl;
3108 }
3109
3110 /* Return input operand INDEX of GIMPLE_ASM GS. */
3111
3112 static inline tree
3113 gimple_asm_input_op (const_gimple gs, unsigned index)
3114 {
3115 const gimple_statement_asm *asm_stmt =
3116 as_a <const gimple_statement_asm> (gs);
3117 gcc_gimple_checking_assert (index < asm_stmt->ni);
3118 return gimple_op (gs, index + asm_stmt->no);
3119 }
3120
3121 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
3122
3123 static inline tree *
3124 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
3125 {
3126 const gimple_statement_asm *asm_stmt =
3127 as_a <const gimple_statement_asm> (gs);
3128 gcc_gimple_checking_assert (index < asm_stmt->ni);
3129 return gimple_op_ptr (gs, index + asm_stmt->no);
3130 }
3131
3132
3133 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */
3134
3135 static inline void
3136 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
3137 {
3138 gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
3139 gcc_gimple_checking_assert (index < asm_stmt->ni
3140 && TREE_CODE (in_op) == TREE_LIST);
3141 gimple_set_op (gs, index + asm_stmt->no, in_op);
3142 }
3143
3144
3145 /* Return output operand INDEX of GIMPLE_ASM GS. */
3146
3147 static inline tree
3148 gimple_asm_output_op (const_gimple gs, unsigned index)
3149 {
3150 const gimple_statement_asm *asm_stmt =
3151 as_a <const gimple_statement_asm> (gs);
3152 gcc_gimple_checking_assert (index < asm_stmt->no);
3153 return gimple_op (gs, index);
3154 }
3155
3156 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */
3157
3158 static inline tree *
3159 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
3160 {
3161 const gimple_statement_asm *asm_stmt =
3162 as_a <const gimple_statement_asm> (gs);
3163 gcc_gimple_checking_assert (index < asm_stmt->no);
3164 return gimple_op_ptr (gs, index);
3165 }
3166
3167
3168 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */
3169
3170 static inline void
3171 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
3172 {
3173 gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
3174 gcc_gimple_checking_assert (index < asm_stmt->no
3175 && TREE_CODE (out_op) == TREE_LIST);
3176 gimple_set_op (gs, index, out_op);
3177 }
3178
3179
3180 /* Return clobber operand INDEX of GIMPLE_ASM GS. */
3181
3182 static inline tree
3183 gimple_asm_clobber_op (const_gimple gs, unsigned index)
3184 {
3185 const gimple_statement_asm *asm_stmt =
3186 as_a <const gimple_statement_asm> (gs);
3187 gcc_gimple_checking_assert (index < asm_stmt->nc);
3188 return gimple_op (gs, index + asm_stmt->ni + asm_stmt->no);
3189 }
3190
3191
3192 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */
3193
3194 static inline void
3195 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
3196 {
3197 gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
3198 gcc_gimple_checking_assert (index < asm_stmt->nc
3199 && TREE_CODE (clobber_op) == TREE_LIST);
3200 gimple_set_op (gs, index + asm_stmt->ni + asm_stmt->no, clobber_op);
3201 }
3202
3203 /* Return label operand INDEX of GIMPLE_ASM GS. */
3204
3205 static inline tree
3206 gimple_asm_label_op (const_gimple gs, unsigned index)
3207 {
3208 const gimple_statement_asm *asm_stmt =
3209 as_a <const gimple_statement_asm> (gs);
3210 gcc_gimple_checking_assert (index < asm_stmt->nl);
3211 return gimple_op (gs, index + asm_stmt->ni + asm_stmt->nc);
3212 }
3213
3214 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
3215
3216 static inline void
3217 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
3218 {
3219 gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
3220 gcc_gimple_checking_assert (index < asm_stmt->nl
3221 && TREE_CODE (label_op) == TREE_LIST);
3222 gimple_set_op (gs, index + asm_stmt->ni + asm_stmt->nc, label_op);
3223 }
3224
3225 /* Return the string representing the assembly instruction in
3226 GIMPLE_ASM GS. */
3227
3228 static inline const char *
3229 gimple_asm_string (const_gimple gs)
3230 {
3231 const gimple_statement_asm *asm_stmt =
3232 as_a <const gimple_statement_asm> (gs);
3233 return asm_stmt->string;
3234 }
3235
3236
3237 /* Return true if GS is an asm statement marked volatile. */
3238
3239 static inline bool
3240 gimple_asm_volatile_p (const_gimple gs)
3241 {
3242 GIMPLE_CHECK (gs, GIMPLE_ASM);
3243 return (gs->subcode & GF_ASM_VOLATILE) != 0;
3244 }
3245
3246
3247 /* If VOLATLE_P is true, mark asm statement GS as volatile. */
3248
3249 static inline void
3250 gimple_asm_set_volatile (gimple gs, bool volatile_p)
3251 {
3252 GIMPLE_CHECK (gs, GIMPLE_ASM);
3253 if (volatile_p)
3254 gs->subcode |= GF_ASM_VOLATILE;
3255 else
3256 gs->subcode &= ~GF_ASM_VOLATILE;
3257 }
3258
3259
3260 /* If INPUT_P is true, mark asm GS as an ASM_INPUT. */
3261
3262 static inline void
3263 gimple_asm_set_input (gimple gs, bool input_p)
3264 {
3265 GIMPLE_CHECK (gs, GIMPLE_ASM);
3266 if (input_p)
3267 gs->subcode |= GF_ASM_INPUT;
3268 else
3269 gs->subcode &= ~GF_ASM_INPUT;
3270 }
3271
3272
3273 /* Return true if asm GS is an ASM_INPUT. */
3274
3275 static inline bool
3276 gimple_asm_input_p (const_gimple gs)
3277 {
3278 GIMPLE_CHECK (gs, GIMPLE_ASM);
3279 return (gs->subcode & GF_ASM_INPUT) != 0;
3280 }
3281
3282
3283 /* Return the types handled by GIMPLE_CATCH statement GS. */
3284
3285 static inline tree
3286 gimple_catch_types (const_gimple gs)
3287 {
3288 const gimple_statement_catch *catch_stmt =
3289 as_a <const gimple_statement_catch> (gs);
3290 return catch_stmt->types;
3291 }
3292
3293
3294 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS. */
3295
3296 static inline tree *
3297 gimple_catch_types_ptr (gimple gs)
3298 {
3299 gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
3300 return &catch_stmt->types;
3301 }
3302
3303
3304 /* Return a pointer to the GIMPLE sequence representing the body of
3305 the handler of GIMPLE_CATCH statement GS. */
3306
3307 static inline gimple_seq *
3308 gimple_catch_handler_ptr (gimple gs)
3309 {
3310 gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
3311 return &catch_stmt->handler;
3312 }
3313
3314
3315 /* Return the GIMPLE sequence representing the body of the handler of
3316 GIMPLE_CATCH statement GS. */
3317
3318 static inline gimple_seq
3319 gimple_catch_handler (gimple gs)
3320 {
3321 return *gimple_catch_handler_ptr (gs);
3322 }
3323
3324
3325 /* Set T to be the set of types handled by GIMPLE_CATCH GS. */
3326
3327 static inline void
3328 gimple_catch_set_types (gimple gs, tree t)
3329 {
3330 gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
3331 catch_stmt->types = t;
3332 }
3333
3334
3335 /* Set HANDLER to be the body of GIMPLE_CATCH GS. */
3336
3337 static inline void
3338 gimple_catch_set_handler (gimple gs, gimple_seq handler)
3339 {
3340 gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
3341 catch_stmt->handler = handler;
3342 }
3343
3344
3345 /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
3346
3347 static inline tree
3348 gimple_eh_filter_types (const_gimple gs)
3349 {
3350 const gimple_statement_eh_filter *eh_filter_stmt =
3351 as_a <const gimple_statement_eh_filter> (gs);
3352 return eh_filter_stmt->types;
3353 }
3354
3355
3356 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
3357 GS. */
3358
3359 static inline tree *
3360 gimple_eh_filter_types_ptr (gimple gs)
3361 {
3362 gimple_statement_eh_filter *eh_filter_stmt =
3363 as_a <gimple_statement_eh_filter> (gs);
3364 return &eh_filter_stmt->types;
3365 }
3366
3367
3368 /* Return a pointer to the sequence of statement to execute when
3369 GIMPLE_EH_FILTER statement fails. */
3370
3371 static inline gimple_seq *
3372 gimple_eh_filter_failure_ptr (gimple gs)
3373 {
3374 gimple_statement_eh_filter *eh_filter_stmt =
3375 as_a <gimple_statement_eh_filter> (gs);
3376 return &eh_filter_stmt->failure;
3377 }
3378
3379
3380 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
3381 statement fails. */
3382
3383 static inline gimple_seq
3384 gimple_eh_filter_failure (gimple gs)
3385 {
3386 return *gimple_eh_filter_failure_ptr (gs);
3387 }
3388
3389
3390 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS. */
3391
3392 static inline void
3393 gimple_eh_filter_set_types (gimple gs, tree types)
3394 {
3395 gimple_statement_eh_filter *eh_filter_stmt =
3396 as_a <gimple_statement_eh_filter> (gs);
3397 eh_filter_stmt->types = types;
3398 }
3399
3400
3401 /* Set FAILURE to be the sequence of statements to execute on failure
3402 for GIMPLE_EH_FILTER GS. */
3403
3404 static inline void
3405 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
3406 {
3407 gimple_statement_eh_filter *eh_filter_stmt =
3408 as_a <gimple_statement_eh_filter> (gs);
3409 eh_filter_stmt->failure = failure;
3410 }
3411
3412 /* Get the function decl to be called by the MUST_NOT_THROW region. */
3413
3414 static inline tree
3415 gimple_eh_must_not_throw_fndecl (gimple gs)
3416 {
3417 gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt> (gs);
3418 return eh_mnt_stmt->fndecl;
3419 }
3420
3421 /* Set the function decl to be called by GS to DECL. */
3422
3423 static inline void
3424 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
3425 {
3426 gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt> (gs);
3427 eh_mnt_stmt->fndecl = decl;
3428 }
3429
3430 /* GIMPLE_EH_ELSE accessors. */
3431
3432 static inline gimple_seq *
3433 gimple_eh_else_n_body_ptr (gimple gs)
3434 {
3435 gimple_statement_eh_else *eh_else_stmt =
3436 as_a <gimple_statement_eh_else> (gs);
3437 return &eh_else_stmt->n_body;
3438 }
3439
3440 static inline gimple_seq
3441 gimple_eh_else_n_body (gimple gs)
3442 {
3443 return *gimple_eh_else_n_body_ptr (gs);
3444 }
3445
3446 static inline gimple_seq *
3447 gimple_eh_else_e_body_ptr (gimple gs)
3448 {
3449 gimple_statement_eh_else *eh_else_stmt =
3450 as_a <gimple_statement_eh_else> (gs);
3451 return &eh_else_stmt->e_body;
3452 }
3453
3454 static inline gimple_seq
3455 gimple_eh_else_e_body (gimple gs)
3456 {
3457 return *gimple_eh_else_e_body_ptr (gs);
3458 }
3459
3460 static inline void
3461 gimple_eh_else_set_n_body (gimple gs, gimple_seq seq)
3462 {
3463 gimple_statement_eh_else *eh_else_stmt =
3464 as_a <gimple_statement_eh_else> (gs);
3465 eh_else_stmt->n_body = seq;
3466 }
3467
3468 static inline void
3469 gimple_eh_else_set_e_body (gimple gs, gimple_seq seq)
3470 {
3471 gimple_statement_eh_else *eh_else_stmt =
3472 as_a <gimple_statement_eh_else> (gs);
3473 eh_else_stmt->e_body = seq;
3474 }
3475
3476 /* GIMPLE_TRY accessors. */
3477
3478 /* Return the kind of try block represented by GIMPLE_TRY GS. This is
3479 either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
3480
3481 static inline enum gimple_try_flags
3482 gimple_try_kind (const_gimple gs)
3483 {
3484 GIMPLE_CHECK (gs, GIMPLE_TRY);
3485 return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
3486 }
3487
3488
3489 /* Set the kind of try block represented by GIMPLE_TRY GS. */
3490
3491 static inline void
3492 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
3493 {
3494 GIMPLE_CHECK (gs, GIMPLE_TRY);
3495 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
3496 || kind == GIMPLE_TRY_FINALLY);
3497 if (gimple_try_kind (gs) != kind)
3498 gs->subcode = (unsigned int) kind;
3499 }
3500
3501
3502 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3503
3504 static inline bool
3505 gimple_try_catch_is_cleanup (const_gimple gs)
3506 {
3507 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
3508 return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3509 }
3510
3511
3512 /* Return a pointer to the sequence of statements used as the
3513 body for GIMPLE_TRY GS. */
3514
3515 static inline gimple_seq *
3516 gimple_try_eval_ptr (gimple gs)
3517 {
3518 gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
3519 return &try_stmt->eval;
3520 }
3521
3522
3523 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
3524
3525 static inline gimple_seq
3526 gimple_try_eval (gimple gs)
3527 {
3528 return *gimple_try_eval_ptr (gs);
3529 }
3530
3531
3532 /* Return a pointer to the sequence of statements used as the cleanup body for
3533 GIMPLE_TRY GS. */
3534
3535 static inline gimple_seq *
3536 gimple_try_cleanup_ptr (gimple gs)
3537 {
3538 gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
3539 return &try_stmt->cleanup;
3540 }
3541
3542
3543 /* Return the sequence of statements used as the cleanup body for
3544 GIMPLE_TRY GS. */
3545
3546 static inline gimple_seq
3547 gimple_try_cleanup (gimple gs)
3548 {
3549 return *gimple_try_cleanup_ptr (gs);
3550 }
3551
3552
3553 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
3554
3555 static inline void
3556 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3557 {
3558 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3559 if (catch_is_cleanup)
3560 g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3561 else
3562 g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3563 }
3564
3565
3566 /* Set EVAL to be the sequence of statements to use as the body for
3567 GIMPLE_TRY GS. */
3568
3569 static inline void
3570 gimple_try_set_eval (gimple gs, gimple_seq eval)
3571 {
3572 gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
3573 try_stmt->eval = eval;
3574 }
3575
3576
3577 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3578 body for GIMPLE_TRY GS. */
3579
3580 static inline void
3581 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3582 {
3583 gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
3584 try_stmt->cleanup = cleanup;
3585 }
3586
3587
3588 /* Return a pointer to the cleanup sequence for cleanup statement GS. */
3589
3590 static inline gimple_seq *
3591 gimple_wce_cleanup_ptr (gimple gs)
3592 {
3593 gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce> (gs);
3594 return &wce_stmt->cleanup;
3595 }
3596
3597
3598 /* Return the cleanup sequence for cleanup statement GS. */
3599
3600 static inline gimple_seq
3601 gimple_wce_cleanup (gimple gs)
3602 {
3603 return *gimple_wce_cleanup_ptr (gs);
3604 }
3605
3606
3607 /* Set CLEANUP to be the cleanup sequence for GS. */
3608
3609 static inline void
3610 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3611 {
3612 gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce> (gs);
3613 wce_stmt->cleanup = cleanup;
3614 }
3615
3616
3617 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
3618
3619 static inline bool
3620 gimple_wce_cleanup_eh_only (const_gimple gs)
3621 {
3622 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3623 return gs->subcode != 0;
3624 }
3625
3626
3627 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
3628
3629 static inline void
3630 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3631 {
3632 GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3633 gs->subcode = (unsigned int) eh_only_p;
3634 }
3635
3636
3637 /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
3638
3639 static inline unsigned
3640 gimple_phi_capacity (const_gimple gs)
3641 {
3642 const gimple_statement_phi *phi_stmt =
3643 as_a <const gimple_statement_phi> (gs);
3644 return phi_stmt->capacity;
3645 }
3646
3647
3648 /* Return the number of arguments in GIMPLE_PHI GS. This must always
3649 be exactly the number of incoming edges for the basic block holding
3650 GS. */
3651
3652 static inline unsigned
3653 gimple_phi_num_args (const_gimple gs)
3654 {
3655 const gimple_statement_phi *phi_stmt =
3656 as_a <const gimple_statement_phi> (gs);
3657 return phi_stmt->nargs;
3658 }
3659
3660
3661 /* Return the SSA name created by GIMPLE_PHI GS. */
3662
3663 static inline tree
3664 gimple_phi_result (const_gimple gs)
3665 {
3666 const gimple_statement_phi *phi_stmt =
3667 as_a <const gimple_statement_phi> (gs);
3668 return phi_stmt->result;
3669 }
3670
3671 /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
3672
3673 static inline tree *
3674 gimple_phi_result_ptr (gimple gs)
3675 {
3676 gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
3677 return &phi_stmt->result;
3678 }
3679
3680 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
3681
3682 static inline void
3683 gimple_phi_set_result (gimple gs, tree result)
3684 {
3685 gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
3686 phi_stmt->result = result;
3687 if (result && TREE_CODE (result) == SSA_NAME)
3688 SSA_NAME_DEF_STMT (result) = gs;
3689 }
3690
3691
3692 /* Return the PHI argument corresponding to incoming edge INDEX for
3693 GIMPLE_PHI GS. */
3694
3695 static inline struct phi_arg_d *
3696 gimple_phi_arg (gimple gs, unsigned index)
3697 {
3698 gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
3699 gcc_gimple_checking_assert (index <= phi_stmt->capacity);
3700 return &(phi_stmt->args[index]);
3701 }
3702
3703 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3704 for GIMPLE_PHI GS. */
3705
3706 static inline void
3707 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3708 {
3709 gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
3710 gcc_gimple_checking_assert (index <= phi_stmt->nargs);
3711 phi_stmt->args[index] = *phiarg;
3712 }
3713
3714 /* Return the PHI nodes for basic block BB, or NULL if there are no
3715 PHI nodes. */
3716
3717 static inline gimple_seq
3718 phi_nodes (const_basic_block bb)
3719 {
3720 gcc_checking_assert (!(bb->flags & BB_RTL));
3721 return bb->il.gimple.phi_nodes;
3722 }
3723
3724 /* Return a pointer to the PHI nodes for basic block BB. */
3725
3726 static inline gimple_seq *
3727 phi_nodes_ptr (basic_block bb)
3728 {
3729 gcc_checking_assert (!(bb->flags & BB_RTL));
3730 return &bb->il.gimple.phi_nodes;
3731 }
3732
3733 /* Return the tree operand for argument I of PHI node GS. */
3734
3735 static inline tree
3736 gimple_phi_arg_def (gimple gs, size_t index)
3737 {
3738 return gimple_phi_arg (gs, index)->def;
3739 }
3740
3741
3742 /* Return a pointer to the tree operand for argument I of PHI node GS. */
3743
3744 static inline tree *
3745 gimple_phi_arg_def_ptr (gimple gs, size_t index)
3746 {
3747 return &gimple_phi_arg (gs, index)->def;
3748 }
3749
3750 /* Return the edge associated with argument I of phi node GS. */
3751
3752 static inline edge
3753 gimple_phi_arg_edge (gimple gs, size_t i)
3754 {
3755 return EDGE_PRED (gimple_bb (gs), i);
3756 }
3757
3758 /* Return the source location of gimple argument I of phi node GS. */
3759
3760 static inline source_location
3761 gimple_phi_arg_location (gimple gs, size_t i)
3762 {
3763 return gimple_phi_arg (gs, i)->locus;
3764 }
3765
3766 /* Return the source location of the argument on edge E of phi node GS. */
3767
3768 static inline source_location
3769 gimple_phi_arg_location_from_edge (gimple gs, edge e)
3770 {
3771 return gimple_phi_arg (gs, e->dest_idx)->locus;
3772 }
3773
3774 /* Set the source location of gimple argument I of phi node GS to LOC. */
3775
3776 static inline void
3777 gimple_phi_arg_set_location (gimple gs, size_t i, source_location loc)
3778 {
3779 gimple_phi_arg (gs, i)->locus = loc;
3780 }
3781
3782 /* Return TRUE if argument I of phi node GS has a location record. */
3783
3784 static inline bool
3785 gimple_phi_arg_has_location (gimple gs, size_t i)
3786 {
3787 return gimple_phi_arg_location (gs, i) != UNKNOWN_LOCATION;
3788 }
3789
3790
3791 /* Return the region number for GIMPLE_RESX GS. */
3792
3793 static inline int
3794 gimple_resx_region (const_gimple gs)
3795 {
3796 const gimple_statement_eh_ctrl *eh_ctrl_stmt =
3797 as_a <const gimple_statement_eh_ctrl> (gs);
3798 return eh_ctrl_stmt->region;
3799 }
3800
3801 /* Set REGION to be the region number for GIMPLE_RESX GS. */
3802
3803 static inline void
3804 gimple_resx_set_region (gimple gs, int region)
3805 {
3806 gimple_statement_eh_ctrl *eh_ctrl_stmt =
3807 as_a <gimple_statement_eh_ctrl> (gs);
3808 eh_ctrl_stmt->region = region;
3809 }
3810
3811 /* Return the region number for GIMPLE_EH_DISPATCH GS. */
3812
3813 static inline int
3814 gimple_eh_dispatch_region (const_gimple gs)
3815 {
3816 const gimple_statement_eh_ctrl *eh_ctrl_stmt =
3817 as_a <const gimple_statement_eh_ctrl> (gs);
3818 return eh_ctrl_stmt->region;
3819 }
3820
3821 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
3822
3823 static inline void
3824 gimple_eh_dispatch_set_region (gimple gs, int region)
3825 {
3826 gimple_statement_eh_ctrl *eh_ctrl_stmt =
3827 as_a <gimple_statement_eh_ctrl> (gs);
3828 eh_ctrl_stmt->region = region;
3829 }
3830
3831 /* Return the number of labels associated with the switch statement GS. */
3832
3833 static inline unsigned
3834 gimple_switch_num_labels (const_gimple gs)
3835 {
3836 unsigned num_ops;
3837 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3838 num_ops = gimple_num_ops (gs);
3839 gcc_gimple_checking_assert (num_ops > 1);
3840 return num_ops - 1;
3841 }
3842
3843
3844 /* Set NLABELS to be the number of labels for the switch statement GS. */
3845
3846 static inline void
3847 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3848 {
3849 GIMPLE_CHECK (g, GIMPLE_SWITCH);
3850 gimple_set_num_ops (g, nlabels + 1);
3851 }
3852
3853
3854 /* Return the index variable used by the switch statement GS. */
3855
3856 static inline tree
3857 gimple_switch_index (const_gimple gs)
3858 {
3859 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3860 return gimple_op (gs, 0);
3861 }
3862
3863
3864 /* Return a pointer to the index variable for the switch statement GS. */
3865
3866 static inline tree *
3867 gimple_switch_index_ptr (const_gimple gs)
3868 {
3869 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3870 return gimple_op_ptr (gs, 0);
3871 }
3872
3873
3874 /* Set INDEX to be the index variable for switch statement GS. */
3875
3876 static inline void
3877 gimple_switch_set_index (gimple gs, tree index)
3878 {
3879 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3880 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3881 gimple_set_op (gs, 0, index);
3882 }
3883
3884
3885 /* Return the label numbered INDEX. The default label is 0, followed by any
3886 labels in a switch statement. */
3887
3888 static inline tree
3889 gimple_switch_label (const_gimple gs, unsigned index)
3890 {
3891 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3892 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
3893 return gimple_op (gs, index + 1);
3894 }
3895
3896 /* Set the label number INDEX to LABEL. 0 is always the default label. */
3897
3898 static inline void
3899 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3900 {
3901 GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3902 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
3903 && (label == NULL_TREE
3904 || TREE_CODE (label) == CASE_LABEL_EXPR));
3905 gimple_set_op (gs, index + 1, label);
3906 }
3907
3908 /* Return the default label for a switch statement. */
3909
3910 static inline tree
3911 gimple_switch_default_label (const_gimple gs)
3912 {
3913 tree label = gimple_switch_label (gs, 0);
3914 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3915 return label;
3916 }
3917
3918 /* Set the default label for a switch statement. */
3919
3920 static inline void
3921 gimple_switch_set_default_label (gimple gs, tree label)
3922 {
3923 gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
3924 gimple_switch_set_label (gs, 0, label);
3925 }
3926
3927 /* Return true if GS is a GIMPLE_DEBUG statement. */
3928
3929 static inline bool
3930 is_gimple_debug (const_gimple gs)
3931 {
3932 return gimple_code (gs) == GIMPLE_DEBUG;
3933 }
3934
3935 /* Return true if S is a GIMPLE_DEBUG BIND statement. */
3936
3937 static inline bool
3938 gimple_debug_bind_p (const_gimple s)
3939 {
3940 if (is_gimple_debug (s))
3941 return s->subcode == GIMPLE_DEBUG_BIND;
3942
3943 return false;
3944 }
3945
3946 /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
3947
3948 static inline tree
3949 gimple_debug_bind_get_var (gimple dbg)
3950 {
3951 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3952 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3953 return gimple_op (dbg, 0);
3954 }
3955
3956 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3957 statement. */
3958
3959 static inline tree
3960 gimple_debug_bind_get_value (gimple dbg)
3961 {
3962 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3963 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3964 return gimple_op (dbg, 1);
3965 }
3966
3967 /* Return a pointer to the value bound to the variable in a
3968 GIMPLE_DEBUG bind statement. */
3969
3970 static inline tree *
3971 gimple_debug_bind_get_value_ptr (gimple dbg)
3972 {
3973 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3974 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3975 return gimple_op_ptr (dbg, 1);
3976 }
3977
3978 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
3979
3980 static inline void
3981 gimple_debug_bind_set_var (gimple dbg, tree var)
3982 {
3983 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3984 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3985 gimple_set_op (dbg, 0, var);
3986 }
3987
3988 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3989 statement. */
3990
3991 static inline void
3992 gimple_debug_bind_set_value (gimple dbg, tree value)
3993 {
3994 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3995 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
3996 gimple_set_op (dbg, 1, value);
3997 }
3998
3999 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
4000 optimized away. */
4001 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
4002
4003 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
4004 statement. */
4005
4006 static inline void
4007 gimple_debug_bind_reset_value (gimple dbg)
4008 {
4009 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4010 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4011 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
4012 }
4013
4014 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
4015 value. */
4016
4017 static inline bool
4018 gimple_debug_bind_has_value_p (gimple dbg)
4019 {
4020 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4021 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
4022 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
4023 }
4024
4025 #undef GIMPLE_DEBUG_BIND_NOVALUE
4026
4027 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
4028
4029 static inline bool
4030 gimple_debug_source_bind_p (const_gimple s)
4031 {
4032 if (is_gimple_debug (s))
4033 return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
4034
4035 return false;
4036 }
4037
4038 /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
4039
4040 static inline tree
4041 gimple_debug_source_bind_get_var (gimple dbg)
4042 {
4043 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4044 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4045 return gimple_op (dbg, 0);
4046 }
4047
4048 /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
4049 statement. */
4050
4051 static inline tree
4052 gimple_debug_source_bind_get_value (gimple dbg)
4053 {
4054 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4055 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4056 return gimple_op (dbg, 1);
4057 }
4058
4059 /* Return a pointer to the value bound to the variable in a
4060 GIMPLE_DEBUG source bind statement. */
4061
4062 static inline tree *
4063 gimple_debug_source_bind_get_value_ptr (gimple dbg)
4064 {
4065 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4066 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4067 return gimple_op_ptr (dbg, 1);
4068 }
4069
4070 /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
4071
4072 static inline void
4073 gimple_debug_source_bind_set_var (gimple dbg, tree var)
4074 {
4075 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4076 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4077 gimple_set_op (dbg, 0, var);
4078 }
4079
4080 /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
4081 statement. */
4082
4083 static inline void
4084 gimple_debug_source_bind_set_value (gimple dbg, tree value)
4085 {
4086 GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
4087 gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
4088 gimple_set_op (dbg, 1, value);
4089 }
4090
4091 /* Return the line number for EXPR, or return -1 if we have no line
4092 number information for it. */
4093 static inline int
4094 get_lineno (const_gimple stmt)
4095 {
4096 location_t loc;
4097
4098 if (!stmt)
4099 return -1;
4100
4101 loc = gimple_location (stmt);
4102 if (loc == UNKNOWN_LOCATION)
4103 return -1;
4104
4105 return LOCATION_LINE (loc);
4106 }
4107
4108 /* Return a pointer to the body for the OMP statement GS. */
4109
4110 static inline gimple_seq *
4111 gimple_omp_body_ptr (gimple gs)
4112 {
4113 return &static_cast <gimple_statement_omp *> (gs)->body;
4114 }
4115
4116 /* Return the body for the OMP statement GS. */
4117
4118 static inline gimple_seq
4119 gimple_omp_body (gimple gs)
4120 {
4121 return *gimple_omp_body_ptr (gs);
4122 }
4123
4124 /* Set BODY to be the body for the OMP statement GS. */
4125
4126 static inline void
4127 gimple_omp_set_body (gimple gs, gimple_seq body)
4128 {
4129 static_cast <gimple_statement_omp *> (gs)->body = body;
4130 }
4131
4132
4133 /* Return the name associated with OMP_CRITICAL statement GS. */
4134
4135 static inline tree
4136 gimple_omp_critical_name (const_gimple gs)
4137 {
4138 const gimple_statement_omp_critical *omp_critical_stmt =
4139 as_a <const gimple_statement_omp_critical> (gs);
4140 return omp_critical_stmt->name;
4141 }
4142
4143
4144 /* Return a pointer to the name associated with OMP critical statement GS. */
4145
4146 static inline tree *
4147 gimple_omp_critical_name_ptr (gimple gs)
4148 {
4149 gimple_statement_omp_critical *omp_critical_stmt =
4150 as_a <gimple_statement_omp_critical> (gs);
4151 return &omp_critical_stmt->name;
4152 }
4153
4154
4155 /* Set NAME to be the name associated with OMP critical statement GS. */
4156
4157 static inline void
4158 gimple_omp_critical_set_name (gimple gs, tree name)
4159 {
4160 gimple_statement_omp_critical *omp_critical_stmt =
4161 as_a <gimple_statement_omp_critical> (gs);
4162 omp_critical_stmt->name = name;
4163 }
4164
4165
4166 /* Return the kind of OMP for statemement. */
4167
4168 static inline int
4169 gimple_omp_for_kind (const_gimple g)
4170 {
4171 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4172 return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
4173 }
4174
4175
4176 /* Set the OMP for kind. */
4177
4178 static inline void
4179 gimple_omp_for_set_kind (gimple g, int kind)
4180 {
4181 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4182 g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
4183 | (kind & GF_OMP_FOR_KIND_MASK);
4184 }
4185
4186
4187 /* Return true if OMP for statement G has the
4188 GF_OMP_FOR_COMBINED flag set. */
4189
4190 static inline bool
4191 gimple_omp_for_combined_p (const_gimple g)
4192 {
4193 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4194 return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
4195 }
4196
4197
4198 /* Set the GF_OMP_FOR_COMBINED field in G depending on the boolean
4199 value of COMBINED_P. */
4200
4201 static inline void
4202 gimple_omp_for_set_combined_p (gimple g, bool combined_p)
4203 {
4204 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4205 if (combined_p)
4206 g->subcode |= GF_OMP_FOR_COMBINED;
4207 else
4208 g->subcode &= ~GF_OMP_FOR_COMBINED;
4209 }
4210
4211
4212 /* Return true if OMP for statement G has the
4213 GF_OMP_FOR_COMBINED_INTO flag set. */
4214
4215 static inline bool
4216 gimple_omp_for_combined_into_p (const_gimple g)
4217 {
4218 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4219 return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
4220 }
4221
4222
4223 /* Set the GF_OMP_FOR_COMBINED_INTO field in G depending on the boolean
4224 value of COMBINED_P. */
4225
4226 static inline void
4227 gimple_omp_for_set_combined_into_p (gimple g, bool combined_p)
4228 {
4229 GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
4230 if (combined_p)
4231 g->subcode |= GF_OMP_FOR_COMBINED_INTO;
4232 else
4233 g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
4234 }
4235
4236
4237 /* Return the clauses associated with OMP_FOR GS. */
4238
4239 static inline tree
4240 gimple_omp_for_clauses (const_gimple gs)
4241 {
4242 const gimple_statement_omp_for *omp_for_stmt =
4243 as_a <const gimple_statement_omp_for> (gs);
4244 return omp_for_stmt->clauses;
4245 }
4246
4247
4248 /* Return a pointer to the OMP_FOR GS. */
4249
4250 static inline tree *
4251 gimple_omp_for_clauses_ptr (gimple gs)
4252 {
4253 gimple_statement_omp_for *omp_for_stmt =
4254 as_a <gimple_statement_omp_for> (gs);
4255 return &omp_for_stmt->clauses;
4256 }
4257
4258
4259 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS. */
4260
4261 static inline void
4262 gimple_omp_for_set_clauses (gimple gs, tree clauses)
4263 {
4264 gimple_statement_omp_for *omp_for_stmt =
4265 as_a <gimple_statement_omp_for> (gs);
4266 omp_for_stmt->clauses = clauses;
4267 }
4268
4269
4270 /* Get the collapse count of OMP_FOR GS. */
4271
4272 static inline size_t
4273 gimple_omp_for_collapse (gimple gs)
4274 {
4275 gimple_statement_omp_for *omp_for_stmt =
4276 as_a <gimple_statement_omp_for> (gs);
4277 return omp_for_stmt->collapse;
4278 }
4279
4280
4281 /* Return the index variable for OMP_FOR GS. */
4282
4283 static inline tree
4284 gimple_omp_for_index (const_gimple gs, size_t i)
4285 {
4286 const gimple_statement_omp_for *omp_for_stmt =
4287 as_a <const gimple_statement_omp_for> (gs);
4288 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4289 return omp_for_stmt->iter[i].index;
4290 }
4291
4292
4293 /* Return a pointer to the index variable for OMP_FOR GS. */
4294
4295 static inline tree *
4296 gimple_omp_for_index_ptr (gimple gs, size_t i)
4297 {
4298 gimple_statement_omp_for *omp_for_stmt =
4299 as_a <gimple_statement_omp_for> (gs);
4300 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4301 return &omp_for_stmt->iter[i].index;
4302 }
4303
4304
4305 /* Set INDEX to be the index variable for OMP_FOR GS. */
4306
4307 static inline void
4308 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
4309 {
4310 gimple_statement_omp_for *omp_for_stmt =
4311 as_a <gimple_statement_omp_for> (gs);
4312 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4313 omp_for_stmt->iter[i].index = index;
4314 }
4315
4316
4317 /* Return the initial value for OMP_FOR GS. */
4318
4319 static inline tree
4320 gimple_omp_for_initial (const_gimple gs, size_t i)
4321 {
4322 const gimple_statement_omp_for *omp_for_stmt =
4323 as_a <const gimple_statement_omp_for> (gs);
4324 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4325 return omp_for_stmt->iter[i].initial;
4326 }
4327
4328
4329 /* Return a pointer to the initial value for OMP_FOR GS. */
4330
4331 static inline tree *
4332 gimple_omp_for_initial_ptr (gimple gs, size_t i)
4333 {
4334 gimple_statement_omp_for *omp_for_stmt =
4335 as_a <gimple_statement_omp_for> (gs);
4336 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4337 return &omp_for_stmt->iter[i].initial;
4338 }
4339
4340
4341 /* Set INITIAL to be the initial value for OMP_FOR GS. */
4342
4343 static inline void
4344 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
4345 {
4346 gimple_statement_omp_for *omp_for_stmt =
4347 as_a <gimple_statement_omp_for> (gs);
4348 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4349 omp_for_stmt->iter[i].initial = initial;
4350 }
4351
4352
4353 /* Return the final value for OMP_FOR GS. */
4354
4355 static inline tree
4356 gimple_omp_for_final (const_gimple gs, size_t i)
4357 {
4358 const gimple_statement_omp_for *omp_for_stmt =
4359 as_a <const gimple_statement_omp_for> (gs);
4360 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4361 return omp_for_stmt->iter[i].final;
4362 }
4363
4364
4365 /* Return a pointer to the final value for OMP_FOR GS. */
4366
4367 static inline tree *
4368 gimple_omp_for_final_ptr (gimple gs, size_t i)
4369 {
4370 gimple_statement_omp_for *omp_for_stmt =
4371 as_a <gimple_statement_omp_for> (gs);
4372 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4373 return &omp_for_stmt->iter[i].final;
4374 }
4375
4376
4377 /* Set FINAL to be the final value for OMP_FOR GS. */
4378
4379 static inline void
4380 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
4381 {
4382 gimple_statement_omp_for *omp_for_stmt =
4383 as_a <gimple_statement_omp_for> (gs);
4384 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4385 omp_for_stmt->iter[i].final = final;
4386 }
4387
4388
4389 /* Return the increment value for OMP_FOR GS. */
4390
4391 static inline tree
4392 gimple_omp_for_incr (const_gimple gs, size_t i)
4393 {
4394 const gimple_statement_omp_for *omp_for_stmt =
4395 as_a <const gimple_statement_omp_for> (gs);
4396 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4397 return omp_for_stmt->iter[i].incr;
4398 }
4399
4400
4401 /* Return a pointer to the increment value for OMP_FOR GS. */
4402
4403 static inline tree *
4404 gimple_omp_for_incr_ptr (gimple gs, size_t i)
4405 {
4406 gimple_statement_omp_for *omp_for_stmt =
4407 as_a <gimple_statement_omp_for> (gs);
4408 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4409 return &omp_for_stmt->iter[i].incr;
4410 }
4411
4412
4413 /* Set INCR to be the increment value for OMP_FOR GS. */
4414
4415 static inline void
4416 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
4417 {
4418 gimple_statement_omp_for *omp_for_stmt =
4419 as_a <gimple_statement_omp_for> (gs);
4420 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
4421 omp_for_stmt->iter[i].incr = incr;
4422 }
4423
4424
4425 /* Return a pointer to the sequence of statements to execute before the OMP_FOR
4426 statement GS starts. */
4427
4428 static inline gimple_seq *
4429 gimple_omp_for_pre_body_ptr (gimple gs)
4430 {
4431 gimple_statement_omp_for *omp_for_stmt =
4432 as_a <gimple_statement_omp_for> (gs);
4433 return &omp_for_stmt->pre_body;
4434 }
4435
4436
4437 /* Return the sequence of statements to execute before the OMP_FOR
4438 statement GS starts. */
4439
4440 static inline gimple_seq
4441 gimple_omp_for_pre_body (gimple gs)
4442 {
4443 return *gimple_omp_for_pre_body_ptr (gs);
4444 }
4445
4446
4447 /* Set PRE_BODY to be the sequence of statements to execute before the
4448 OMP_FOR statement GS starts. */
4449
4450 static inline void
4451 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
4452 {
4453 gimple_statement_omp_for *omp_for_stmt =
4454 as_a <gimple_statement_omp_for> (gs);
4455 omp_for_stmt->pre_body = pre_body;
4456 }
4457
4458
4459 /* Return the clauses associated with OMP_PARALLEL GS. */
4460
4461 static inline tree
4462 gimple_omp_parallel_clauses (const_gimple gs)
4463 {
4464 const gimple_statement_omp_parallel *omp_parallel_stmt =
4465 as_a <const gimple_statement_omp_parallel> (gs);
4466 return omp_parallel_stmt->clauses;
4467 }
4468
4469
4470 /* Return a pointer to the clauses associated with OMP_PARALLEL GS. */
4471
4472 static inline tree *
4473 gimple_omp_parallel_clauses_ptr (gimple gs)
4474 {
4475 gimple_statement_omp_parallel *omp_parallel_stmt =
4476 as_a <gimple_statement_omp_parallel> (gs);
4477 return &omp_parallel_stmt->clauses;
4478 }
4479
4480
4481 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
4482 GS. */
4483
4484 static inline void
4485 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
4486 {
4487 gimple_statement_omp_parallel *omp_parallel_stmt =
4488 as_a <gimple_statement_omp_parallel> (gs);
4489 omp_parallel_stmt->clauses = clauses;
4490 }
4491
4492
4493 /* Return the child function used to hold the body of OMP_PARALLEL GS. */
4494
4495 static inline tree
4496 gimple_omp_parallel_child_fn (const_gimple gs)
4497 {
4498 const gimple_statement_omp_parallel *omp_parallel_stmt =
4499 as_a <const gimple_statement_omp_parallel> (gs);
4500 return omp_parallel_stmt->child_fn;
4501 }
4502
4503 /* Return a pointer to the child function used to hold the body of
4504 OMP_PARALLEL GS. */
4505
4506 static inline tree *
4507 gimple_omp_parallel_child_fn_ptr (gimple gs)
4508 {
4509 gimple_statement_omp_parallel *omp_parallel_stmt =
4510 as_a <gimple_statement_omp_parallel> (gs);
4511 return &omp_parallel_stmt->child_fn;
4512 }
4513
4514
4515 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS. */
4516
4517 static inline void
4518 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
4519 {
4520 gimple_statement_omp_parallel *omp_parallel_stmt =
4521 as_a <gimple_statement_omp_parallel> (gs);
4522 omp_parallel_stmt->child_fn = child_fn;
4523 }
4524
4525
4526 /* Return the artificial argument used to send variables and values
4527 from the parent to the children threads in OMP_PARALLEL GS. */
4528
4529 static inline tree
4530 gimple_omp_parallel_data_arg (const_gimple gs)
4531 {
4532 const gimple_statement_omp_parallel *omp_parallel_stmt =
4533 as_a <const gimple_statement_omp_parallel> (gs);
4534 return omp_parallel_stmt->data_arg;
4535 }
4536
4537
4538 /* Return a pointer to the data argument for OMP_PARALLEL GS. */
4539
4540 static inline tree *
4541 gimple_omp_parallel_data_arg_ptr (gimple gs)
4542 {
4543 gimple_statement_omp_parallel *omp_parallel_stmt =
4544 as_a <gimple_statement_omp_parallel> (gs);
4545 return &omp_parallel_stmt->data_arg;
4546 }
4547
4548
4549 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS. */
4550
4551 static inline void
4552 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
4553 {
4554 gimple_statement_omp_parallel *omp_parallel_stmt =
4555 as_a <gimple_statement_omp_parallel> (gs);
4556 omp_parallel_stmt->data_arg = data_arg;
4557 }
4558
4559
4560 /* Return the clauses associated with OMP_TASK GS. */
4561
4562 static inline tree
4563 gimple_omp_task_clauses (const_gimple gs)
4564 {
4565 const gimple_statement_omp_task *omp_task_stmt =
4566 as_a <const gimple_statement_omp_task> (gs);
4567 return omp_task_stmt->clauses;
4568 }
4569
4570
4571 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4572
4573 static inline tree *
4574 gimple_omp_task_clauses_ptr (gimple gs)
4575 {
4576 gimple_statement_omp_task *omp_task_stmt =
4577 as_a <gimple_statement_omp_task> (gs);
4578 return &omp_task_stmt->clauses;
4579 }
4580
4581
4582 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4583 GS. */
4584
4585 static inline void
4586 gimple_omp_task_set_clauses (gimple gs, tree clauses)
4587 {
4588 gimple_statement_omp_task *omp_task_stmt =
4589 as_a <gimple_statement_omp_task> (gs);
4590 omp_task_stmt->clauses = clauses;
4591 }
4592
4593
4594 /* Return the child function used to hold the body of OMP_TASK GS. */
4595
4596 static inline tree
4597 gimple_omp_task_child_fn (const_gimple gs)
4598 {
4599 const gimple_statement_omp_task *omp_task_stmt =
4600 as_a <const gimple_statement_omp_task> (gs);
4601 return omp_task_stmt->child_fn;
4602 }
4603
4604 /* Return a pointer to the child function used to hold the body of
4605 OMP_TASK GS. */
4606
4607 static inline tree *
4608 gimple_omp_task_child_fn_ptr (gimple gs)
4609 {
4610 gimple_statement_omp_task *omp_task_stmt =
4611 as_a <gimple_statement_omp_task> (gs);
4612 return &omp_task_stmt->child_fn;
4613 }
4614
4615
4616 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4617
4618 static inline void
4619 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
4620 {
4621 gimple_statement_omp_task *omp_task_stmt =
4622 as_a <gimple_statement_omp_task> (gs);
4623 omp_task_stmt->child_fn = child_fn;
4624 }
4625
4626
4627 /* Return the artificial argument used to send variables and values
4628 from the parent to the children threads in OMP_TASK GS. */
4629
4630 static inline tree
4631 gimple_omp_task_data_arg (const_gimple gs)
4632 {
4633 const gimple_statement_omp_task *omp_task_stmt =
4634 as_a <const gimple_statement_omp_task> (gs);
4635 return omp_task_stmt->data_arg;
4636 }
4637
4638
4639 /* Return a pointer to the data argument for OMP_TASK GS. */
4640
4641 static inline tree *
4642 gimple_omp_task_data_arg_ptr (gimple gs)
4643 {
4644 gimple_statement_omp_task *omp_task_stmt =
4645 as_a <gimple_statement_omp_task> (gs);
4646 return &omp_task_stmt->data_arg;
4647 }
4648
4649
4650 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4651
4652 static inline void
4653 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
4654 {
4655 gimple_statement_omp_task *omp_task_stmt =
4656 as_a <gimple_statement_omp_task> (gs);
4657 omp_task_stmt->data_arg = data_arg;
4658 }
4659
4660
4661 /* Return the clauses associated with OMP_TASK GS. */
4662
4663 static inline tree
4664 gimple_omp_taskreg_clauses (const_gimple gs)
4665 {
4666 const gimple_statement_omp_parallel *omp_parallel_stmt =
4667 as_a <const gimple_statement_omp_parallel> (gs);
4668 return omp_parallel_stmt->clauses;
4669 }
4670
4671
4672 /* Return a pointer to the clauses associated with OMP_TASK GS. */
4673
4674 static inline tree *
4675 gimple_omp_taskreg_clauses_ptr (gimple gs)
4676 {
4677 gimple_statement_omp_parallel *omp_parallel_stmt =
4678 as_a <gimple_statement_omp_parallel> (gs);
4679 return &omp_parallel_stmt->clauses;
4680 }
4681
4682
4683 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
4684 GS. */
4685
4686 static inline void
4687 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
4688 {
4689 gimple_statement_omp_parallel *omp_parallel_stmt =
4690 as_a <gimple_statement_omp_parallel> (gs);
4691 omp_parallel_stmt->clauses = clauses;
4692 }
4693
4694
4695 /* Return the child function used to hold the body of OMP_TASK GS. */
4696
4697 static inline tree
4698 gimple_omp_taskreg_child_fn (const_gimple gs)
4699 {
4700 const gimple_statement_omp_parallel *omp_parallel_stmt =
4701 as_a <const gimple_statement_omp_parallel> (gs);
4702 return omp_parallel_stmt->child_fn;
4703 }
4704
4705 /* Return a pointer to the child function used to hold the body of
4706 OMP_TASK GS. */
4707
4708 static inline tree *
4709 gimple_omp_taskreg_child_fn_ptr (gimple gs)
4710 {
4711 gimple_statement_omp_parallel *omp_parallel_stmt =
4712 as_a <gimple_statement_omp_parallel> (gs);
4713 return &omp_parallel_stmt->child_fn;
4714 }
4715
4716
4717 /* Set CHILD_FN to be the child function for OMP_TASK GS. */
4718
4719 static inline void
4720 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
4721 {
4722 gimple_statement_omp_parallel *omp_parallel_stmt =
4723 as_a <gimple_statement_omp_parallel> (gs);
4724 omp_parallel_stmt->child_fn = child_fn;
4725 }
4726
4727
4728 /* Return the artificial argument used to send variables and values
4729 from the parent to the children threads in OMP_TASK GS. */
4730
4731 static inline tree
4732 gimple_omp_taskreg_data_arg (const_gimple gs)
4733 {
4734 const gimple_statement_omp_parallel *omp_parallel_stmt =
4735 as_a <const gimple_statement_omp_parallel> (gs);
4736 return omp_parallel_stmt->data_arg;
4737 }
4738
4739
4740 /* Return a pointer to the data argument for OMP_TASK GS. */
4741
4742 static inline tree *
4743 gimple_omp_taskreg_data_arg_ptr (gimple gs)
4744 {
4745 gimple_statement_omp_parallel *omp_parallel_stmt =
4746 as_a <gimple_statement_omp_parallel> (gs);
4747 return &omp_parallel_stmt->data_arg;
4748 }
4749
4750
4751 /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
4752
4753 static inline void
4754 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
4755 {
4756 gimple_statement_omp_parallel *omp_parallel_stmt =
4757 as_a <gimple_statement_omp_parallel> (gs);
4758 omp_parallel_stmt->data_arg = data_arg;
4759 }
4760
4761
4762 /* Return the copy function used to hold the body of OMP_TASK GS. */
4763
4764 static inline tree
4765 gimple_omp_task_copy_fn (const_gimple gs)
4766 {
4767 const gimple_statement_omp_task *omp_task_stmt =
4768 as_a <const gimple_statement_omp_task> (gs);
4769 return omp_task_stmt->copy_fn;
4770 }
4771
4772 /* Return a pointer to the copy function used to hold the body of
4773 OMP_TASK GS. */
4774
4775 static inline tree *
4776 gimple_omp_task_copy_fn_ptr (gimple gs)
4777 {
4778 gimple_statement_omp_task *omp_task_stmt =
4779 as_a <gimple_statement_omp_task> (gs);
4780 return &omp_task_stmt->copy_fn;
4781 }
4782
4783
4784 /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
4785
4786 static inline void
4787 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
4788 {
4789 gimple_statement_omp_task *omp_task_stmt =
4790 as_a <gimple_statement_omp_task> (gs);
4791 omp_task_stmt->copy_fn = copy_fn;
4792 }
4793
4794
4795 /* Return size of the data block in bytes in OMP_TASK GS. */
4796
4797 static inline tree
4798 gimple_omp_task_arg_size (const_gimple gs)
4799 {
4800 const gimple_statement_omp_task *omp_task_stmt =
4801 as_a <const gimple_statement_omp_task> (gs);
4802 return omp_task_stmt->arg_size;
4803 }
4804
4805
4806 /* Return a pointer to the data block size for OMP_TASK GS. */
4807
4808 static inline tree *
4809 gimple_omp_task_arg_size_ptr (gimple gs)
4810 {
4811 gimple_statement_omp_task *omp_task_stmt =
4812 as_a <gimple_statement_omp_task> (gs);
4813 return &omp_task_stmt->arg_size;
4814 }
4815
4816
4817 /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
4818
4819 static inline void
4820 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
4821 {
4822 gimple_statement_omp_task *omp_task_stmt =
4823 as_a <gimple_statement_omp_task> (gs);
4824 omp_task_stmt->arg_size = arg_size;
4825 }
4826
4827
4828 /* Return align of the data block in bytes in OMP_TASK GS. */
4829
4830 static inline tree
4831 gimple_omp_task_arg_align (const_gimple gs)
4832 {
4833 const gimple_statement_omp_task *omp_task_stmt =
4834 as_a <const gimple_statement_omp_task> (gs);
4835 return omp_task_stmt->arg_align;
4836 }
4837
4838
4839 /* Return a pointer to the data block align for OMP_TASK GS. */
4840
4841 static inline tree *
4842 gimple_omp_task_arg_align_ptr (gimple gs)
4843 {
4844 gimple_statement_omp_task *omp_task_stmt =
4845 as_a <gimple_statement_omp_task> (gs);
4846 return &omp_task_stmt->arg_align;
4847 }
4848
4849
4850 /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
4851
4852 static inline void
4853 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4854 {
4855 gimple_statement_omp_task *omp_task_stmt =
4856 as_a <gimple_statement_omp_task> (gs);
4857 omp_task_stmt->arg_align = arg_align;
4858 }
4859
4860
4861 /* Return the clauses associated with OMP_SINGLE GS. */
4862
4863 static inline tree
4864 gimple_omp_single_clauses (const_gimple gs)
4865 {
4866 const gimple_statement_omp_single *omp_single_stmt =
4867 as_a <const gimple_statement_omp_single> (gs);
4868 return omp_single_stmt->clauses;
4869 }
4870
4871
4872 /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
4873
4874 static inline tree *
4875 gimple_omp_single_clauses_ptr (gimple gs)
4876 {
4877 gimple_statement_omp_single *omp_single_stmt =
4878 as_a <gimple_statement_omp_single> (gs);
4879 return &omp_single_stmt->clauses;
4880 }
4881
4882
4883 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
4884
4885 static inline void
4886 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4887 {
4888 gimple_statement_omp_single *omp_single_stmt =
4889 as_a <gimple_statement_omp_single> (gs);
4890 omp_single_stmt->clauses = clauses;
4891 }
4892
4893
4894 /* Return the clauses associated with OMP_TARGET GS. */
4895
4896 static inline tree
4897 gimple_omp_target_clauses (const_gimple gs)
4898 {
4899 const gimple_statement_omp_parallel *omp_parallel_stmt =
4900 as_a <const gimple_statement_omp_parallel> (gs);
4901 return omp_parallel_stmt->clauses;
4902 }
4903
4904
4905 /* Return a pointer to the clauses associated with OMP_TARGET GS. */
4906
4907 static inline tree *
4908 gimple_omp_target_clauses_ptr (gimple gs)
4909 {
4910 gimple_statement_omp_parallel *omp_parallel_stmt =
4911 as_a <gimple_statement_omp_parallel> (gs);
4912 return &omp_parallel_stmt->clauses;
4913 }
4914
4915
4916 /* Set CLAUSES to be the clauses associated with OMP_TARGET GS. */
4917
4918 static inline void
4919 gimple_omp_target_set_clauses (gimple gs, tree clauses)
4920 {
4921 gimple_statement_omp_parallel *omp_parallel_stmt =
4922 as_a <gimple_statement_omp_parallel> (gs);
4923 omp_parallel_stmt->clauses = clauses;
4924 }
4925
4926
4927 /* Return the kind of OMP target statemement. */
4928
4929 static inline int
4930 gimple_omp_target_kind (const_gimple g)
4931 {
4932 GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
4933 return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
4934 }
4935
4936
4937 /* Set the OMP target kind. */
4938
4939 static inline void
4940 gimple_omp_target_set_kind (gimple g, int kind)
4941 {
4942 GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
4943 g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
4944 | (kind & GF_OMP_TARGET_KIND_MASK);
4945 }
4946
4947
4948 /* Return the child function used to hold the body of OMP_TARGET GS. */
4949
4950 static inline tree
4951 gimple_omp_target_child_fn (const_gimple gs)
4952 {
4953 const gimple_statement_omp_parallel *omp_parallel_stmt =
4954 as_a <const gimple_statement_omp_parallel> (gs);
4955 return omp_parallel_stmt->child_fn;
4956 }
4957
4958 /* Return a pointer to the child function used to hold the body of
4959 OMP_TARGET GS. */
4960
4961 static inline tree *
4962 gimple_omp_target_child_fn_ptr (gimple gs)
4963 {
4964 gimple_statement_omp_parallel *omp_parallel_stmt =
4965 as_a <gimple_statement_omp_parallel> (gs);
4966 return &omp_parallel_stmt->child_fn;
4967 }
4968
4969
4970 /* Set CHILD_FN to be the child function for OMP_TARGET GS. */
4971
4972 static inline void
4973 gimple_omp_target_set_child_fn (gimple gs, tree child_fn)
4974 {
4975 gimple_statement_omp_parallel *omp_parallel_stmt =
4976 as_a <gimple_statement_omp_parallel> (gs);
4977 omp_parallel_stmt->child_fn = child_fn;
4978 }
4979
4980
4981 /* Return the artificial argument used to send variables and values
4982 from the parent to the children threads in OMP_TARGET GS. */
4983
4984 static inline tree
4985 gimple_omp_target_data_arg (const_gimple gs)
4986 {
4987 const gimple_statement_omp_parallel *omp_parallel_stmt =
4988 as_a <const gimple_statement_omp_parallel> (gs);
4989 return omp_parallel_stmt->data_arg;
4990 }
4991
4992
4993 /* Return a pointer to the data argument for OMP_TARGET GS. */
4994
4995 static inline tree *
4996 gimple_omp_target_data_arg_ptr (gimple gs)
4997 {
4998 gimple_statement_omp_parallel *omp_parallel_stmt =
4999 as_a <gimple_statement_omp_parallel> (gs);
5000 return &omp_parallel_stmt->data_arg;
5001 }
5002
5003
5004 /* Set DATA_ARG to be the data argument for OMP_TARGET GS. */
5005
5006 static inline void
5007 gimple_omp_target_set_data_arg (gimple gs, tree data_arg)
5008 {
5009 gimple_statement_omp_parallel *omp_parallel_stmt =
5010 as_a <gimple_statement_omp_parallel> (gs);
5011 omp_parallel_stmt->data_arg = data_arg;
5012 }
5013
5014
5015 /* Return the clauses associated with OMP_TEAMS GS. */
5016
5017 static inline tree
5018 gimple_omp_teams_clauses (const_gimple gs)
5019 {
5020 const gimple_statement_omp_single *omp_single_stmt =
5021 as_a <const gimple_statement_omp_single> (gs);
5022 return omp_single_stmt->clauses;
5023 }
5024
5025
5026 /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
5027
5028 static inline tree *
5029 gimple_omp_teams_clauses_ptr (gimple gs)
5030 {
5031 gimple_statement_omp_single *omp_single_stmt =
5032 as_a <gimple_statement_omp_single> (gs);
5033 return &omp_single_stmt->clauses;
5034 }
5035
5036
5037 /* Set CLAUSES to be the clauses associated with OMP_TEAMS GS. */
5038
5039 static inline void
5040 gimple_omp_teams_set_clauses (gimple gs, tree clauses)
5041 {
5042 gimple_statement_omp_single *omp_single_stmt =
5043 as_a <gimple_statement_omp_single> (gs);
5044 omp_single_stmt->clauses = clauses;
5045 }
5046
5047
5048 /* Return the clauses associated with OMP_SECTIONS GS. */
5049
5050 static inline tree
5051 gimple_omp_sections_clauses (const_gimple gs)
5052 {
5053 const gimple_statement_omp_sections *omp_sections_stmt =
5054 as_a <const gimple_statement_omp_sections> (gs);
5055 return omp_sections_stmt->clauses;
5056 }
5057
5058
5059 /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
5060
5061 static inline tree *
5062 gimple_omp_sections_clauses_ptr (gimple gs)
5063 {
5064 gimple_statement_omp_sections *omp_sections_stmt =
5065 as_a <gimple_statement_omp_sections> (gs);
5066 return &omp_sections_stmt->clauses;
5067 }
5068
5069
5070 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
5071 GS. */
5072
5073 static inline void
5074 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
5075 {
5076 gimple_statement_omp_sections *omp_sections_stmt =
5077 as_a <gimple_statement_omp_sections> (gs);
5078 omp_sections_stmt->clauses = clauses;
5079 }
5080
5081
5082 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
5083 in GS. */
5084
5085 static inline tree
5086 gimple_omp_sections_control (const_gimple gs)
5087 {
5088 const gimple_statement_omp_sections *omp_sections_stmt =
5089 as_a <const gimple_statement_omp_sections> (gs);
5090 return omp_sections_stmt->control;
5091 }
5092
5093
5094 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
5095 GS. */
5096
5097 static inline tree *
5098 gimple_omp_sections_control_ptr (gimple gs)
5099 {
5100 gimple_statement_omp_sections *omp_sections_stmt =
5101 as_a <gimple_statement_omp_sections> (gs);
5102 return &omp_sections_stmt->control;
5103 }
5104
5105
5106 /* Set CONTROL to be the set of clauses associated with the
5107 GIMPLE_OMP_SECTIONS in GS. */
5108
5109 static inline void
5110 gimple_omp_sections_set_control (gimple gs, tree control)
5111 {
5112 gimple_statement_omp_sections *omp_sections_stmt =
5113 as_a <gimple_statement_omp_sections> (gs);
5114 omp_sections_stmt->control = control;
5115 }
5116
5117
5118 /* Set COND to be the condition code for OMP_FOR GS. */
5119
5120 static inline void
5121 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
5122 {
5123 gimple_statement_omp_for *omp_for_stmt =
5124 as_a <gimple_statement_omp_for> (gs);
5125 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
5126 && i < omp_for_stmt->collapse);
5127 omp_for_stmt->iter[i].cond = cond;
5128 }
5129
5130
5131 /* Return the condition code associated with OMP_FOR GS. */
5132
5133 static inline enum tree_code
5134 gimple_omp_for_cond (const_gimple gs, size_t i)
5135 {
5136 const gimple_statement_omp_for *omp_for_stmt =
5137 as_a <const gimple_statement_omp_for> (gs);
5138 gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
5139 return omp_for_stmt->iter[i].cond;
5140 }
5141
5142
5143 /* Set the value being stored in an atomic store. */
5144
5145 static inline void
5146 gimple_omp_atomic_store_set_val (gimple g, tree val)
5147 {
5148 gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
5149 as_a <gimple_statement_omp_atomic_store> (g);
5150 omp_atomic_store_stmt->val = val;
5151 }
5152
5153
5154 /* Return the value being stored in an atomic store. */
5155
5156 static inline tree
5157 gimple_omp_atomic_store_val (const_gimple g)
5158 {
5159 const gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
5160 as_a <const gimple_statement_omp_atomic_store> (g);
5161 return omp_atomic_store_stmt->val;
5162 }
5163
5164
5165 /* Return a pointer to the value being stored in an atomic store. */
5166
5167 static inline tree *
5168 gimple_omp_atomic_store_val_ptr (gimple g)
5169 {
5170 gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
5171 as_a <gimple_statement_omp_atomic_store> (g);
5172 return &omp_atomic_store_stmt->val;
5173 }
5174
5175
5176 /* Set the LHS of an atomic load. */
5177
5178 static inline void
5179 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
5180 {
5181 gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5182 as_a <gimple_statement_omp_atomic_load> (g);
5183 omp_atomic_load_stmt->lhs = lhs;
5184 }
5185
5186
5187 /* Get the LHS of an atomic load. */
5188
5189 static inline tree
5190 gimple_omp_atomic_load_lhs (const_gimple g)
5191 {
5192 const gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5193 as_a <const gimple_statement_omp_atomic_load> (g);
5194 return omp_atomic_load_stmt->lhs;
5195 }
5196
5197
5198 /* Return a pointer to the LHS of an atomic load. */
5199
5200 static inline tree *
5201 gimple_omp_atomic_load_lhs_ptr (gimple g)
5202 {
5203 gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5204 as_a <gimple_statement_omp_atomic_load> (g);
5205 return &omp_atomic_load_stmt->lhs;
5206 }
5207
5208
5209 /* Set the RHS of an atomic load. */
5210
5211 static inline void
5212 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
5213 {
5214 gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5215 as_a <gimple_statement_omp_atomic_load> (g);
5216 omp_atomic_load_stmt->rhs = rhs;
5217 }
5218
5219
5220 /* Get the RHS of an atomic load. */
5221
5222 static inline tree
5223 gimple_omp_atomic_load_rhs (const_gimple g)
5224 {
5225 const gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5226 as_a <const gimple_statement_omp_atomic_load> (g);
5227 return omp_atomic_load_stmt->rhs;
5228 }
5229
5230
5231 /* Return a pointer to the RHS of an atomic load. */
5232
5233 static inline tree *
5234 gimple_omp_atomic_load_rhs_ptr (gimple g)
5235 {
5236 gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
5237 as_a <gimple_statement_omp_atomic_load> (g);
5238 return &omp_atomic_load_stmt->rhs;
5239 }
5240
5241
5242 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5243
5244 static inline tree
5245 gimple_omp_continue_control_def (const_gimple g)
5246 {
5247 const gimple_statement_omp_continue *omp_continue_stmt =
5248 as_a <const gimple_statement_omp_continue> (g);
5249 return omp_continue_stmt->control_def;
5250 }
5251
5252 /* The same as above, but return the address. */
5253
5254 static inline tree *
5255 gimple_omp_continue_control_def_ptr (gimple g)
5256 {
5257 gimple_statement_omp_continue *omp_continue_stmt =
5258 as_a <gimple_statement_omp_continue> (g);
5259 return &omp_continue_stmt->control_def;
5260 }
5261
5262 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
5263
5264 static inline void
5265 gimple_omp_continue_set_control_def (gimple g, tree def)
5266 {
5267 gimple_statement_omp_continue *omp_continue_stmt =
5268 as_a <gimple_statement_omp_continue> (g);
5269 omp_continue_stmt->control_def = def;
5270 }
5271
5272
5273 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5274
5275 static inline tree
5276 gimple_omp_continue_control_use (const_gimple g)
5277 {
5278 const gimple_statement_omp_continue *omp_continue_stmt =
5279 as_a <const gimple_statement_omp_continue> (g);
5280 return omp_continue_stmt->control_use;
5281 }
5282
5283
5284 /* The same as above, but return the address. */
5285
5286 static inline tree *
5287 gimple_omp_continue_control_use_ptr (gimple g)
5288 {
5289 gimple_statement_omp_continue *omp_continue_stmt =
5290 as_a <gimple_statement_omp_continue> (g);
5291 return &omp_continue_stmt->control_use;
5292 }
5293
5294
5295 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
5296
5297 static inline void
5298 gimple_omp_continue_set_control_use (gimple g, tree use)
5299 {
5300 gimple_statement_omp_continue *omp_continue_stmt =
5301 as_a <gimple_statement_omp_continue> (g);
5302 omp_continue_stmt->control_use = use;
5303 }
5304
5305 /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
5306
5307 static inline gimple_seq *
5308 gimple_transaction_body_ptr (gimple gs)
5309 {
5310 gimple_statement_transaction *transaction_stmt =
5311 as_a <gimple_statement_transaction> (gs);
5312 return &transaction_stmt->body;
5313 }
5314
5315 /* Return the body for the GIMPLE_TRANSACTION statement GS. */
5316
5317 static inline gimple_seq
5318 gimple_transaction_body (gimple gs)
5319 {
5320 return *gimple_transaction_body_ptr (gs);
5321 }
5322
5323 /* Return the label associated with a GIMPLE_TRANSACTION. */
5324
5325 static inline tree
5326 gimple_transaction_label (const_gimple gs)
5327 {
5328 const gimple_statement_transaction *transaction_stmt =
5329 as_a <const gimple_statement_transaction> (gs);
5330 return transaction_stmt->label;
5331 }
5332
5333 static inline tree *
5334 gimple_transaction_label_ptr (gimple gs)
5335 {
5336 gimple_statement_transaction *transaction_stmt =
5337 as_a <gimple_statement_transaction> (gs);
5338 return &transaction_stmt->label;
5339 }
5340
5341 /* Return the subcode associated with a GIMPLE_TRANSACTION. */
5342
5343 static inline unsigned int
5344 gimple_transaction_subcode (const_gimple gs)
5345 {
5346 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
5347 return gs->subcode;
5348 }
5349
5350 /* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
5351
5352 static inline void
5353 gimple_transaction_set_body (gimple gs, gimple_seq body)
5354 {
5355 gimple_statement_transaction *transaction_stmt =
5356 as_a <gimple_statement_transaction> (gs);
5357 transaction_stmt->body = body;
5358 }
5359
5360 /* Set the label associated with a GIMPLE_TRANSACTION. */
5361
5362 static inline void
5363 gimple_transaction_set_label (gimple gs, tree label)
5364 {
5365 gimple_statement_transaction *transaction_stmt =
5366 as_a <gimple_statement_transaction> (gs);
5367 transaction_stmt->label = label;
5368 }
5369
5370 /* Set the subcode associated with a GIMPLE_TRANSACTION. */
5371
5372 static inline void
5373 gimple_transaction_set_subcode (gimple gs, unsigned int subcode)
5374 {
5375 GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
5376 gs->subcode = subcode;
5377 }
5378
5379
5380 /* Return a pointer to the return value for GIMPLE_RETURN GS. */
5381
5382 static inline tree *
5383 gimple_return_retval_ptr (const_gimple gs)
5384 {
5385 GIMPLE_CHECK (gs, GIMPLE_RETURN);
5386 return gimple_op_ptr (gs, 0);
5387 }
5388
5389 /* Return the return value for GIMPLE_RETURN GS. */
5390
5391 static inline tree
5392 gimple_return_retval (const_gimple gs)
5393 {
5394 GIMPLE_CHECK (gs, GIMPLE_RETURN);
5395 return gimple_op (gs, 0);
5396 }
5397
5398
5399 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
5400
5401 static inline void
5402 gimple_return_set_retval (gimple gs, tree retval)
5403 {
5404 GIMPLE_CHECK (gs, GIMPLE_RETURN);
5405 gimple_set_op (gs, 0, retval);
5406 }
5407
5408
5409 /* Return the return bounds for GIMPLE_RETURN GS. */
5410
5411 static inline tree
5412 gimple_return_retbnd (const_gimple gs)
5413 {
5414 GIMPLE_CHECK (gs, GIMPLE_RETURN);
5415 return gimple_op (gs, 1);
5416 }
5417
5418
5419 /* Set RETVAL to be the return bounds for GIMPLE_RETURN GS. */
5420
5421 static inline void
5422 gimple_return_set_retbnd (gimple gs, tree retval)
5423 {
5424 GIMPLE_CHECK (gs, GIMPLE_RETURN);
5425 gimple_set_op (gs, 1, retval);
5426 }
5427
5428
5429 /* Returns true when the gimple statement STMT is any of the OpenMP types. */
5430
5431 #define CASE_GIMPLE_OMP \
5432 case GIMPLE_OMP_PARALLEL: \
5433 case GIMPLE_OMP_TASK: \
5434 case GIMPLE_OMP_FOR: \
5435 case GIMPLE_OMP_SECTIONS: \
5436 case GIMPLE_OMP_SECTIONS_SWITCH: \
5437 case GIMPLE_OMP_SINGLE: \
5438 case GIMPLE_OMP_TARGET: \
5439 case GIMPLE_OMP_TEAMS: \
5440 case GIMPLE_OMP_SECTION: \
5441 case GIMPLE_OMP_MASTER: \
5442 case GIMPLE_OMP_TASKGROUP: \
5443 case GIMPLE_OMP_ORDERED: \
5444 case GIMPLE_OMP_CRITICAL: \
5445 case GIMPLE_OMP_RETURN: \
5446 case GIMPLE_OMP_ATOMIC_LOAD: \
5447 case GIMPLE_OMP_ATOMIC_STORE: \
5448 case GIMPLE_OMP_CONTINUE
5449
5450 static inline bool
5451 is_gimple_omp (const_gimple stmt)
5452 {
5453 switch (gimple_code (stmt))
5454 {
5455 CASE_GIMPLE_OMP:
5456 return true;
5457 default:
5458 return false;
5459 }
5460 }
5461
5462
5463 /* Returns TRUE if statement G is a GIMPLE_NOP. */
5464
5465 static inline bool
5466 gimple_nop_p (const_gimple g)
5467 {
5468 return gimple_code (g) == GIMPLE_NOP;
5469 }
5470
5471
5472 /* Return true if GS is a GIMPLE_RESX. */
5473
5474 static inline bool
5475 is_gimple_resx (const_gimple gs)
5476 {
5477 return gimple_code (gs) == GIMPLE_RESX;
5478 }
5479
5480 /* Return the predictor of GIMPLE_PREDICT statement GS. */
5481
5482 static inline enum br_predictor
5483 gimple_predict_predictor (gimple gs)
5484 {
5485 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
5486 return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN);
5487 }
5488
5489
5490 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
5491
5492 static inline void
5493 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
5494 {
5495 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
5496 gs->subcode = (gs->subcode & GF_PREDICT_TAKEN)
5497 | (unsigned) predictor;
5498 }
5499
5500
5501 /* Return the outcome of GIMPLE_PREDICT statement GS. */
5502
5503 static inline enum prediction
5504 gimple_predict_outcome (gimple gs)
5505 {
5506 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
5507 return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
5508 }
5509
5510
5511 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
5512
5513 static inline void
5514 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
5515 {
5516 GIMPLE_CHECK (gs, GIMPLE_PREDICT);
5517 if (outcome == TAKEN)
5518 gs->subcode |= GF_PREDICT_TAKEN;
5519 else
5520 gs->subcode &= ~GF_PREDICT_TAKEN;
5521 }
5522
5523
5524 /* Return the type of the main expression computed by STMT. Return
5525 void_type_node if the statement computes nothing. */
5526
5527 static inline tree
5528 gimple_expr_type (const_gimple stmt)
5529 {
5530 enum gimple_code code = gimple_code (stmt);
5531
5532 if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
5533 {
5534 tree type;
5535 /* In general we want to pass out a type that can be substituted
5536 for both the RHS and the LHS types if there is a possibly
5537 useless conversion involved. That means returning the
5538 original RHS type as far as we can reconstruct it. */
5539 if (code == GIMPLE_CALL)
5540 type = gimple_call_return_type (stmt);
5541 else
5542 switch (gimple_assign_rhs_code (stmt))
5543 {
5544 case POINTER_PLUS_EXPR:
5545 type = TREE_TYPE (gimple_assign_rhs1 (stmt));
5546 break;
5547
5548 default:
5549 /* As fallback use the type of the LHS. */
5550 type = TREE_TYPE (gimple_get_lhs (stmt));
5551 break;
5552 }
5553 return type;
5554 }
5555 else if (code == GIMPLE_COND)
5556 return boolean_type_node;
5557 else
5558 return void_type_node;
5559 }
5560
5561 /* Enum and arrays used for allocation stats. Keep in sync with
5562 gimple.c:gimple_alloc_kind_names. */
5563 enum gimple_alloc_kind
5564 {
5565 gimple_alloc_kind_assign, /* Assignments. */
5566 gimple_alloc_kind_phi, /* PHI nodes. */
5567 gimple_alloc_kind_cond, /* Conditionals. */
5568 gimple_alloc_kind_rest, /* Everything else. */
5569 gimple_alloc_kind_all
5570 };
5571
5572 extern int gimple_alloc_counts[];
5573 extern int gimple_alloc_sizes[];
5574
5575 /* Return the allocation kind for a given stmt CODE. */
5576 static inline enum gimple_alloc_kind
5577 gimple_alloc_kind (enum gimple_code code)
5578 {
5579 switch (code)
5580 {
5581 case GIMPLE_ASSIGN:
5582 return gimple_alloc_kind_assign;
5583 case GIMPLE_PHI:
5584 return gimple_alloc_kind_phi;
5585 case GIMPLE_COND:
5586 return gimple_alloc_kind_cond;
5587 default:
5588 return gimple_alloc_kind_rest;
5589 }
5590 }
5591
5592 /* Return true if a location should not be emitted for this statement
5593 by annotate_all_with_location. */
5594
5595 static inline bool
5596 gimple_do_not_emit_location_p (gimple g)
5597 {
5598 return gimple_plf (g, GF_PLF_1);
5599 }
5600
5601 /* Mark statement G so a location will not be emitted by
5602 annotate_one_with_location. */
5603
5604 static inline void
5605 gimple_set_do_not_emit_location (gimple g)
5606 {
5607 /* The PLF flags are initialized to 0 when a new tuple is created,
5608 so no need to initialize it anywhere. */
5609 gimple_set_plf (g, GF_PLF_1, true);
5610 }
5611
5612
5613 /* Macros for showing usage statistics. */
5614 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
5615 ? (x) \
5616 : ((x) < 1024*1024*10 \
5617 ? (x) / 1024 \
5618 : (x) / (1024*1024))))
5619
5620 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
5621
5622 #endif /* GCC_GIMPLE_H */