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