1 1.12 mrg @c Copyright (C) 2008-2022 Free Software Foundation, Inc. 2 1.1 mrg @c Free Software Foundation, Inc. 3 1.1 mrg @c This is part of the GCC manual. 4 1.1 mrg @c For copying conditions, see the file gcc.texi. 5 1.1 mrg 6 1.1 mrg @node GIMPLE 7 1.1 mrg @chapter GIMPLE 8 1.1 mrg @cindex GIMPLE 9 1.1 mrg 10 1.1 mrg GIMPLE is a three-address representation derived from GENERIC by 11 1.1 mrg breaking down GENERIC expressions into tuples of no more than 3 12 1.1 mrg operands (with some exceptions like function calls). GIMPLE was 13 1.1 mrg heavily influenced by the SIMPLE IL used by the McCAT compiler 14 1.1 mrg project at McGill University, though we have made some different 15 1.1 mrg choices. For one thing, SIMPLE doesn't support @code{goto}. 16 1.1 mrg 17 1.1 mrg Temporaries are introduced to hold intermediate values needed to 18 1.1 mrg compute complex expressions. Additionally, all the control 19 1.1 mrg structures used in GENERIC are lowered into conditional jumps, 20 1.1 mrg lexical scopes are removed and exception regions are converted 21 1.1 mrg into an on the side exception region tree. 22 1.1 mrg 23 1.1 mrg The compiler pass which converts GENERIC into GIMPLE is referred to as 24 1.1 mrg the @samp{gimplifier}. The gimplifier works recursively, generating 25 1.1 mrg GIMPLE tuples out of the original GENERIC expressions. 26 1.1 mrg 27 1.1 mrg One of the early implementation strategies used for the GIMPLE 28 1.1 mrg representation was to use the same internal data structures used 29 1.1 mrg by front ends to represent parse trees. This simplified 30 1.1 mrg implementation because we could leverage existing functionality 31 1.1 mrg and interfaces. However, GIMPLE is a much more restrictive 32 1.1 mrg representation than abstract syntax trees (AST), therefore it 33 1.1 mrg does not require the full structural complexity provided by the 34 1.1 mrg main tree data structure. 35 1.1 mrg 36 1.1 mrg The GENERIC representation of a function is stored in the 37 1.1 mrg @code{DECL_SAVED_TREE} field of the associated @code{FUNCTION_DECL} 38 1.1 mrg tree node. It is converted to GIMPLE by a call to 39 1.1 mrg @code{gimplify_function_tree}. 40 1.1 mrg 41 1.1 mrg If a front end wants to include language-specific tree codes in the tree 42 1.1 mrg representation which it provides to the back end, it must provide a 43 1.1 mrg definition of @code{LANG_HOOKS_GIMPLIFY_EXPR} which knows how to 44 1.1 mrg convert the front end trees to GIMPLE@. Usually such a hook will involve 45 1.1 mrg much of the same code for expanding front end trees to RTL@. This function 46 1.1 mrg can return fully lowered GIMPLE, or it can return GENERIC trees and let the 47 1.1 mrg main gimplifier lower them the rest of the way; this is often simpler. 48 1.1 mrg GIMPLE that is not fully lowered is known as ``High GIMPLE'' and 49 1.1 mrg consists of the IL before the pass @code{pass_lower_cf}. High GIMPLE 50 1.1 mrg contains some container statements like lexical scopes 51 1.1 mrg (represented by @code{GIMPLE_BIND}) and nested expressions (e.g., 52 1.1 mrg @code{GIMPLE_TRY}), while ``Low GIMPLE'' exposes all of the 53 1.1 mrg implicit jumps for control and exception expressions directly in 54 1.1 mrg the IL and EH region trees. 55 1.1 mrg 56 1.1 mrg The C and C++ front ends currently convert directly from front end 57 1.1 mrg trees to GIMPLE, and hand that off to the back end rather than first 58 1.1 mrg converting to GENERIC@. Their gimplifier hooks know about all the 59 1.1 mrg @code{_STMT} nodes and how to convert them to GENERIC forms. There 60 1.1 mrg was some work done on a genericization pass which would run first, but 61 1.1 mrg the existence of @code{STMT_EXPR} meant that in order to convert all 62 1.1 mrg of the C statements into GENERIC equivalents would involve walking the 63 1.1 mrg entire tree anyway, so it was simpler to lower all the way. This 64 1.1 mrg might change in the future if someone writes an optimization pass 65 1.1 mrg which would work better with higher-level trees, but currently the 66 1.1 mrg optimizers all expect GIMPLE@. 67 1.1 mrg 68 1.1 mrg You can request to dump a C-like representation of the GIMPLE form 69 1.1 mrg with the flag @option{-fdump-tree-gimple}. 70 1.1 mrg 71 1.1 mrg @menu 72 1.1 mrg * Tuple representation:: 73 1.5 mrg * Class hierarchy of GIMPLE statements:: 74 1.1 mrg * GIMPLE instruction set:: 75 1.1 mrg * GIMPLE Exception Handling:: 76 1.1 mrg * Temporaries:: 77 1.1 mrg * Operands:: 78 1.1 mrg * Manipulating GIMPLE statements:: 79 1.1 mrg * Tuple specific accessors:: 80 1.1 mrg * GIMPLE sequences:: 81 1.1 mrg * Sequence iterators:: 82 1.1 mrg * Adding a new GIMPLE statement code:: 83 1.1 mrg * Statement and operand traversals:: 84 1.1 mrg @end menu 85 1.1 mrg 86 1.1 mrg @node Tuple representation 87 1.1 mrg @section Tuple representation 88 1.1 mrg @cindex tuples 89 1.1 mrg 90 1.1 mrg GIMPLE instructions are tuples of variable size divided in two 91 1.1 mrg groups: a header describing the instruction and its locations, 92 1.1 mrg and a variable length body with all the operands. Tuples are 93 1.1 mrg organized into a hierarchy with 3 main classes of tuples. 94 1.1 mrg 95 1.6 mrg @subsection @code{gimple} (gsbase) 96 1.6 mrg @cindex gimple 97 1.1 mrg 98 1.1 mrg This is the root of the hierarchy, it holds basic information 99 1.1 mrg needed by most GIMPLE statements. There are some fields that 100 1.1 mrg may not be relevant to every GIMPLE statement, but those were 101 1.1 mrg moved into the base structure to take advantage of holes left by 102 1.1 mrg other fields (thus making the structure more compact). The 103 1.1 mrg structure takes 4 words (32 bytes) on 64 bit hosts: 104 1.1 mrg 105 1.1 mrg @multitable {@code{references_memory_p}} {Size (bits)} 106 1.1 mrg @item Field @tab Size (bits) 107 1.1 mrg @item @code{code} @tab 8 108 1.1 mrg @item @code{subcode} @tab 16 109 1.1 mrg @item @code{no_warning} @tab 1 110 1.1 mrg @item @code{visited} @tab 1 111 1.1 mrg @item @code{nontemporal_move} @tab 1 112 1.1 mrg @item @code{plf} @tab 2 113 1.1 mrg @item @code{modified} @tab 1 114 1.1 mrg @item @code{has_volatile_ops} @tab 1 115 1.1 mrg @item @code{references_memory_p} @tab 1 116 1.1 mrg @item @code{uid} @tab 32 117 1.1 mrg @item @code{location} @tab 32 118 1.1 mrg @item @code{num_ops} @tab 32 119 1.1 mrg @item @code{bb} @tab 64 120 1.1 mrg @item @code{block} @tab 63 121 1.1 mrg @item Total size @tab 32 bytes 122 1.1 mrg @end multitable 123 1.1 mrg 124 1.1 mrg @itemize @bullet 125 1.1 mrg @item @code{code} 126 1.3 mrg Main identifier for a GIMPLE instruction. 127 1.1 mrg 128 1.1 mrg @item @code{subcode} 129 1.1 mrg Used to distinguish different variants of the same basic 130 1.1 mrg instruction or provide flags applicable to a given code. The 131 1.1 mrg @code{subcode} flags field has different uses depending on the code of 132 1.1 mrg the instruction, but mostly it distinguishes instructions of the 133 1.1 mrg same family. The most prominent use of this field is in 134 1.1 mrg assignments, where subcode indicates the operation done on the 135 1.1 mrg RHS of the assignment. For example, a = b + c is encoded as 136 1.1 mrg @code{GIMPLE_ASSIGN <PLUS_EXPR, a, b, c>}. 137 1.1 mrg 138 1.1 mrg @item @code{no_warning} 139 1.1 mrg Bitflag to indicate whether a warning has already been issued on 140 1.1 mrg this statement. 141 1.1 mrg 142 1.1 mrg @item @code{visited} 143 1.1 mrg General purpose ``visited'' marker. Set and cleared by each pass 144 1.1 mrg when needed. 145 1.1 mrg 146 1.1 mrg @item @code{nontemporal_move} 147 1.1 mrg Bitflag used in assignments that represent non-temporal moves. 148 1.1 mrg Although this bitflag is only used in assignments, it was moved 149 1.1 mrg into the base to take advantage of the bit holes left by the 150 1.1 mrg previous fields. 151 1.1 mrg 152 1.1 mrg @item @code{plf} 153 1.1 mrg Pass Local Flags. This 2-bit mask can be used as general purpose 154 1.1 mrg markers by any pass. Passes are responsible for clearing and 155 1.1 mrg setting these two flags accordingly. 156 1.1 mrg 157 1.1 mrg @item @code{modified} 158 1.1 mrg Bitflag to indicate whether the statement has been modified. 159 1.1 mrg Used mainly by the operand scanner to determine when to re-scan a 160 1.1 mrg statement for operands. 161 1.1 mrg 162 1.1 mrg @item @code{has_volatile_ops} 163 1.1 mrg Bitflag to indicate whether this statement contains operands that 164 1.1 mrg have been marked volatile. 165 1.1 mrg 166 1.1 mrg @item @code{references_memory_p} 167 1.1 mrg Bitflag to indicate whether this statement contains memory 168 1.1 mrg references (i.e., its operands are either global variables, or 169 1.1 mrg pointer dereferences or anything that must reside in memory). 170 1.1 mrg 171 1.1 mrg @item @code{uid} 172 1.1 mrg This is an unsigned integer used by passes that want to assign 173 1.1 mrg IDs to every statement. These IDs must be assigned and used by 174 1.1 mrg each pass. 175 1.1 mrg 176 1.1 mrg @item @code{location} 177 1.1 mrg This is a @code{location_t} identifier to specify source code 178 1.1 mrg location for this statement. It is inherited from the front 179 1.1 mrg end. 180 1.1 mrg 181 1.1 mrg @item @code{num_ops} 182 1.1 mrg Number of operands that this statement has. This specifies the 183 1.1 mrg size of the operand vector embedded in the tuple. Only used in 184 1.1 mrg some tuples, but it is declared in the base tuple to take 185 1.1 mrg advantage of the 32-bit hole left by the previous fields. 186 1.1 mrg 187 1.1 mrg @item @code{bb} 188 1.1 mrg Basic block holding the instruction. 189 1.3 mrg 190 1.1 mrg @item @code{block} 191 1.1 mrg Lexical block holding this statement. Also used for debug 192 1.1 mrg information generation. 193 1.1 mrg @end itemize 194 1.1 mrg 195 1.1 mrg @subsection @code{gimple_statement_with_ops} 196 1.1 mrg @cindex gimple_statement_with_ops 197 1.1 mrg 198 1.1 mrg This tuple is actually split in two: 199 1.1 mrg @code{gimple_statement_with_ops_base} and 200 1.1 mrg @code{gimple_statement_with_ops}. This is needed to accommodate the 201 1.1 mrg way the operand vector is allocated. The operand vector is 202 1.1 mrg defined to be an array of 1 element. So, to allocate a dynamic 203 1.1 mrg number of operands, the memory allocator (@code{gimple_alloc}) simply 204 1.1 mrg allocates enough memory to hold the structure itself plus @code{N 205 1.1 mrg - 1} operands which run ``off the end'' of the structure. For 206 1.1 mrg example, to allocate space for a tuple with 3 operands, 207 1.1 mrg @code{gimple_alloc} reserves @code{sizeof (struct 208 1.1 mrg gimple_statement_with_ops) + 2 * sizeof (tree)} bytes. 209 1.1 mrg 210 1.1 mrg On the other hand, several fields in this tuple need to be shared 211 1.1 mrg with the @code{gimple_statement_with_memory_ops} tuple. So, these 212 1.1 mrg common fields are placed in @code{gimple_statement_with_ops_base} which 213 1.1 mrg is then inherited from the other two tuples. 214 1.1 mrg 215 1.1 mrg 216 1.3 mrg @multitable {@code{def_ops}} {48 + 8 * @code{num_ops} bytes} 217 1.1 mrg @item @code{gsbase} @tab 256 218 1.1 mrg @item @code{def_ops} @tab 64 219 1.1 mrg @item @code{use_ops} @tab 64 220 1.1 mrg @item @code{op} @tab @code{num_ops} * 64 221 1.3 mrg @item Total size @tab 48 + 8 * @code{num_ops} bytes 222 1.1 mrg @end multitable 223 1.1 mrg 224 1.1 mrg @itemize @bullet 225 1.1 mrg @item @code{gsbase} 226 1.6 mrg Inherited from @code{struct gimple}. 227 1.1 mrg 228 1.1 mrg @item @code{def_ops} 229 1.1 mrg Array of pointers into the operand array indicating all the slots that 230 1.1 mrg contain a variable written-to by the statement. This array is 231 1.1 mrg also used for immediate use chaining. Note that it would be 232 1.1 mrg possible to not rely on this array, but the changes required to 233 1.1 mrg implement this are pretty invasive. 234 1.1 mrg 235 1.1 mrg @item @code{use_ops} 236 1.1 mrg Similar to @code{def_ops} but for variables read by the statement. 237 1.1 mrg 238 1.1 mrg @item @code{op} 239 1.1 mrg Array of trees with @code{num_ops} slots. 240 1.1 mrg @end itemize 241 1.1 mrg 242 1.1 mrg @subsection @code{gimple_statement_with_memory_ops} 243 1.1 mrg 244 1.1 mrg This tuple is essentially identical to @code{gimple_statement_with_ops}, 245 1.1 mrg except that it contains 4 additional fields to hold vectors 246 1.1 mrg related memory stores and loads. Similar to the previous case, 247 1.1 mrg the structure is split in two to accommodate for the operand 248 1.1 mrg vector (@code{gimple_statement_with_memory_ops_base} and 249 1.1 mrg @code{gimple_statement_with_memory_ops}). 250 1.1 mrg 251 1.1 mrg 252 1.3 mrg @multitable {@code{vdef_ops}} {80 + 8 * @code{num_ops} bytes} 253 1.3 mrg @item Field @tab Size (bits) 254 1.3 mrg @item @code{gsbase} @tab 256 255 1.3 mrg @item @code{def_ops} @tab 64 256 1.3 mrg @item @code{use_ops} @tab 64 257 1.3 mrg @item @code{vdef_ops} @tab 64 258 1.3 mrg @item @code{vuse_ops} @tab 64 259 1.3 mrg @item @code{stores} @tab 64 260 1.3 mrg @item @code{loads} @tab 64 261 1.3 mrg @item @code{op} @tab @code{num_ops} * 64 262 1.3 mrg @item Total size @tab 80 + 8 * @code{num_ops} bytes 263 1.1 mrg @end multitable 264 1.1 mrg 265 1.1 mrg @itemize @bullet 266 1.1 mrg @item @code{vdef_ops} 267 1.1 mrg Similar to @code{def_ops} but for @code{VDEF} operators. There is 268 1.1 mrg one entry per memory symbol written by this statement. This is 269 1.1 mrg used to maintain the memory SSA use-def and def-def chains. 270 1.1 mrg 271 1.1 mrg @item @code{vuse_ops} 272 1.1 mrg Similar to @code{use_ops} but for @code{VUSE} operators. There is 273 1.1 mrg one entry per memory symbol loaded by this statement. This is 274 1.1 mrg used to maintain the memory SSA use-def chains. 275 1.1 mrg 276 1.1 mrg @item @code{stores} 277 1.1 mrg Bitset with all the UIDs for the symbols written-to by the 278 1.1 mrg statement. This is different than @code{vdef_ops} in that all the 279 1.1 mrg affected symbols are mentioned in this set. If memory 280 1.1 mrg partitioning is enabled, the @code{vdef_ops} vector will refer to memory 281 1.1 mrg partitions. Furthermore, no SSA information is stored in this 282 1.1 mrg set. 283 1.1 mrg 284 1.1 mrg @item @code{loads} 285 1.1 mrg Similar to @code{stores}, but for memory loads. (Note that there 286 1.1 mrg is some amount of redundancy here, it should be possible to 287 1.1 mrg reduce memory utilization further by removing these sets). 288 1.1 mrg @end itemize 289 1.1 mrg 290 1.1 mrg All the other tuples are defined in terms of these three basic 291 1.5 mrg ones. Each tuple will add some fields. 292 1.5 mrg 293 1.5 mrg 294 1.5 mrg @node Class hierarchy of GIMPLE statements 295 1.5 mrg @section Class hierarchy of GIMPLE statements 296 1.5 mrg @cindex GIMPLE class hierarchy 297 1.5 mrg 298 1.5 mrg The following diagram shows the C++ inheritance hierarchy of statement 299 1.5 mrg kinds, along with their relationships to @code{GSS_} values (layouts) and 300 1.5 mrg @code{GIMPLE_} values (codes): 301 1.1 mrg 302 1.1 mrg @smallexample 303 1.6 mrg gimple 304 1.5 mrg | layout: GSS_BASE 305 1.5 mrg | used for 4 codes: GIMPLE_ERROR_MARK 306 1.5 mrg | GIMPLE_NOP 307 1.5 mrg | GIMPLE_OMP_SECTIONS_SWITCH 308 1.5 mrg | GIMPLE_PREDICT 309 1.5 mrg | 310 1.5 mrg + gimple_statement_with_ops_base 311 1.5 mrg | | (no GSS layout) 312 1.5 mrg | | 313 1.5 mrg | + gimple_statement_with_ops 314 1.5 mrg | | | layout: GSS_WITH_OPS 315 1.5 mrg | | | 316 1.5 mrg | | + gcond 317 1.5 mrg | | | code: GIMPLE_COND 318 1.5 mrg | | | 319 1.5 mrg | | + gdebug 320 1.5 mrg | | | code: GIMPLE_DEBUG 321 1.5 mrg | | | 322 1.5 mrg | | + ggoto 323 1.5 mrg | | | code: GIMPLE_GOTO 324 1.5 mrg | | | 325 1.5 mrg | | + glabel 326 1.5 mrg | | | code: GIMPLE_LABEL 327 1.5 mrg | | | 328 1.5 mrg | | + gswitch 329 1.5 mrg | | code: GIMPLE_SWITCH 330 1.5 mrg | | 331 1.5 mrg | + gimple_statement_with_memory_ops_base 332 1.5 mrg | | layout: GSS_WITH_MEM_OPS_BASE 333 1.5 mrg | | 334 1.5 mrg | + gimple_statement_with_memory_ops 335 1.5 mrg | | | layout: GSS_WITH_MEM_OPS 336 1.5 mrg | | | 337 1.5 mrg | | + gassign 338 1.5 mrg | | | code GIMPLE_ASSIGN 339 1.5 mrg | | | 340 1.5 mrg | | + greturn 341 1.5 mrg | | code GIMPLE_RETURN 342 1.5 mrg | | 343 1.5 mrg | + gcall 344 1.5 mrg | | layout: GSS_CALL, code: GIMPLE_CALL 345 1.5 mrg | | 346 1.5 mrg | + gasm 347 1.5 mrg | | layout: GSS_ASM, code: GIMPLE_ASM 348 1.5 mrg | | 349 1.5 mrg | + gtransaction 350 1.5 mrg | layout: GSS_TRANSACTION, code: GIMPLE_TRANSACTION 351 1.5 mrg | 352 1.5 mrg + gimple_statement_omp 353 1.5 mrg | | layout: GSS_OMP. Used for code GIMPLE_OMP_SECTION 354 1.5 mrg | | 355 1.5 mrg | + gomp_critical 356 1.5 mrg | | layout: GSS_OMP_CRITICAL, code: GIMPLE_OMP_CRITICAL 357 1.5 mrg | | 358 1.5 mrg | + gomp_for 359 1.5 mrg | | layout: GSS_OMP_FOR, code: GIMPLE_OMP_FOR 360 1.5 mrg | | 361 1.5 mrg | + gomp_parallel_layout 362 1.5 mrg | | | layout: GSS_OMP_PARALLEL_LAYOUT 363 1.5 mrg | | | 364 1.5 mrg | | + gimple_statement_omp_taskreg 365 1.5 mrg | | | | 366 1.5 mrg | | | + gomp_parallel 367 1.5 mrg | | | | code: GIMPLE_OMP_PARALLEL 368 1.5 mrg | | | | 369 1.5 mrg | | | + gomp_task 370 1.5 mrg | | | code: GIMPLE_OMP_TASK 371 1.5 mrg | | | 372 1.5 mrg | | + gimple_statement_omp_target 373 1.5 mrg | | code: GIMPLE_OMP_TARGET 374 1.5 mrg | | 375 1.5 mrg | + gomp_sections 376 1.5 mrg | | layout: GSS_OMP_SECTIONS, code: GIMPLE_OMP_SECTIONS 377 1.5 mrg | | 378 1.5 mrg | + gimple_statement_omp_single_layout 379 1.5 mrg | | layout: GSS_OMP_SINGLE_LAYOUT 380 1.5 mrg | | 381 1.5 mrg | + gomp_single 382 1.5 mrg | | code: GIMPLE_OMP_SINGLE 383 1.5 mrg | | 384 1.5 mrg | + gomp_teams 385 1.5 mrg | code: GIMPLE_OMP_TEAMS 386 1.5 mrg | 387 1.5 mrg + gbind 388 1.5 mrg | layout: GSS_BIND, code: GIMPLE_BIND 389 1.5 mrg | 390 1.5 mrg + gcatch 391 1.5 mrg | layout: GSS_CATCH, code: GIMPLE_CATCH 392 1.5 mrg | 393 1.5 mrg + geh_filter 394 1.5 mrg | layout: GSS_EH_FILTER, code: GIMPLE_EH_FILTER 395 1.5 mrg | 396 1.5 mrg + geh_else 397 1.5 mrg | layout: GSS_EH_ELSE, code: GIMPLE_EH_ELSE 398 1.5 mrg | 399 1.5 mrg + geh_mnt 400 1.5 mrg | layout: GSS_EH_MNT, code: GIMPLE_EH_MUST_NOT_THROW 401 1.5 mrg | 402 1.5 mrg + gphi 403 1.5 mrg | layout: GSS_PHI, code: GIMPLE_PHI 404 1.5 mrg | 405 1.5 mrg + gimple_statement_eh_ctrl 406 1.5 mrg | | layout: GSS_EH_CTRL 407 1.5 mrg | | 408 1.5 mrg | + gresx 409 1.5 mrg | | code: GIMPLE_RESX 410 1.5 mrg | | 411 1.5 mrg | + geh_dispatch 412 1.5 mrg | code: GIMPLE_EH_DISPATCH 413 1.5 mrg | 414 1.5 mrg + gtry 415 1.5 mrg | layout: GSS_TRY, code: GIMPLE_TRY 416 1.5 mrg | 417 1.5 mrg + gimple_statement_wce 418 1.5 mrg | layout: GSS_WCE, code: GIMPLE_WITH_CLEANUP_EXPR 419 1.5 mrg | 420 1.5 mrg + gomp_continue 421 1.5 mrg | layout: GSS_OMP_CONTINUE, code: GIMPLE_OMP_CONTINUE 422 1.5 mrg | 423 1.5 mrg + gomp_atomic_load 424 1.5 mrg | layout: GSS_OMP_ATOMIC_LOAD, code: GIMPLE_OMP_ATOMIC_LOAD 425 1.5 mrg | 426 1.5 mrg + gimple_statement_omp_atomic_store_layout 427 1.5 mrg | layout: GSS_OMP_ATOMIC_STORE_LAYOUT, 428 1.5 mrg | code: GIMPLE_OMP_ATOMIC_STORE 429 1.5 mrg | 430 1.5 mrg + gomp_atomic_store 431 1.5 mrg | code: GIMPLE_OMP_ATOMIC_STORE 432 1.5 mrg | 433 1.5 mrg + gomp_return 434 1.5 mrg code: GIMPLE_OMP_RETURN 435 1.1 mrg @end smallexample 436 1.1 mrg 437 1.3 mrg 438 1.1 mrg @node GIMPLE instruction set 439 1.1 mrg @section GIMPLE instruction set 440 1.1 mrg @cindex GIMPLE instruction set 441 1.1 mrg 442 1.1 mrg The following table briefly describes the GIMPLE instruction set. 443 1.1 mrg 444 1.1 mrg @multitable {@code{GIMPLE_OMP_SECTIONS_SWITCH}} {High GIMPLE} {Low GIMPLE} 445 1.1 mrg @item Instruction @tab High GIMPLE @tab Low GIMPLE 446 1.1 mrg @item @code{GIMPLE_ASM} @tab x @tab x 447 1.1 mrg @item @code{GIMPLE_ASSIGN} @tab x @tab x 448 1.1 mrg @item @code{GIMPLE_BIND} @tab x @tab 449 1.1 mrg @item @code{GIMPLE_CALL} @tab x @tab x 450 1.1 mrg @item @code{GIMPLE_CATCH} @tab x @tab 451 1.1 mrg @item @code{GIMPLE_COND} @tab x @tab x 452 1.1 mrg @item @code{GIMPLE_DEBUG} @tab x @tab x 453 1.1 mrg @item @code{GIMPLE_EH_FILTER} @tab x @tab 454 1.1 mrg @item @code{GIMPLE_GOTO} @tab x @tab x 455 1.1 mrg @item @code{GIMPLE_LABEL} @tab x @tab x 456 1.1 mrg @item @code{GIMPLE_NOP} @tab x @tab x 457 1.1 mrg @item @code{GIMPLE_OMP_ATOMIC_LOAD} @tab x @tab x 458 1.1 mrg @item @code{GIMPLE_OMP_ATOMIC_STORE} @tab x @tab x 459 1.1 mrg @item @code{GIMPLE_OMP_CONTINUE} @tab x @tab x 460 1.1 mrg @item @code{GIMPLE_OMP_CRITICAL} @tab x @tab x 461 1.1 mrg @item @code{GIMPLE_OMP_FOR} @tab x @tab x 462 1.1 mrg @item @code{GIMPLE_OMP_MASTER} @tab x @tab x 463 1.1 mrg @item @code{GIMPLE_OMP_ORDERED} @tab x @tab x 464 1.1 mrg @item @code{GIMPLE_OMP_PARALLEL} @tab x @tab x 465 1.1 mrg @item @code{GIMPLE_OMP_RETURN} @tab x @tab x 466 1.1 mrg @item @code{GIMPLE_OMP_SECTION} @tab x @tab x 467 1.1 mrg @item @code{GIMPLE_OMP_SECTIONS} @tab x @tab x 468 1.1 mrg @item @code{GIMPLE_OMP_SECTIONS_SWITCH} @tab x @tab x 469 1.1 mrg @item @code{GIMPLE_OMP_SINGLE} @tab x @tab x 470 1.1 mrg @item @code{GIMPLE_PHI} @tab @tab x 471 1.1 mrg @item @code{GIMPLE_RESX} @tab @tab x 472 1.1 mrg @item @code{GIMPLE_RETURN} @tab x @tab x 473 1.1 mrg @item @code{GIMPLE_SWITCH} @tab x @tab x 474 1.1 mrg @item @code{GIMPLE_TRY} @tab x @tab 475 1.1 mrg @end multitable 476 1.1 mrg 477 1.1 mrg @node GIMPLE Exception Handling 478 1.1 mrg @section Exception Handling 479 1.1 mrg @cindex GIMPLE Exception Handling 480 1.1 mrg 481 1.1 mrg Other exception handling constructs are represented using 482 1.1 mrg @code{GIMPLE_TRY_CATCH}. @code{GIMPLE_TRY_CATCH} has two operands. The 483 1.1 mrg first operand is a sequence of statements to execute. If executing 484 1.1 mrg these statements does not throw an exception, then the second operand 485 1.1 mrg is ignored. Otherwise, if an exception is thrown, then the second 486 1.1 mrg operand of the @code{GIMPLE_TRY_CATCH} is checked. The second 487 1.1 mrg operand may have the following forms: 488 1.1 mrg 489 1.1 mrg @enumerate 490 1.1 mrg 491 1.1 mrg @item A sequence of statements to execute. When an exception occurs, 492 1.1 mrg these statements are executed, and then the exception is rethrown. 493 1.1 mrg 494 1.1 mrg @item A sequence of @code{GIMPLE_CATCH} statements. Each 495 1.1 mrg @code{GIMPLE_CATCH} has a list of applicable exception types and 496 1.1 mrg handler code. If the thrown exception matches one of the caught 497 1.1 mrg types, the associated handler code is executed. If the handler 498 1.1 mrg code falls off the bottom, execution continues after the original 499 1.1 mrg @code{GIMPLE_TRY_CATCH}. 500 1.1 mrg 501 1.1 mrg @item A @code{GIMPLE_EH_FILTER} statement. This has a list of 502 1.1 mrg permitted exception types, and code to handle a match failure. If the 503 1.1 mrg thrown exception does not match one of the allowed types, the 504 1.1 mrg associated match failure code is executed. If the thrown exception 505 1.1 mrg does match, it continues unwinding the stack looking for the next 506 1.1 mrg handler. 507 1.1 mrg 508 1.1 mrg @end enumerate 509 1.1 mrg 510 1.1 mrg Currently throwing an exception is not directly represented in 511 1.1 mrg GIMPLE, since it is implemented by calling a function. At some 512 1.1 mrg point in the future we will want to add some way to express that 513 1.1 mrg the call will throw an exception of a known type. 514 1.1 mrg 515 1.1 mrg Just before running the optimizers, the compiler lowers the 516 1.1 mrg high-level EH constructs above into a set of @samp{goto}s, magic 517 1.1 mrg labels, and EH regions. Continuing to unwind at the end of a 518 1.1 mrg cleanup is represented with a @code{GIMPLE_RESX}. 519 1.1 mrg 520 1.1 mrg 521 1.1 mrg @node Temporaries 522 1.1 mrg @section Temporaries 523 1.1 mrg @cindex Temporaries 524 1.1 mrg 525 1.1 mrg When gimplification encounters a subexpression that is too 526 1.1 mrg complex, it creates a new temporary variable to hold the value of 527 1.1 mrg the subexpression, and adds a new statement to initialize it 528 1.1 mrg before the current statement. These special temporaries are known 529 1.1 mrg as @samp{expression temporaries}, and are allocated using 530 1.1 mrg @code{get_formal_tmp_var}. The compiler tries to always evaluate 531 1.1 mrg identical expressions into the same temporary, to simplify 532 1.1 mrg elimination of redundant calculations. 533 1.1 mrg 534 1.1 mrg We can only use expression temporaries when we know that it will 535 1.1 mrg not be reevaluated before its value is used, and that it will not 536 1.1 mrg be otherwise modified@footnote{These restrictions are derived 537 1.1 mrg from those in Morgan 4.8.}. Other temporaries can be allocated 538 1.1 mrg using @code{get_initialized_tmp_var} or @code{create_tmp_var}. 539 1.1 mrg 540 1.1 mrg Currently, an expression like @code{a = b + 5} is not reduced any 541 1.1 mrg further. We tried converting it to something like 542 1.1 mrg @smallexample 543 1.3 mrg T1 = b + 5; 544 1.3 mrg a = T1; 545 1.1 mrg @end smallexample 546 1.1 mrg but this bloated the representation for minimal benefit. However, a 547 1.1 mrg variable which must live in memory cannot appear in an expression; its 548 1.1 mrg value is explicitly loaded into a temporary first. Similarly, storing 549 1.1 mrg the value of an expression to a memory variable goes through a 550 1.1 mrg temporary. 551 1.1 mrg 552 1.1 mrg @node Operands 553 1.1 mrg @section Operands 554 1.1 mrg @cindex Operands 555 1.1 mrg 556 1.1 mrg In general, expressions in GIMPLE consist of an operation and the 557 1.1 mrg appropriate number of simple operands; these operands must either be a 558 1.1 mrg GIMPLE rvalue (@code{is_gimple_val}), i.e.@: a constant or a register 559 1.1 mrg variable. More complex operands are factored out into temporaries, so 560 1.1 mrg that 561 1.1 mrg @smallexample 562 1.3 mrg a = b + c + d 563 1.1 mrg @end smallexample 564 1.1 mrg becomes 565 1.1 mrg @smallexample 566 1.3 mrg T1 = b + c; 567 1.3 mrg a = T1 + d; 568 1.1 mrg @end smallexample 569 1.1 mrg 570 1.1 mrg The same rule holds for arguments to a @code{GIMPLE_CALL}. 571 1.1 mrg 572 1.3 mrg The target of an assignment is usually a variable, but can also be a 573 1.3 mrg @code{MEM_REF} or a compound lvalue as described below. 574 1.1 mrg 575 1.1 mrg @menu 576 1.1 mrg * Compound Expressions:: 577 1.1 mrg * Compound Lvalues:: 578 1.1 mrg * Conditional Expressions:: 579 1.1 mrg * Logical Operators:: 580 1.1 mrg @end menu 581 1.1 mrg 582 1.1 mrg @node Compound Expressions 583 1.1 mrg @subsection Compound Expressions 584 1.1 mrg @cindex Compound Expressions 585 1.1 mrg 586 1.1 mrg The left-hand side of a C comma expression is simply moved into a separate 587 1.1 mrg statement. 588 1.1 mrg 589 1.1 mrg @node Compound Lvalues 590 1.1 mrg @subsection Compound Lvalues 591 1.1 mrg @cindex Compound Lvalues 592 1.1 mrg 593 1.1 mrg Currently compound lvalues involving array and structure field references 594 1.1 mrg are not broken down; an expression like @code{a.b[2] = 42} is not reduced 595 1.1 mrg any further (though complex array subscripts are). This restriction is a 596 1.1 mrg workaround for limitations in later optimizers; if we were to convert this 597 1.1 mrg to 598 1.1 mrg 599 1.1 mrg @smallexample 600 1.3 mrg T1 = &a.b; 601 1.3 mrg T1[2] = 42; 602 1.1 mrg @end smallexample 603 1.1 mrg 604 1.1 mrg alias analysis would not remember that the reference to @code{T1[2]} came 605 1.1 mrg by way of @code{a.b}, so it would think that the assignment could alias 606 1.1 mrg another member of @code{a}; this broke @code{struct-alias-1.c}. Future 607 1.1 mrg optimizer improvements may make this limitation unnecessary. 608 1.1 mrg 609 1.1 mrg @node Conditional Expressions 610 1.1 mrg @subsection Conditional Expressions 611 1.1 mrg @cindex Conditional Expressions 612 1.1 mrg 613 1.1 mrg A C @code{?:} expression is converted into an @code{if} statement with 614 1.1 mrg each branch assigning to the same temporary. So, 615 1.1 mrg 616 1.1 mrg @smallexample 617 1.3 mrg a = b ? c : d; 618 1.1 mrg @end smallexample 619 1.1 mrg becomes 620 1.1 mrg @smallexample 621 1.3 mrg if (b == 1) 622 1.3 mrg T1 = c; 623 1.3 mrg else 624 1.3 mrg T1 = d; 625 1.3 mrg a = T1; 626 1.1 mrg @end smallexample 627 1.1 mrg 628 1.1 mrg The GIMPLE level if-conversion pass re-introduces @code{?:} 629 1.1 mrg expression, if appropriate. It is used to vectorize loops with 630 1.1 mrg conditions using vector conditional operations. 631 1.1 mrg 632 1.1 mrg Note that in GIMPLE, @code{if} statements are represented using 633 1.1 mrg @code{GIMPLE_COND}, as described below. 634 1.1 mrg 635 1.1 mrg @node Logical Operators 636 1.1 mrg @subsection Logical Operators 637 1.1 mrg @cindex Logical Operators 638 1.1 mrg 639 1.1 mrg Except when they appear in the condition operand of a 640 1.1 mrg @code{GIMPLE_COND}, logical `and' and `or' operators are simplified 641 1.1 mrg as follows: @code{a = b && c} becomes 642 1.1 mrg 643 1.1 mrg @smallexample 644 1.3 mrg T1 = (bool)b; 645 1.3 mrg if (T1 == true) 646 1.3 mrg T1 = (bool)c; 647 1.3 mrg a = T1; 648 1.1 mrg @end smallexample 649 1.1 mrg 650 1.1 mrg Note that @code{T1} in this example cannot be an expression temporary, 651 1.1 mrg because it has two different assignments. 652 1.1 mrg 653 1.1 mrg @subsection Manipulating operands 654 1.1 mrg 655 1.1 mrg All gimple operands are of type @code{tree}. But only certain 656 1.1 mrg types of trees are allowed to be used as operand tuples. Basic 657 1.1 mrg validation is controlled by the function 658 1.1 mrg @code{get_gimple_rhs_class}, which given a tree code, returns an 659 1.1 mrg @code{enum} with the following values of type @code{enum 660 1.1 mrg gimple_rhs_class} 661 1.1 mrg 662 1.1 mrg @itemize @bullet 663 1.1 mrg @item @code{GIMPLE_INVALID_RHS} 664 1.1 mrg The tree cannot be used as a GIMPLE operand. 665 1.1 mrg 666 1.3 mrg @item @code{GIMPLE_TERNARY_RHS} 667 1.3 mrg The tree is a valid GIMPLE ternary operation. 668 1.3 mrg 669 1.1 mrg @item @code{GIMPLE_BINARY_RHS} 670 1.1 mrg The tree is a valid GIMPLE binary operation. 671 1.1 mrg 672 1.1 mrg @item @code{GIMPLE_UNARY_RHS} 673 1.1 mrg The tree is a valid GIMPLE unary operation. 674 1.1 mrg 675 1.1 mrg @item @code{GIMPLE_SINGLE_RHS} 676 1.1 mrg The tree is a single object, that cannot be split into simpler 677 1.1 mrg operands (for instance, @code{SSA_NAME}, @code{VAR_DECL}, @code{COMPONENT_REF}, etc). 678 1.1 mrg 679 1.1 mrg This operand class also acts as an escape hatch for tree nodes 680 1.1 mrg that may be flattened out into the operand vector, but would need 681 1.1 mrg more than two slots on the RHS. For instance, a @code{COND_EXPR} 682 1.1 mrg expression of the form @code{(a op b) ? x : y} could be flattened 683 1.1 mrg out on the operand vector using 4 slots, but it would also 684 1.1 mrg require additional processing to distinguish @code{c = a op b} 685 1.1 mrg from @code{c = a op b ? x : y}. Something similar occurs with 686 1.1 mrg @code{ASSERT_EXPR}. In time, these special case tree 687 1.1 mrg expressions should be flattened into the operand vector. 688 1.1 mrg @end itemize 689 1.1 mrg 690 1.3 mrg For tree nodes in the categories @code{GIMPLE_TERNARY_RHS}, 691 1.3 mrg @code{GIMPLE_BINARY_RHS} and @code{GIMPLE_UNARY_RHS}, they cannot be 692 1.3 mrg stored inside tuples directly. They first need to be flattened and 693 1.3 mrg separated into individual components. For instance, given the GENERIC 694 1.3 mrg expression 695 1.1 mrg 696 1.1 mrg @smallexample 697 1.1 mrg a = b + c 698 1.1 mrg @end smallexample 699 1.1 mrg 700 1.1 mrg its tree representation is: 701 1.1 mrg 702 1.1 mrg @smallexample 703 1.1 mrg MODIFY_EXPR <VAR_DECL <a>, PLUS_EXPR <VAR_DECL <b>, VAR_DECL <c>>> 704 1.1 mrg @end smallexample 705 1.1 mrg 706 1.1 mrg In this case, the GIMPLE form for this statement is logically 707 1.1 mrg identical to its GENERIC form but in GIMPLE, the @code{PLUS_EXPR} 708 1.1 mrg on the RHS of the assignment is not represented as a tree, 709 1.1 mrg instead the two operands are taken out of the @code{PLUS_EXPR} sub-tree 710 1.1 mrg and flattened into the GIMPLE tuple as follows: 711 1.1 mrg 712 1.1 mrg @smallexample 713 1.1 mrg GIMPLE_ASSIGN <PLUS_EXPR, VAR_DECL <a>, VAR_DECL <b>, VAR_DECL <c>> 714 1.1 mrg @end smallexample 715 1.1 mrg 716 1.1 mrg @subsection Operand vector allocation 717 1.1 mrg 718 1.1 mrg The operand vector is stored at the bottom of the three tuple 719 1.1 mrg structures that accept operands. This means, that depending on 720 1.1 mrg the code of a given statement, its operand vector will be at 721 1.1 mrg different offsets from the base of the structure. To access 722 1.1 mrg tuple operands use the following accessors 723 1.1 mrg 724 1.1 mrg @deftypefn {GIMPLE function} unsigned gimple_num_ops (gimple g) 725 1.1 mrg Returns the number of operands in statement G. 726 1.1 mrg @end deftypefn 727 1.1 mrg 728 1.1 mrg @deftypefn {GIMPLE function} tree gimple_op (gimple g, unsigned i) 729 1.1 mrg Returns operand @code{I} from statement @code{G}. 730 1.1 mrg @end deftypefn 731 1.1 mrg 732 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_ops (gimple g) 733 1.1 mrg Returns a pointer into the operand vector for statement @code{G}. This 734 1.1 mrg is computed using an internal table called @code{gimple_ops_offset_}[]. 735 1.1 mrg This table is indexed by the gimple code of @code{G}. 736 1.1 mrg 737 1.1 mrg When the compiler is built, this table is filled-in using the 738 1.1 mrg sizes of the structures used by each statement code defined in 739 1.1 mrg gimple.def. Since the operand vector is at the bottom of the 740 1.1 mrg structure, for a gimple code @code{C} the offset is computed as sizeof 741 1.1 mrg (struct-of @code{C}) - sizeof (tree). 742 1.1 mrg 743 1.1 mrg This mechanism adds one memory indirection to every access when 744 1.1 mrg using @code{gimple_op}(), if this becomes a bottleneck, a pass can 745 1.1 mrg choose to memoize the result from @code{gimple_ops}() and use that to 746 1.1 mrg access the operands. 747 1.1 mrg @end deftypefn 748 1.1 mrg 749 1.1 mrg @subsection Operand validation 750 1.1 mrg 751 1.1 mrg When adding a new operand to a gimple statement, the operand will 752 1.1 mrg be validated according to what each tuple accepts in its operand 753 1.1 mrg vector. These predicates are called by the 754 1.3 mrg @code{gimple_@var{name}_set_...()}. Each tuple will use one of the 755 1.1 mrg following predicates (Note, this list is not exhaustive): 756 1.1 mrg 757 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_val (tree t) 758 1.1 mrg Returns true if t is a "GIMPLE value", which are all the 759 1.1 mrg non-addressable stack variables (variables for which 760 1.1 mrg @code{is_gimple_reg} returns true) and constants (expressions for which 761 1.1 mrg @code{is_gimple_min_invariant} returns true). 762 1.1 mrg @end deftypefn 763 1.1 mrg 764 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_addressable (tree t) 765 1.1 mrg Returns true if t is a symbol or memory reference whose address 766 1.1 mrg can be taken. 767 1.1 mrg @end deftypefn 768 1.1 mrg 769 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_asm_val (tree t) 770 1.1 mrg Similar to @code{is_gimple_val} but it also accepts hard registers. 771 1.1 mrg @end deftypefn 772 1.1 mrg 773 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_call_addr (tree t) 774 1.1 mrg Return true if t is a valid expression to use as the function 775 1.1 mrg called by a @code{GIMPLE_CALL}. 776 1.1 mrg @end deftypefn 777 1.1 mrg 778 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_mem_ref_addr (tree t) 779 1.3 mrg Return true if t is a valid expression to use as first operand 780 1.3 mrg of a @code{MEM_REF} expression. 781 1.3 mrg @end deftypefn 782 1.3 mrg 783 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_constant (tree t) 784 1.1 mrg Return true if t is a valid gimple constant. 785 1.1 mrg @end deftypefn 786 1.1 mrg 787 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_min_invariant (tree t) 788 1.1 mrg Return true if t is a valid minimal invariant. This is different 789 1.1 mrg from constants, in that the specific value of t may not be known 790 1.1 mrg at compile time, but it is known that it doesn't change (e.g., 791 1.1 mrg the address of a function local variable). 792 1.1 mrg @end deftypefn 793 1.1 mrg 794 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_ip_invariant (tree t) 795 1.1 mrg Return true if t is an interprocedural invariant. This means that t 796 1.10 mrg is a valid invariant in all functions (e.g.@: it can be an address of a 797 1.1 mrg global variable but not of a local one). 798 1.1 mrg @end deftypefn 799 1.1 mrg 800 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_ip_invariant_address (tree t) 801 1.1 mrg Return true if t is an @code{ADDR_EXPR} that does not change once the 802 1.1 mrg program is running (and which is valid in all functions). 803 1.1 mrg @end deftypefn 804 1.1 mrg 805 1.1 mrg 806 1.1 mrg @subsection Statement validation 807 1.1 mrg 808 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_assign (gimple g) 809 1.1 mrg Return true if the code of g is @code{GIMPLE_ASSIGN}. 810 1.1 mrg @end deftypefn 811 1.3 mrg 812 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_call (gimple g) 813 1.1 mrg Return true if the code of g is @code{GIMPLE_CALL}. 814 1.1 mrg @end deftypefn 815 1.3 mrg 816 1.3 mrg @deftypefn {GIMPLE function} bool is_gimple_debug (gimple g) 817 1.1 mrg Return true if the code of g is @code{GIMPLE_DEBUG}. 818 1.1 mrg @end deftypefn 819 1.1 mrg 820 1.5 mrg @deftypefn {GIMPLE function} bool gimple_assign_cast_p (const_gimple g) 821 1.1 mrg Return true if g is a @code{GIMPLE_ASSIGN} that performs a type cast 822 1.1 mrg operation. 823 1.1 mrg @end deftypefn 824 1.1 mrg 825 1.3 mrg @deftypefn {GIMPLE function} bool gimple_debug_bind_p (gimple g) 826 1.1 mrg Return true if g is a @code{GIMPLE_DEBUG} that binds the value of an 827 1.1 mrg expression to a variable. 828 1.1 mrg @end deftypefn 829 1.1 mrg 830 1.5 mrg @deftypefn {GIMPLE function} bool is_gimple_omp (gimple g) 831 1.5 mrg Return true if g is any of the OpenMP codes. 832 1.5 mrg @end deftypefn 833 1.5 mrg 834 1.12 mrg @deftypefn {GIMPLE function} bool gimple_debug_begin_stmt_p (gimple g) 835 1.9 mrg Return true if g is a @code{GIMPLE_DEBUG} that marks the beginning of 836 1.9 mrg a source statement. 837 1.9 mrg @end deftypefn 838 1.9 mrg 839 1.12 mrg @deftypefn {GIMPLE function} bool gimple_debug_inline_entry_p (gimple g) 840 1.9 mrg Return true if g is a @code{GIMPLE_DEBUG} that marks the entry 841 1.9 mrg point of an inlined function. 842 1.9 mrg @end deftypefn 843 1.9 mrg 844 1.12 mrg @deftypefn {GIMPLE function} bool gimple_debug_nonbind_marker_p (gimple g) 845 1.9 mrg Return true if g is a @code{GIMPLE_DEBUG} that marks a program location, 846 1.9 mrg without any variable binding. 847 1.9 mrg @end deftypefn 848 1.9 mrg 849 1.1 mrg @node Manipulating GIMPLE statements 850 1.1 mrg @section Manipulating GIMPLE statements 851 1.1 mrg @cindex Manipulating GIMPLE statements 852 1.1 mrg 853 1.1 mrg This section documents all the functions available to handle each 854 1.1 mrg of the GIMPLE instructions. 855 1.1 mrg 856 1.3 mrg @subsection Common accessors 857 1.1 mrg The following are common accessors for gimple statements. 858 1.1 mrg 859 1.3 mrg @deftypefn {GIMPLE function} {enum gimple_code} gimple_code (gimple g) 860 1.1 mrg Return the code for statement @code{G}. 861 1.1 mrg @end deftypefn 862 1.3 mrg 863 1.1 mrg @deftypefn {GIMPLE function} basic_block gimple_bb (gimple g) 864 1.1 mrg Return the basic block to which statement @code{G} belongs to. 865 1.1 mrg @end deftypefn 866 1.3 mrg 867 1.1 mrg @deftypefn {GIMPLE function} tree gimple_block (gimple g) 868 1.1 mrg Return the lexical scope block holding statement @code{G}. 869 1.1 mrg @end deftypefn 870 1.3 mrg 871 1.3 mrg @deftypefn {GIMPLE function} {enum tree_code} gimple_expr_code (gimple stmt) 872 1.1 mrg Return the tree code for the expression computed by @code{STMT}. This 873 1.1 mrg is only meaningful for @code{GIMPLE_CALL}, @code{GIMPLE_ASSIGN} and 874 1.1 mrg @code{GIMPLE_COND}. If @code{STMT} is @code{GIMPLE_CALL}, it will return @code{CALL_EXPR}. 875 1.1 mrg For @code{GIMPLE_COND}, it returns the code of the comparison predicate. 876 1.1 mrg For @code{GIMPLE_ASSIGN} it returns the code of the operation performed 877 1.1 mrg by the @code{RHS} of the assignment. 878 1.1 mrg @end deftypefn 879 1.1 mrg 880 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_block (gimple g, tree block) 881 1.1 mrg Set the lexical scope block of @code{G} to @code{BLOCK}. 882 1.1 mrg @end deftypefn 883 1.3 mrg 884 1.1 mrg @deftypefn {GIMPLE function} location_t gimple_locus (gimple g) 885 1.1 mrg Return locus information for statement @code{G}. 886 1.1 mrg @end deftypefn 887 1.3 mrg 888 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_locus (gimple g, location_t locus) 889 1.1 mrg Set locus information for statement @code{G}. 890 1.1 mrg @end deftypefn 891 1.3 mrg 892 1.1 mrg @deftypefn {GIMPLE function} bool gimple_locus_empty_p (gimple g) 893 1.1 mrg Return true if @code{G} does not have locus information. 894 1.1 mrg @end deftypefn 895 1.3 mrg 896 1.1 mrg @deftypefn {GIMPLE function} bool gimple_no_warning_p (gimple stmt) 897 1.1 mrg Return true if no warnings should be emitted for statement @code{STMT}. 898 1.1 mrg @end deftypefn 899 1.3 mrg 900 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_visited (gimple stmt, bool visited_p) 901 1.1 mrg Set the visited status on statement @code{STMT} to @code{VISITED_P}. 902 1.1 mrg @end deftypefn 903 1.3 mrg 904 1.1 mrg @deftypefn {GIMPLE function} bool gimple_visited_p (gimple stmt) 905 1.1 mrg Return the visited status on statement @code{STMT}. 906 1.1 mrg @end deftypefn 907 1.3 mrg 908 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p) 909 1.1 mrg Set pass local flag @code{PLF} on statement @code{STMT} to @code{VAL_P}. 910 1.1 mrg @end deftypefn 911 1.3 mrg 912 1.3 mrg @deftypefn {GIMPLE function} {unsigned int} gimple_plf (gimple stmt, enum plf_mask plf) 913 1.1 mrg Return the value of pass local flag @code{PLF} on statement @code{STMT}. 914 1.1 mrg @end deftypefn 915 1.3 mrg 916 1.1 mrg @deftypefn {GIMPLE function} bool gimple_has_ops (gimple g) 917 1.1 mrg Return true if statement @code{G} has register or memory operands. 918 1.1 mrg @end deftypefn 919 1.3 mrg 920 1.1 mrg @deftypefn {GIMPLE function} bool gimple_has_mem_ops (gimple g) 921 1.1 mrg Return true if statement @code{G} has memory operands. 922 1.1 mrg @end deftypefn 923 1.3 mrg 924 1.1 mrg @deftypefn {GIMPLE function} unsigned gimple_num_ops (gimple g) 925 1.1 mrg Return the number of operands for statement @code{G}. 926 1.1 mrg @end deftypefn 927 1.3 mrg 928 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_ops (gimple g) 929 1.1 mrg Return the array of operands for statement @code{G}. 930 1.1 mrg @end deftypefn 931 1.3 mrg 932 1.1 mrg @deftypefn {GIMPLE function} tree gimple_op (gimple g, unsigned i) 933 1.1 mrg Return operand @code{I} for statement @code{G}. 934 1.1 mrg @end deftypefn 935 1.3 mrg 936 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_op_ptr (gimple g, unsigned i) 937 1.1 mrg Return a pointer to operand @code{I} for statement @code{G}. 938 1.1 mrg @end deftypefn 939 1.3 mrg 940 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_op (gimple g, unsigned i, tree op) 941 1.1 mrg Set operand @code{I} of statement @code{G} to @code{OP}. 942 1.1 mrg @end deftypefn 943 1.3 mrg 944 1.1 mrg @deftypefn {GIMPLE function} bitmap gimple_addresses_taken (gimple stmt) 945 1.1 mrg Return the set of symbols that have had their address taken by 946 1.1 mrg @code{STMT}. 947 1.1 mrg @end deftypefn 948 1.3 mrg 949 1.3 mrg @deftypefn {GIMPLE function} {struct def_optype_d *} gimple_def_ops (gimple g) 950 1.1 mrg Return the set of @code{DEF} operands for statement @code{G}. 951 1.1 mrg @end deftypefn 952 1.3 mrg 953 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_def_ops (gimple g, struct def_optype_d *def) 954 1.1 mrg Set @code{DEF} to be the set of @code{DEF} operands for statement @code{G}. 955 1.1 mrg @end deftypefn 956 1.3 mrg 957 1.3 mrg @deftypefn {GIMPLE function} {struct use_optype_d *} gimple_use_ops (gimple g) 958 1.1 mrg Return the set of @code{USE} operands for statement @code{G}. 959 1.1 mrg @end deftypefn 960 1.3 mrg 961 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_use_ops (gimple g, struct use_optype_d *use) 962 1.1 mrg Set @code{USE} to be the set of @code{USE} operands for statement @code{G}. 963 1.1 mrg @end deftypefn 964 1.3 mrg 965 1.3 mrg @deftypefn {GIMPLE function} {struct voptype_d *} gimple_vuse_ops (gimple g) 966 1.1 mrg Return the set of @code{VUSE} operands for statement @code{G}. 967 1.1 mrg @end deftypefn 968 1.3 mrg 969 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_vuse_ops (gimple g, struct voptype_d *ops) 970 1.1 mrg Set @code{OPS} to be the set of @code{VUSE} operands for statement @code{G}. 971 1.1 mrg @end deftypefn 972 1.3 mrg 973 1.3 mrg @deftypefn {GIMPLE function} {struct voptype_d *} gimple_vdef_ops (gimple g) 974 1.1 mrg Return the set of @code{VDEF} operands for statement @code{G}. 975 1.1 mrg @end deftypefn 976 1.3 mrg 977 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_vdef_ops (gimple g, struct voptype_d *ops) 978 1.1 mrg Set @code{OPS} to be the set of @code{VDEF} operands for statement @code{G}. 979 1.1 mrg @end deftypefn 980 1.3 mrg 981 1.1 mrg @deftypefn {GIMPLE function} bitmap gimple_loaded_syms (gimple g) 982 1.1 mrg Return the set of symbols loaded by statement @code{G}. Each element of 983 1.1 mrg the set is the @code{DECL_UID} of the corresponding symbol. 984 1.1 mrg @end deftypefn 985 1.3 mrg 986 1.1 mrg @deftypefn {GIMPLE function} bitmap gimple_stored_syms (gimple g) 987 1.1 mrg Return the set of symbols stored by statement @code{G}. Each element of 988 1.1 mrg the set is the @code{DECL_UID} of the corresponding symbol. 989 1.1 mrg @end deftypefn 990 1.3 mrg 991 1.1 mrg @deftypefn {GIMPLE function} bool gimple_modified_p (gimple g) 992 1.1 mrg Return true if statement @code{G} has operands and the modified field 993 1.1 mrg has been set. 994 1.1 mrg @end deftypefn 995 1.3 mrg 996 1.1 mrg @deftypefn {GIMPLE function} bool gimple_has_volatile_ops (gimple stmt) 997 1.1 mrg Return true if statement @code{STMT} contains volatile operands. 998 1.1 mrg @end deftypefn 999 1.3 mrg 1000 1.1 mrg @deftypefn {GIMPLE function} void gimple_set_has_volatile_ops (gimple stmt, bool volatilep) 1001 1.1 mrg Return true if statement @code{STMT} contains volatile operands. 1002 1.1 mrg @end deftypefn 1003 1.3 mrg 1004 1.1 mrg @deftypefn {GIMPLE function} void update_stmt (gimple s) 1005 1.1 mrg Mark statement @code{S} as modified, and update it. 1006 1.1 mrg @end deftypefn 1007 1.3 mrg 1008 1.1 mrg @deftypefn {GIMPLE function} void update_stmt_if_modified (gimple s) 1009 1.1 mrg Update statement @code{S} if it has been marked modified. 1010 1.1 mrg @end deftypefn 1011 1.3 mrg 1012 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_copy (gimple stmt) 1013 1.1 mrg Return a deep copy of statement @code{STMT}. 1014 1.1 mrg @end deftypefn 1015 1.1 mrg 1016 1.1 mrg @node Tuple specific accessors 1017 1.1 mrg @section Tuple specific accessors 1018 1.1 mrg @cindex Tuple specific accessors 1019 1.1 mrg 1020 1.1 mrg @menu 1021 1.1 mrg * @code{GIMPLE_ASM}:: 1022 1.1 mrg * @code{GIMPLE_ASSIGN}:: 1023 1.1 mrg * @code{GIMPLE_BIND}:: 1024 1.1 mrg * @code{GIMPLE_CALL}:: 1025 1.1 mrg * @code{GIMPLE_CATCH}:: 1026 1.1 mrg * @code{GIMPLE_COND}:: 1027 1.1 mrg * @code{GIMPLE_DEBUG}:: 1028 1.1 mrg * @code{GIMPLE_EH_FILTER}:: 1029 1.1 mrg * @code{GIMPLE_LABEL}:: 1030 1.5 mrg * @code{GIMPLE_GOTO}:: 1031 1.1 mrg * @code{GIMPLE_NOP}:: 1032 1.1 mrg * @code{GIMPLE_OMP_ATOMIC_LOAD}:: 1033 1.1 mrg * @code{GIMPLE_OMP_ATOMIC_STORE}:: 1034 1.1 mrg * @code{GIMPLE_OMP_CONTINUE}:: 1035 1.1 mrg * @code{GIMPLE_OMP_CRITICAL}:: 1036 1.1 mrg * @code{GIMPLE_OMP_FOR}:: 1037 1.1 mrg * @code{GIMPLE_OMP_MASTER}:: 1038 1.1 mrg * @code{GIMPLE_OMP_ORDERED}:: 1039 1.1 mrg * @code{GIMPLE_OMP_PARALLEL}:: 1040 1.1 mrg * @code{GIMPLE_OMP_RETURN}:: 1041 1.1 mrg * @code{GIMPLE_OMP_SECTION}:: 1042 1.1 mrg * @code{GIMPLE_OMP_SECTIONS}:: 1043 1.1 mrg * @code{GIMPLE_OMP_SINGLE}:: 1044 1.1 mrg * @code{GIMPLE_PHI}:: 1045 1.1 mrg * @code{GIMPLE_RESX}:: 1046 1.1 mrg * @code{GIMPLE_RETURN}:: 1047 1.1 mrg * @code{GIMPLE_SWITCH}:: 1048 1.1 mrg * @code{GIMPLE_TRY}:: 1049 1.1 mrg * @code{GIMPLE_WITH_CLEANUP_EXPR}:: 1050 1.1 mrg @end menu 1051 1.1 mrg 1052 1.1 mrg 1053 1.1 mrg @node @code{GIMPLE_ASM} 1054 1.1 mrg @subsection @code{GIMPLE_ASM} 1055 1.1 mrg @cindex @code{GIMPLE_ASM} 1056 1.1 mrg 1057 1.5 mrg @deftypefn {GIMPLE function} gasm *gimple_build_asm_vec ( @ 1058 1.5 mrg const char *string, vec<tree, va_gc> *inputs, @ 1059 1.5 mrg vec<tree, va_gc> *outputs, vec<tree, va_gc> *clobbers, @ 1060 1.5 mrg vec<tree, va_gc> *labels) 1061 1.1 mrg Build a @code{GIMPLE_ASM} statement. This statement is used for 1062 1.1 mrg building in-line assembly constructs. @code{STRING} is the assembly 1063 1.5 mrg code. @code{INPUTS}, @code{OUTPUTS}, @code{CLOBBERS} and @code{LABELS} 1064 1.5 mrg are the inputs, outputs, clobbered registers and labels. 1065 1.1 mrg @end deftypefn 1066 1.1 mrg 1067 1.5 mrg @deftypefn {GIMPLE function} unsigned gimple_asm_ninputs (const gasm *g) 1068 1.3 mrg Return the number of input operands for @code{GIMPLE_ASM} @code{G}. 1069 1.1 mrg @end deftypefn 1070 1.1 mrg 1071 1.5 mrg @deftypefn {GIMPLE function} unsigned gimple_asm_noutputs (const gasm *g) 1072 1.3 mrg Return the number of output operands for @code{GIMPLE_ASM} @code{G}. 1073 1.1 mrg @end deftypefn 1074 1.1 mrg 1075 1.5 mrg @deftypefn {GIMPLE function} unsigned gimple_asm_nclobbers (const gasm *g) 1076 1.3 mrg Return the number of clobber operands for @code{GIMPLE_ASM} @code{G}. 1077 1.1 mrg @end deftypefn 1078 1.1 mrg 1079 1.5 mrg @deftypefn {GIMPLE function} tree gimple_asm_input_op (const gasm *g, @ 1080 1.5 mrg unsigned index) 1081 1.3 mrg Return input operand @code{INDEX} of @code{GIMPLE_ASM} @code{G}. 1082 1.1 mrg @end deftypefn 1083 1.1 mrg 1084 1.5 mrg @deftypefn {GIMPLE function} void gimple_asm_set_input_op (gasm *g, @ 1085 1.5 mrg unsigned index, tree in_op) 1086 1.3 mrg Set @code{IN_OP} to be input operand @code{INDEX} in @code{GIMPLE_ASM} @code{G}. 1087 1.1 mrg @end deftypefn 1088 1.1 mrg 1089 1.5 mrg @deftypefn {GIMPLE function} tree gimple_asm_output_op (const gasm *g, @ 1090 1.5 mrg unsigned index) 1091 1.3 mrg Return output operand @code{INDEX} of @code{GIMPLE_ASM} @code{G}. 1092 1.1 mrg @end deftypefn 1093 1.1 mrg 1094 1.5 mrg @deftypefn {GIMPLE function} void gimple_asm_set_output_op (gasm *g, @ 1095 1.1 mrg unsigned index, tree out_op) 1096 1.3 mrg Set @code{OUT_OP} to be output operand @code{INDEX} in @code{GIMPLE_ASM} @code{G}. 1097 1.1 mrg @end deftypefn 1098 1.1 mrg 1099 1.5 mrg @deftypefn {GIMPLE function} tree gimple_asm_clobber_op (const gasm *g, @ 1100 1.5 mrg unsigned index) 1101 1.3 mrg Return clobber operand @code{INDEX} of @code{GIMPLE_ASM} @code{G}. 1102 1.1 mrg @end deftypefn 1103 1.1 mrg 1104 1.5 mrg @deftypefn {GIMPLE function} void gimple_asm_set_clobber_op (gasm *g, @ 1105 1.5 mrg unsigned index, tree clobber_op) 1106 1.3 mrg Set @code{CLOBBER_OP} to be clobber operand @code{INDEX} in @code{GIMPLE_ASM} @code{G}. 1107 1.1 mrg @end deftypefn 1108 1.1 mrg 1109 1.5 mrg @deftypefn {GIMPLE function} {const char *} gimple_asm_string (const gasm *g) 1110 1.1 mrg Return the string representing the assembly instruction in 1111 1.3 mrg @code{GIMPLE_ASM} @code{G}. 1112 1.1 mrg @end deftypefn 1113 1.1 mrg 1114 1.5 mrg @deftypefn {GIMPLE function} bool gimple_asm_volatile_p (const gasm *g) 1115 1.3 mrg Return true if @code{G} is an asm statement marked volatile. 1116 1.1 mrg @end deftypefn 1117 1.1 mrg 1118 1.5 mrg @deftypefn {GIMPLE function} void gimple_asm_set_volatile (gasm *g, @ 1119 1.5 mrg bool volatile_p) 1120 1.5 mrg Mark asm statement @code{G} as volatile or non-volatile based on 1121 1.5 mrg @code{VOLATILE_P}. 1122 1.1 mrg @end deftypefn 1123 1.1 mrg 1124 1.1 mrg @node @code{GIMPLE_ASSIGN} 1125 1.1 mrg @subsection @code{GIMPLE_ASSIGN} 1126 1.1 mrg @cindex @code{GIMPLE_ASSIGN} 1127 1.1 mrg 1128 1.5 mrg @deftypefn {GIMPLE function} gassign *gimple_build_assign (tree lhs, tree rhs) 1129 1.1 mrg Build a @code{GIMPLE_ASSIGN} statement. The left-hand side is an lvalue 1130 1.1 mrg passed in lhs. The right-hand side can be either a unary or 1131 1.1 mrg binary tree expression. The expression tree rhs will be 1132 1.1 mrg flattened and its operands assigned to the corresponding operand 1133 1.1 mrg slots in the new statement. This function is useful when you 1134 1.1 mrg already have a tree expression that you want to convert into a 1135 1.1 mrg tuple. However, try to avoid building expression trees for the 1136 1.1 mrg sole purpose of calling this function. If you already have the 1137 1.1 mrg operands in separate trees, it is better to use 1138 1.5 mrg @code{gimple_build_assign} with @code{enum tree_code} argument and separate 1139 1.5 mrg arguments for each operand. 1140 1.1 mrg @end deftypefn 1141 1.1 mrg 1142 1.5 mrg @deftypefn {GIMPLE function} gassign *gimple_build_assign @ 1143 1.5 mrg (tree lhs, enum tree_code subcode, tree op1, tree op2, tree op3) 1144 1.5 mrg This function is similar to two operand @code{gimple_build_assign}, 1145 1.5 mrg but is used to build a @code{GIMPLE_ASSIGN} statement when the operands of the 1146 1.5 mrg right-hand side of the assignment are already split into 1147 1.5 mrg different operands. 1148 1.5 mrg 1149 1.5 mrg The left-hand side is an lvalue passed in lhs. Subcode is the 1150 1.5 mrg @code{tree_code} for the right-hand side of the assignment. Op1, op2 and op3 1151 1.5 mrg are the operands. 1152 1.5 mrg @end deftypefn 1153 1.5 mrg 1154 1.5 mrg @deftypefn {GIMPLE function} gassign *gimple_build_assign @ 1155 1.5 mrg (tree lhs, enum tree_code subcode, tree op1, tree op2) 1156 1.5 mrg Like the above 5 operand @code{gimple_build_assign}, but with the last 1157 1.5 mrg argument @code{NULL} - this overload should not be used for 1158 1.5 mrg @code{GIMPLE_TERNARY_RHS} assignments. 1159 1.5 mrg @end deftypefn 1160 1.5 mrg 1161 1.5 mrg @deftypefn {GIMPLE function} gassign *gimple_build_assign @ 1162 1.5 mrg (tree lhs, enum tree_code subcode, tree op1) 1163 1.5 mrg Like the above 4 operand @code{gimple_build_assign}, but with the last 1164 1.5 mrg argument @code{NULL} - this overload should be used only for 1165 1.5 mrg @code{GIMPLE_UNARY_RHS} and @code{GIMPLE_SINGLE_RHS} assignments. 1166 1.5 mrg @end deftypefn 1167 1.1 mrg 1168 1.1 mrg @deftypefn {GIMPLE function} gimple gimplify_assign (tree dst, tree src, gimple_seq *seq_p) 1169 1.1 mrg Build a new @code{GIMPLE_ASSIGN} tuple and append it to the end of 1170 1.1 mrg @code{*SEQ_P}. 1171 1.1 mrg @end deftypefn 1172 1.1 mrg 1173 1.1 mrg @code{DST}/@code{SRC} are the destination and source respectively. You can 1174 1.1 mrg pass ungimplified trees in @code{DST} or @code{SRC}, in which 1175 1.1 mrg case they will be converted to a gimple operand if necessary. 1176 1.1 mrg 1177 1.1 mrg This function returns the newly created @code{GIMPLE_ASSIGN} tuple. 1178 1.1 mrg 1179 1.3 mrg @deftypefn {GIMPLE function} {enum tree_code} gimple_assign_rhs_code (gimple g) 1180 1.1 mrg Return the code of the expression computed on the @code{RHS} of 1181 1.1 mrg assignment statement @code{G}. 1182 1.1 mrg @end deftypefn 1183 1.1 mrg 1184 1.3 mrg 1185 1.3 mrg @deftypefn {GIMPLE function} {enum gimple_rhs_class} gimple_assign_rhs_class (gimple g) 1186 1.1 mrg Return the gimple rhs class of the code for the expression 1187 1.1 mrg computed on the rhs of assignment statement @code{G}. This will never 1188 1.1 mrg return @code{GIMPLE_INVALID_RHS}. 1189 1.1 mrg @end deftypefn 1190 1.1 mrg 1191 1.1 mrg @deftypefn {GIMPLE function} tree gimple_assign_lhs (gimple g) 1192 1.1 mrg Return the @code{LHS} of assignment statement @code{G}. 1193 1.1 mrg @end deftypefn 1194 1.3 mrg 1195 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_assign_lhs_ptr (gimple g) 1196 1.1 mrg Return a pointer to the @code{LHS} of assignment statement @code{G}. 1197 1.1 mrg @end deftypefn 1198 1.3 mrg 1199 1.1 mrg @deftypefn {GIMPLE function} tree gimple_assign_rhs1 (gimple g) 1200 1.1 mrg Return the first operand on the @code{RHS} of assignment statement @code{G}. 1201 1.1 mrg @end deftypefn 1202 1.3 mrg 1203 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_assign_rhs1_ptr (gimple g) 1204 1.1 mrg Return the address of the first operand on the @code{RHS} of assignment 1205 1.1 mrg statement @code{G}. 1206 1.1 mrg @end deftypefn 1207 1.3 mrg 1208 1.1 mrg @deftypefn {GIMPLE function} tree gimple_assign_rhs2 (gimple g) 1209 1.1 mrg Return the second operand on the @code{RHS} of assignment statement @code{G}. 1210 1.1 mrg @end deftypefn 1211 1.3 mrg 1212 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_assign_rhs2_ptr (gimple g) 1213 1.1 mrg Return the address of the second operand on the @code{RHS} of assignment 1214 1.1 mrg statement @code{G}. 1215 1.1 mrg @end deftypefn 1216 1.3 mrg 1217 1.3 mrg @deftypefn {GIMPLE function} tree gimple_assign_rhs3 (gimple g) 1218 1.3 mrg Return the third operand on the @code{RHS} of assignment statement @code{G}. 1219 1.3 mrg @end deftypefn 1220 1.3 mrg 1221 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_assign_rhs3_ptr (gimple g) 1222 1.3 mrg Return the address of the third operand on the @code{RHS} of assignment 1223 1.3 mrg statement @code{G}. 1224 1.3 mrg @end deftypefn 1225 1.3 mrg 1226 1.1 mrg @deftypefn {GIMPLE function} void gimple_assign_set_lhs (gimple g, tree lhs) 1227 1.1 mrg Set @code{LHS} to be the @code{LHS} operand of assignment statement @code{G}. 1228 1.1 mrg @end deftypefn 1229 1.3 mrg 1230 1.1 mrg @deftypefn {GIMPLE function} void gimple_assign_set_rhs1 (gimple g, tree rhs) 1231 1.1 mrg Set @code{RHS} to be the first operand on the @code{RHS} of assignment 1232 1.1 mrg statement @code{G}. 1233 1.1 mrg @end deftypefn 1234 1.3 mrg 1235 1.3 mrg @deftypefn {GIMPLE function} void gimple_assign_set_rhs2 (gimple g, tree rhs) 1236 1.3 mrg Set @code{RHS} to be the second operand on the @code{RHS} of assignment 1237 1.1 mrg statement @code{G}. 1238 1.1 mrg @end deftypefn 1239 1.3 mrg 1240 1.3 mrg @deftypefn {GIMPLE function} void gimple_assign_set_rhs3 (gimple g, tree rhs) 1241 1.3 mrg Set @code{RHS} to be the third operand on the @code{RHS} of assignment 1242 1.1 mrg statement @code{G}. 1243 1.1 mrg @end deftypefn 1244 1.3 mrg 1245 1.5 mrg @deftypefn {GIMPLE function} bool gimple_assign_cast_p (const_gimple s) 1246 1.1 mrg Return true if @code{S} is a type-cast assignment. 1247 1.1 mrg @end deftypefn 1248 1.1 mrg 1249 1.1 mrg 1250 1.1 mrg @node @code{GIMPLE_BIND} 1251 1.1 mrg @subsection @code{GIMPLE_BIND} 1252 1.1 mrg @cindex @code{GIMPLE_BIND} 1253 1.1 mrg 1254 1.5 mrg @deftypefn {GIMPLE function} gbind *gimple_build_bind (tree vars, @ 1255 1.5 mrg gimple_seq body) 1256 1.1 mrg Build a @code{GIMPLE_BIND} statement with a list of variables in @code{VARS} 1257 1.1 mrg and a body of statements in sequence @code{BODY}. 1258 1.1 mrg @end deftypefn 1259 1.1 mrg 1260 1.5 mrg @deftypefn {GIMPLE function} tree gimple_bind_vars (const gbind *g) 1261 1.3 mrg Return the variables declared in the @code{GIMPLE_BIND} statement @code{G}. 1262 1.1 mrg @end deftypefn 1263 1.1 mrg 1264 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_set_vars (gbind *g, tree vars) 1265 1.1 mrg Set @code{VARS} to be the set of variables declared in the @code{GIMPLE_BIND} 1266 1.3 mrg statement @code{G}. 1267 1.1 mrg @end deftypefn 1268 1.1 mrg 1269 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_append_vars (gbind *g, tree vars) 1270 1.1 mrg Append @code{VARS} to the set of variables declared in the @code{GIMPLE_BIND} 1271 1.1 mrg statement @code{G}. 1272 1.1 mrg @end deftypefn 1273 1.1 mrg 1274 1.5 mrg @deftypefn {GIMPLE function} gimple_seq gimple_bind_body (gbind *g) 1275 1.1 mrg Return the GIMPLE sequence contained in the @code{GIMPLE_BIND} statement 1276 1.3 mrg @code{G}. 1277 1.1 mrg @end deftypefn 1278 1.1 mrg 1279 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_set_body (gbind *g, @ 1280 1.5 mrg gimple_seq seq) 1281 1.1 mrg Set @code{SEQ} to be sequence contained in the @code{GIMPLE_BIND} statement @code{G}. 1282 1.1 mrg @end deftypefn 1283 1.1 mrg 1284 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_add_stmt (gbind *gs, gimple stmt) 1285 1.3 mrg Append a statement to the end of a @code{GIMPLE_BIND}'s body. 1286 1.1 mrg @end deftypefn 1287 1.1 mrg 1288 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_add_seq (gbind *gs, @ 1289 1.5 mrg gimple_seq seq) 1290 1.1 mrg Append a sequence of statements to the end of a @code{GIMPLE_BIND}'s 1291 1.1 mrg body. 1292 1.1 mrg @end deftypefn 1293 1.1 mrg 1294 1.5 mrg @deftypefn {GIMPLE function} tree gimple_bind_block (const gbind *g) 1295 1.1 mrg Return the @code{TREE_BLOCK} node associated with @code{GIMPLE_BIND} statement 1296 1.3 mrg @code{G}. This is analogous to the @code{BIND_EXPR_BLOCK} field in trees. 1297 1.1 mrg @end deftypefn 1298 1.1 mrg 1299 1.5 mrg @deftypefn {GIMPLE function} void gimple_bind_set_block (gbind *g, tree block) 1300 1.1 mrg Set @code{BLOCK} to be the @code{TREE_BLOCK} node associated with @code{GIMPLE_BIND} 1301 1.3 mrg statement @code{G}. 1302 1.1 mrg @end deftypefn 1303 1.1 mrg 1304 1.1 mrg 1305 1.1 mrg @node @code{GIMPLE_CALL} 1306 1.1 mrg @subsection @code{GIMPLE_CALL} 1307 1.1 mrg @cindex @code{GIMPLE_CALL} 1308 1.1 mrg 1309 1.5 mrg @deftypefn {GIMPLE function} gcall *gimple_build_call (tree fn, @ 1310 1.5 mrg unsigned nargs, ...) 1311 1.1 mrg Build a @code{GIMPLE_CALL} statement to function @code{FN}. The argument @code{FN} 1312 1.1 mrg must be either a @code{FUNCTION_DECL} or a gimple call address as 1313 1.1 mrg determined by @code{is_gimple_call_addr}. @code{NARGS} are the number of 1314 1.1 mrg arguments. The rest of the arguments follow the argument @code{NARGS}, 1315 1.1 mrg and must be trees that are valid as rvalues in gimple (i.e., each 1316 1.1 mrg operand is validated with @code{is_gimple_operand}). 1317 1.1 mrg @end deftypefn 1318 1.1 mrg 1319 1.1 mrg 1320 1.9 mrg @deftypefn {GIMPLE function} gcall *gimple_build_call_from_tree (tree call_expr, @ 1321 1.9 mrg tree fnptrtype) 1322 1.9 mrg Build a @code{GIMPLE_CALL} from a @code{CALL_EXPR} node. The arguments 1323 1.9 mrg and the function are taken from the expression directly. The type of the 1324 1.9 mrg @code{GIMPLE_CALL} is set from the second parameter passed by a caller. 1325 1.9 mrg This routine assumes that @code{call_expr} is already in GIMPLE form. 1326 1.9 mrg That is, its operands are GIMPLE values and the function call needs no further 1327 1.1 mrg simplification. All the call flags in @code{call_expr} are copied over 1328 1.1 mrg to the new @code{GIMPLE_CALL}. 1329 1.1 mrg @end deftypefn 1330 1.1 mrg 1331 1.5 mrg @deftypefn {GIMPLE function} gcall *gimple_build_call_vec (tree fn, @ 1332 1.5 mrg @code{vec<tree>} args) 1333 1.1 mrg Identical to @code{gimple_build_call} but the arguments are stored in a 1334 1.5 mrg @code{vec<tree>}. 1335 1.1 mrg @end deftypefn 1336 1.1 mrg 1337 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_lhs (gimple g) 1338 1.1 mrg Return the @code{LHS} of call statement @code{G}. 1339 1.1 mrg @end deftypefn 1340 1.3 mrg 1341 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_call_lhs_ptr (gimple g) 1342 1.1 mrg Return a pointer to the @code{LHS} of call statement @code{G}. 1343 1.1 mrg @end deftypefn 1344 1.3 mrg 1345 1.1 mrg @deftypefn {GIMPLE function} void gimple_call_set_lhs (gimple g, tree lhs) 1346 1.1 mrg Set @code{LHS} to be the @code{LHS} operand of call statement @code{G}. 1347 1.1 mrg @end deftypefn 1348 1.3 mrg 1349 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_fn (gimple g) 1350 1.1 mrg Return the tree node representing the function called by call 1351 1.1 mrg statement @code{G}. 1352 1.1 mrg @end deftypefn 1353 1.3 mrg 1354 1.5 mrg @deftypefn {GIMPLE function} void gimple_call_set_fn (gcall *g, tree fn) 1355 1.1 mrg Set @code{FN} to be the function called by call statement @code{G}. This has 1356 1.1 mrg to be a gimple value specifying the address of the called 1357 1.1 mrg function. 1358 1.1 mrg @end deftypefn 1359 1.3 mrg 1360 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_fndecl (gimple g) 1361 1.1 mrg If a given @code{GIMPLE_CALL}'s callee is a @code{FUNCTION_DECL}, return it. 1362 1.1 mrg Otherwise return @code{NULL}. This function is analogous to 1363 1.1 mrg @code{get_callee_fndecl} in @code{GENERIC}. 1364 1.1 mrg @end deftypefn 1365 1.3 mrg 1366 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_set_fndecl (gimple g, tree fndecl) 1367 1.1 mrg Set the called function to @code{FNDECL}. 1368 1.1 mrg @end deftypefn 1369 1.1 mrg 1370 1.5 mrg @deftypefn {GIMPLE function} tree gimple_call_return_type (const gcall *g) 1371 1.1 mrg Return the type returned by call statement @code{G}. 1372 1.1 mrg @end deftypefn 1373 1.3 mrg 1374 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_chain (gimple g) 1375 1.3 mrg Return the static chain for call statement @code{G}. 1376 1.1 mrg @end deftypefn 1377 1.1 mrg 1378 1.5 mrg @deftypefn {GIMPLE function} void gimple_call_set_chain (gcall *g, tree chain) 1379 1.3 mrg Set @code{CHAIN} to be the static chain for call statement @code{G}. 1380 1.1 mrg @end deftypefn 1381 1.1 mrg 1382 1.3 mrg @deftypefn {GIMPLE function} unsigned gimple_call_num_args (gimple g) 1383 1.3 mrg Return the number of arguments used by call statement @code{G}. 1384 1.1 mrg @end deftypefn 1385 1.1 mrg 1386 1.1 mrg @deftypefn {GIMPLE function} tree gimple_call_arg (gimple g, unsigned index) 1387 1.1 mrg Return the argument at position @code{INDEX} for call statement @code{G}. The 1388 1.1 mrg first argument is 0. 1389 1.1 mrg @end deftypefn 1390 1.3 mrg 1391 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_call_arg_ptr (gimple g, unsigned index) 1392 1.1 mrg Return a pointer to the argument at position @code{INDEX} for call 1393 1.3 mrg statement @code{G}. 1394 1.1 mrg @end deftypefn 1395 1.1 mrg 1396 1.1 mrg @deftypefn {GIMPLE function} void gimple_call_set_arg (gimple g, unsigned index, tree arg) 1397 1.1 mrg Set @code{ARG} to be the argument at position @code{INDEX} for call statement 1398 1.3 mrg @code{G}. 1399 1.1 mrg @end deftypefn 1400 1.1 mrg 1401 1.5 mrg @deftypefn {GIMPLE function} void gimple_call_set_tail (gcall *s) 1402 1.1 mrg Mark call statement @code{S} as being a tail call (i.e., a call just 1403 1.1 mrg before the exit of a function). These calls are candidate for 1404 1.3 mrg tail call optimization. 1405 1.1 mrg @end deftypefn 1406 1.1 mrg 1407 1.5 mrg @deftypefn {GIMPLE function} bool gimple_call_tail_p (gcall *s) 1408 1.3 mrg Return true if @code{GIMPLE_CALL} @code{S} is marked as a tail call. 1409 1.1 mrg @end deftypefn 1410 1.1 mrg 1411 1.1 mrg @deftypefn {GIMPLE function} bool gimple_call_noreturn_p (gimple s) 1412 1.3 mrg Return true if @code{S} is a noreturn call. 1413 1.1 mrg @end deftypefn 1414 1.1 mrg 1415 1.5 mrg @deftypefn {GIMPLE function} gimple gimple_call_copy_skip_args (gcall *stmt, @ 1416 1.5 mrg bitmap args_to_skip) 1417 1.1 mrg Build a @code{GIMPLE_CALL} identical to @code{STMT} but skipping the arguments 1418 1.1 mrg in the positions marked by the set @code{ARGS_TO_SKIP}. 1419 1.1 mrg @end deftypefn 1420 1.1 mrg 1421 1.1 mrg 1422 1.1 mrg @node @code{GIMPLE_CATCH} 1423 1.1 mrg @subsection @code{GIMPLE_CATCH} 1424 1.1 mrg @cindex @code{GIMPLE_CATCH} 1425 1.1 mrg 1426 1.5 mrg @deftypefn {GIMPLE function} gcatch *gimple_build_catch (tree types, @ 1427 1.5 mrg gimple_seq handler) 1428 1.1 mrg Build a @code{GIMPLE_CATCH} statement. @code{TYPES} are the tree types this 1429 1.1 mrg catch handles. @code{HANDLER} is a sequence of statements with the code 1430 1.1 mrg for the handler. 1431 1.1 mrg @end deftypefn 1432 1.1 mrg 1433 1.5 mrg @deftypefn {GIMPLE function} tree gimple_catch_types (const gcatch *g) 1434 1.3 mrg Return the types handled by @code{GIMPLE_CATCH} statement @code{G}. 1435 1.1 mrg @end deftypefn 1436 1.1 mrg 1437 1.5 mrg @deftypefn {GIMPLE function} {tree *} gimple_catch_types_ptr (gcatch *g) 1438 1.1 mrg Return a pointer to the types handled by @code{GIMPLE_CATCH} statement 1439 1.3 mrg @code{G}. 1440 1.1 mrg @end deftypefn 1441 1.1 mrg 1442 1.5 mrg @deftypefn {GIMPLE function} gimple_seq gimple_catch_handler (gcatch *g) 1443 1.1 mrg Return the GIMPLE sequence representing the body of the handler 1444 1.3 mrg of @code{GIMPLE_CATCH} statement @code{G}. 1445 1.1 mrg @end deftypefn 1446 1.1 mrg 1447 1.5 mrg @deftypefn {GIMPLE function} void gimple_catch_set_types (gcatch *g, tree t) 1448 1.3 mrg Set @code{T} to be the set of types handled by @code{GIMPLE_CATCH} @code{G}. 1449 1.1 mrg @end deftypefn 1450 1.1 mrg 1451 1.5 mrg @deftypefn {GIMPLE function} void gimple_catch_set_handler (gcatch *g, @ 1452 1.5 mrg gimple_seq handler) 1453 1.3 mrg Set @code{HANDLER} to be the body of @code{GIMPLE_CATCH} @code{G}. 1454 1.1 mrg @end deftypefn 1455 1.1 mrg 1456 1.1 mrg 1457 1.1 mrg @node @code{GIMPLE_COND} 1458 1.1 mrg @subsection @code{GIMPLE_COND} 1459 1.1 mrg @cindex @code{GIMPLE_COND} 1460 1.1 mrg 1461 1.5 mrg @deftypefn {GIMPLE function} gcond *gimple_build_cond ( @ 1462 1.5 mrg enum tree_code pred_code, tree lhs, tree rhs, tree t_label, tree f_label) 1463 1.1 mrg Build a @code{GIMPLE_COND} statement. @code{A} @code{GIMPLE_COND} statement compares 1464 1.1 mrg @code{LHS} and @code{RHS} and if the condition in @code{PRED_CODE} is true, jump to 1465 1.1 mrg the label in @code{t_label}, otherwise jump to the label in @code{f_label}. 1466 1.1 mrg @code{PRED_CODE} are relational operator tree codes like @code{EQ_EXPR}, 1467 1.1 mrg @code{LT_EXPR}, @code{LE_EXPR}, @code{NE_EXPR}, etc. 1468 1.1 mrg @end deftypefn 1469 1.1 mrg 1470 1.1 mrg 1471 1.5 mrg @deftypefn {GIMPLE function} gcond *gimple_build_cond_from_tree (tree cond, @ 1472 1.5 mrg tree t_label, tree f_label) 1473 1.1 mrg Build a @code{GIMPLE_COND} statement from the conditional expression 1474 1.1 mrg tree @code{COND}. @code{T_LABEL} and @code{F_LABEL} are as in @code{gimple_build_cond}. 1475 1.1 mrg @end deftypefn 1476 1.1 mrg 1477 1.3 mrg @deftypefn {GIMPLE function} {enum tree_code} gimple_cond_code (gimple g) 1478 1.1 mrg Return the code of the predicate computed by conditional 1479 1.3 mrg statement @code{G}. 1480 1.1 mrg @end deftypefn 1481 1.1 mrg 1482 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_set_code (gcond *g, @ 1483 1.5 mrg enum tree_code code) 1484 1.1 mrg Set @code{CODE} to be the predicate code for the conditional statement 1485 1.3 mrg @code{G}. 1486 1.1 mrg @end deftypefn 1487 1.1 mrg 1488 1.1 mrg @deftypefn {GIMPLE function} tree gimple_cond_lhs (gimple g) 1489 1.1 mrg Return the @code{LHS} of the predicate computed by conditional statement 1490 1.3 mrg @code{G}. 1491 1.1 mrg @end deftypefn 1492 1.1 mrg 1493 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_set_lhs (gcond *g, tree lhs) 1494 1.1 mrg Set @code{LHS} to be the @code{LHS} operand of the predicate computed by 1495 1.3 mrg conditional statement @code{G}. 1496 1.1 mrg @end deftypefn 1497 1.1 mrg 1498 1.1 mrg @deftypefn {GIMPLE function} tree gimple_cond_rhs (gimple g) 1499 1.1 mrg Return the @code{RHS} operand of the predicate computed by conditional 1500 1.3 mrg @code{G}. 1501 1.1 mrg @end deftypefn 1502 1.1 mrg 1503 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_set_rhs (gcond *g, tree rhs) 1504 1.1 mrg Set @code{RHS} to be the @code{RHS} operand of the predicate computed by 1505 1.3 mrg conditional statement @code{G}. 1506 1.1 mrg @end deftypefn 1507 1.1 mrg 1508 1.5 mrg @deftypefn {GIMPLE function} tree gimple_cond_true_label (const gcond *g) 1509 1.1 mrg Return the label used by conditional statement @code{G} when its 1510 1.3 mrg predicate evaluates to true. 1511 1.1 mrg @end deftypefn 1512 1.1 mrg 1513 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_set_true_label (gcond *g, tree label) 1514 1.1 mrg Set @code{LABEL} to be the label used by conditional statement @code{G} when 1515 1.3 mrg its predicate evaluates to true. 1516 1.1 mrg @end deftypefn 1517 1.1 mrg 1518 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_set_false_label (gcond *g, tree label) 1519 1.1 mrg Set @code{LABEL} to be the label used by conditional statement @code{G} when 1520 1.3 mrg its predicate evaluates to false. 1521 1.1 mrg @end deftypefn 1522 1.1 mrg 1523 1.5 mrg @deftypefn {GIMPLE function} tree gimple_cond_false_label (const gcond *g) 1524 1.1 mrg Return the label used by conditional statement @code{G} when its 1525 1.3 mrg predicate evaluates to false. 1526 1.1 mrg @end deftypefn 1527 1.1 mrg 1528 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_make_false (gcond *g) 1529 1.3 mrg Set the conditional @code{COND_STMT} to be of the form 'if (1 == 0)'. 1530 1.1 mrg @end deftypefn 1531 1.1 mrg 1532 1.5 mrg @deftypefn {GIMPLE function} void gimple_cond_make_true (gcond *g) 1533 1.3 mrg Set the conditional @code{COND_STMT} to be of the form 'if (1 == 1)'. 1534 1.1 mrg @end deftypefn 1535 1.1 mrg 1536 1.1 mrg @node @code{GIMPLE_DEBUG} 1537 1.1 mrg @subsection @code{GIMPLE_DEBUG} 1538 1.1 mrg @cindex @code{GIMPLE_DEBUG} 1539 1.1 mrg @cindex @code{GIMPLE_DEBUG_BIND} 1540 1.9 mrg @cindex @code{GIMPLE_DEBUG_BEGIN_STMT} 1541 1.9 mrg @cindex @code{GIMPLE_DEBUG_INLINE_ENTRY} 1542 1.1 mrg 1543 1.5 mrg @deftypefn {GIMPLE function} gdebug *gimple_build_debug_bind (tree var, @ 1544 1.5 mrg tree value, gimple stmt) 1545 1.9 mrg Build a @code{GIMPLE_DEBUG} statement with @code{GIMPLE_DEBUG_BIND} 1546 1.1 mrg @code{subcode}. The effect of this statement is to tell debug 1547 1.1 mrg information generation machinery that the value of user variable 1548 1.1 mrg @code{var} is given by @code{value} at that point, and to remain with 1549 1.1 mrg that value until @code{var} runs out of scope, a 1550 1.1 mrg dynamically-subsequent debug bind statement overrides the binding, or 1551 1.1 mrg conflicting values reach a control flow merge point. Even if 1552 1.1 mrg components of the @code{value} expression change afterwards, the 1553 1.1 mrg variable is supposed to retain the same value, though not necessarily 1554 1.1 mrg the same location. 1555 1.1 mrg 1556 1.1 mrg It is expected that @code{var} be most often a tree for automatic user 1557 1.1 mrg variables (@code{VAR_DECL} or @code{PARM_DECL}) that satisfy the 1558 1.1 mrg requirements for gimple registers, but it may also be a tree for a 1559 1.1 mrg scalarized component of a user variable (@code{ARRAY_REF}, 1560 1.1 mrg @code{COMPONENT_REF}), or a debug temporary (@code{DEBUG_EXPR_DECL}). 1561 1.1 mrg 1562 1.1 mrg As for @code{value}, it can be an arbitrary tree expression, but it is 1563 1.1 mrg recommended that it be in a suitable form for a gimple assignment 1564 1.1 mrg @code{RHS}. It is not expected that user variables that could appear 1565 1.1 mrg as @code{var} ever appear in @code{value}, because in the latter we'd 1566 1.1 mrg have their @code{SSA_NAME}s instead, but even if they were not in SSA 1567 1.1 mrg form, user variables appearing in @code{value} are to be regarded as 1568 1.1 mrg part of the executable code space, whereas those in @code{var} are to 1569 1.1 mrg be regarded as part of the source code space. There is no way to 1570 1.1 mrg refer to the value bound to a user variable within a @code{value} 1571 1.1 mrg expression. 1572 1.1 mrg 1573 1.1 mrg If @code{value} is @code{GIMPLE_DEBUG_BIND_NOVALUE}, debug information 1574 1.1 mrg generation machinery is informed that the variable @code{var} is 1575 1.1 mrg unbound, i.e., that its value is indeterminate, which sometimes means 1576 1.1 mrg it is really unavailable, and other times that the compiler could not 1577 1.1 mrg keep track of it. 1578 1.1 mrg 1579 1.1 mrg Block and location information for the newly-created stmt are 1580 1.1 mrg taken from @code{stmt}, if given. 1581 1.1 mrg @end deftypefn 1582 1.1 mrg 1583 1.1 mrg @deftypefn {GIMPLE function} tree gimple_debug_bind_get_var (gimple stmt) 1584 1.1 mrg Return the user variable @var{var} that is bound at @code{stmt}. 1585 1.1 mrg @end deftypefn 1586 1.1 mrg 1587 1.1 mrg @deftypefn {GIMPLE function} tree gimple_debug_bind_get_value (gimple stmt) 1588 1.1 mrg Return the value expression that is bound to a user variable at 1589 1.1 mrg @code{stmt}. 1590 1.1 mrg @end deftypefn 1591 1.1 mrg 1592 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_debug_bind_get_value_ptr (gimple stmt) 1593 1.1 mrg Return a pointer to the value expression that is bound to a user 1594 1.1 mrg variable at @code{stmt}. 1595 1.1 mrg @end deftypefn 1596 1.1 mrg 1597 1.1 mrg @deftypefn {GIMPLE function} void gimple_debug_bind_set_var (gimple stmt, tree var) 1598 1.1 mrg Modify the user variable bound at @code{stmt} to @var{var}. 1599 1.1 mrg @end deftypefn 1600 1.1 mrg 1601 1.1 mrg @deftypefn {GIMPLE function} void gimple_debug_bind_set_value (gimple stmt, tree var) 1602 1.1 mrg Modify the value bound to the user variable bound at @code{stmt} to 1603 1.1 mrg @var{value}. 1604 1.1 mrg @end deftypefn 1605 1.1 mrg 1606 1.1 mrg @deftypefn {GIMPLE function} void gimple_debug_bind_reset_value (gimple stmt) 1607 1.1 mrg Modify the value bound to the user variable bound at @code{stmt} so 1608 1.1 mrg that the variable becomes unbound. 1609 1.1 mrg @end deftypefn 1610 1.1 mrg 1611 1.1 mrg @deftypefn {GIMPLE function} bool gimple_debug_bind_has_value_p (gimple stmt) 1612 1.1 mrg Return @code{TRUE} if @code{stmt} binds a user variable to a value, 1613 1.1 mrg and @code{FALSE} if it unbinds the variable. 1614 1.1 mrg @end deftypefn 1615 1.1 mrg 1616 1.9 mrg @deftypefn {GIMPLE function} gimple gimple_build_debug_begin_stmt (tree block, location_t location) 1617 1.9 mrg Build a @code{GIMPLE_DEBUG} statement with 1618 1.9 mrg @code{GIMPLE_DEBUG_BEGIN_STMT} @code{subcode}. The effect of this 1619 1.9 mrg statement is to tell debug information generation machinery that the 1620 1.9 mrg user statement at the given @code{location} and @code{block} starts at 1621 1.9 mrg the point at which the statement is inserted. The intent is that side 1622 1.10 mrg effects (e.g.@: variable bindings) of all prior user statements are 1623 1.9 mrg observable, and that none of the side effects of subsequent user 1624 1.9 mrg statements are. 1625 1.9 mrg @end deftypefn 1626 1.9 mrg 1627 1.9 mrg @deftypefn {GIMPLE function} gimple gimple_build_debug_inline_entry (tree block, location_t location) 1628 1.9 mrg Build a @code{GIMPLE_DEBUG} statement with 1629 1.9 mrg @code{GIMPLE_DEBUG_INLINE_ENTRY} @code{subcode}. The effect of this 1630 1.9 mrg statement is to tell debug information generation machinery that a 1631 1.9 mrg function call at @code{location} underwent inline substitution, that 1632 1.9 mrg @code{block} is the enclosing lexical block created for the 1633 1.9 mrg substitution, and that at the point of the program in which the stmt is 1634 1.9 mrg inserted, all parameters for the inlined function are bound to the 1635 1.9 mrg respective arguments, and none of the side effects of its stmts are 1636 1.9 mrg observable. 1637 1.9 mrg @end deftypefn 1638 1.9 mrg 1639 1.1 mrg @node @code{GIMPLE_EH_FILTER} 1640 1.1 mrg @subsection @code{GIMPLE_EH_FILTER} 1641 1.1 mrg @cindex @code{GIMPLE_EH_FILTER} 1642 1.1 mrg 1643 1.5 mrg @deftypefn {GIMPLE function} geh_filter *gimple_build_eh_filter (tree types, @ 1644 1.5 mrg gimple_seq failure) 1645 1.1 mrg Build a @code{GIMPLE_EH_FILTER} statement. @code{TYPES} are the filter's 1646 1.1 mrg types. @code{FAILURE} is a sequence with the filter's failure action. 1647 1.1 mrg @end deftypefn 1648 1.1 mrg 1649 1.1 mrg @deftypefn {GIMPLE function} tree gimple_eh_filter_types (gimple g) 1650 1.3 mrg Return the types handled by @code{GIMPLE_EH_FILTER} statement @code{G}. 1651 1.1 mrg @end deftypefn 1652 1.1 mrg 1653 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_eh_filter_types_ptr (gimple g) 1654 1.1 mrg Return a pointer to the types handled by @code{GIMPLE_EH_FILTER} 1655 1.3 mrg statement @code{G}. 1656 1.1 mrg @end deftypefn 1657 1.1 mrg 1658 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_eh_filter_failure (gimple g) 1659 1.1 mrg Return the sequence of statement to execute when @code{GIMPLE_EH_FILTER} 1660 1.3 mrg statement fails. 1661 1.1 mrg @end deftypefn 1662 1.1 mrg 1663 1.5 mrg @deftypefn {GIMPLE function} void gimple_eh_filter_set_types (geh_filter *g, @ 1664 1.5 mrg tree types) 1665 1.3 mrg Set @code{TYPES} to be the set of types handled by @code{GIMPLE_EH_FILTER} @code{G}. 1666 1.1 mrg @end deftypefn 1667 1.1 mrg 1668 1.5 mrg @deftypefn {GIMPLE function} void gimple_eh_filter_set_failure (geh_filter *g, @ 1669 1.5 mrg gimple_seq failure) 1670 1.1 mrg Set @code{FAILURE} to be the sequence of statements to execute on 1671 1.3 mrg failure for @code{GIMPLE_EH_FILTER} @code{G}. 1672 1.1 mrg @end deftypefn 1673 1.1 mrg 1674 1.5 mrg @deftypefn {GIMPLE function} tree gimple_eh_must_not_throw_fndecl ( @ 1675 1.5 mrg geh_mnt *eh_mnt_stmt) 1676 1.5 mrg Get the function decl to be called by the MUST_NOT_THROW region. 1677 1.1 mrg @end deftypefn 1678 1.1 mrg 1679 1.5 mrg @deftypefn {GIMPLE function} void gimple_eh_must_not_throw_set_fndecl ( @ 1680 1.5 mrg geh_mnt *eh_mnt_stmt, tree decl) 1681 1.5 mrg Set the function decl to be called by GS to DECL. 1682 1.1 mrg @end deftypefn 1683 1.1 mrg 1684 1.1 mrg 1685 1.1 mrg @node @code{GIMPLE_LABEL} 1686 1.1 mrg @subsection @code{GIMPLE_LABEL} 1687 1.1 mrg @cindex @code{GIMPLE_LABEL} 1688 1.1 mrg 1689 1.5 mrg @deftypefn {GIMPLE function} glabel *gimple_build_label (tree label) 1690 1.1 mrg Build a @code{GIMPLE_LABEL} statement with corresponding to the tree 1691 1.1 mrg label, @code{LABEL}. 1692 1.1 mrg @end deftypefn 1693 1.1 mrg 1694 1.5 mrg @deftypefn {GIMPLE function} tree gimple_label_label (const glabel *g) 1695 1.3 mrg Return the @code{LABEL_DECL} node used by @code{GIMPLE_LABEL} statement @code{G}. 1696 1.1 mrg @end deftypefn 1697 1.1 mrg 1698 1.5 mrg @deftypefn {GIMPLE function} void gimple_label_set_label (glabel *g, tree label) 1699 1.1 mrg Set @code{LABEL} to be the @code{LABEL_DECL} node used by @code{GIMPLE_LABEL} 1700 1.3 mrg statement @code{G}. 1701 1.1 mrg @end deftypefn 1702 1.1 mrg 1703 1.5 mrg @node @code{GIMPLE_GOTO} 1704 1.5 mrg @subsection @code{GIMPLE_GOTO} 1705 1.5 mrg @cindex @code{GIMPLE_GOTO} 1706 1.1 mrg 1707 1.5 mrg @deftypefn {GIMPLE function} ggoto *gimple_build_goto (tree dest) 1708 1.1 mrg Build a @code{GIMPLE_GOTO} statement to label @code{DEST}. 1709 1.1 mrg @end deftypefn 1710 1.1 mrg 1711 1.1 mrg @deftypefn {GIMPLE function} tree gimple_goto_dest (gimple g) 1712 1.3 mrg Return the destination of the unconditional jump @code{G}. 1713 1.1 mrg @end deftypefn 1714 1.1 mrg 1715 1.5 mrg @deftypefn {GIMPLE function} void gimple_goto_set_dest (ggoto *g, tree dest) 1716 1.1 mrg Set @code{DEST} to be the destination of the unconditional jump @code{G}. 1717 1.1 mrg @end deftypefn 1718 1.1 mrg 1719 1.1 mrg 1720 1.1 mrg @node @code{GIMPLE_NOP} 1721 1.1 mrg @subsection @code{GIMPLE_NOP} 1722 1.1 mrg @cindex @code{GIMPLE_NOP} 1723 1.1 mrg 1724 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_nop (void) 1725 1.1 mrg Build a @code{GIMPLE_NOP} statement. 1726 1.1 mrg @end deftypefn 1727 1.1 mrg 1728 1.1 mrg @deftypefn {GIMPLE function} bool gimple_nop_p (gimple g) 1729 1.3 mrg Returns @code{TRUE} if statement @code{G} is a @code{GIMPLE_NOP}. 1730 1.1 mrg @end deftypefn 1731 1.1 mrg 1732 1.1 mrg @node @code{GIMPLE_OMP_ATOMIC_LOAD} 1733 1.1 mrg @subsection @code{GIMPLE_OMP_ATOMIC_LOAD} 1734 1.1 mrg @cindex @code{GIMPLE_OMP_ATOMIC_LOAD} 1735 1.1 mrg 1736 1.5 mrg @deftypefn {GIMPLE function} gomp_atomic_load *gimple_build_omp_atomic_load ( @ 1737 1.5 mrg tree lhs, tree rhs) 1738 1.1 mrg Build a @code{GIMPLE_OMP_ATOMIC_LOAD} statement. @code{LHS} is the left-hand 1739 1.1 mrg side of the assignment. @code{RHS} is the right-hand side of the 1740 1.1 mrg assignment. 1741 1.1 mrg @end deftypefn 1742 1.1 mrg 1743 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_atomic_load_set_lhs ( @ 1744 1.5 mrg gomp_atomic_load *g, tree lhs) 1745 1.3 mrg Set the @code{LHS} of an atomic load. 1746 1.1 mrg @end deftypefn 1747 1.1 mrg 1748 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_atomic_load_lhs ( @ 1749 1.5 mrg const gomp_atomic_load *g) 1750 1.3 mrg Get the @code{LHS} of an atomic load. 1751 1.1 mrg @end deftypefn 1752 1.1 mrg 1753 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_atomic_load_set_rhs ( @ 1754 1.5 mrg gomp_atomic_load *g, tree rhs) 1755 1.3 mrg Set the @code{RHS} of an atomic set. 1756 1.1 mrg @end deftypefn 1757 1.1 mrg 1758 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_atomic_load_rhs ( @ 1759 1.5 mrg const gomp_atomic_load *g) 1760 1.3 mrg Get the @code{RHS} of an atomic set. 1761 1.1 mrg @end deftypefn 1762 1.1 mrg 1763 1.1 mrg 1764 1.1 mrg @node @code{GIMPLE_OMP_ATOMIC_STORE} 1765 1.1 mrg @subsection @code{GIMPLE_OMP_ATOMIC_STORE} 1766 1.1 mrg @cindex @code{GIMPLE_OMP_ATOMIC_STORE} 1767 1.1 mrg 1768 1.5 mrg @deftypefn {GIMPLE function} gomp_atomic_store *gimple_build_omp_atomic_store ( @ 1769 1.5 mrg tree val) 1770 1.1 mrg Build a @code{GIMPLE_OMP_ATOMIC_STORE} statement. @code{VAL} is the value to be 1771 1.1 mrg stored. 1772 1.1 mrg @end deftypefn 1773 1.1 mrg 1774 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_atomic_store_set_val ( @ 1775 1.5 mrg gomp_atomic_store *g, tree val) 1776 1.3 mrg Set the value being stored in an atomic store. 1777 1.1 mrg @end deftypefn 1778 1.1 mrg 1779 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_atomic_store_val ( @ 1780 1.5 mrg const gomp_atomic_store *g) 1781 1.3 mrg Return the value being stored in an atomic store. 1782 1.1 mrg @end deftypefn 1783 1.1 mrg 1784 1.1 mrg @node @code{GIMPLE_OMP_CONTINUE} 1785 1.1 mrg @subsection @code{GIMPLE_OMP_CONTINUE} 1786 1.1 mrg @cindex @code{GIMPLE_OMP_CONTINUE} 1787 1.1 mrg 1788 1.5 mrg @deftypefn {GIMPLE function} gomp_continue *gimple_build_omp_continue ( @ 1789 1.5 mrg tree control_def, tree control_use) 1790 1.1 mrg Build a @code{GIMPLE_OMP_CONTINUE} statement. @code{CONTROL_DEF} is the 1791 1.1 mrg definition of the control variable. @code{CONTROL_USE} is the use of 1792 1.1 mrg the control variable. 1793 1.1 mrg @end deftypefn 1794 1.1 mrg 1795 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_control_def ( @ 1796 1.5 mrg const gomp_continue *s) 1797 1.1 mrg Return the definition of the control variable on a 1798 1.1 mrg @code{GIMPLE_OMP_CONTINUE} in @code{S}. 1799 1.1 mrg @end deftypefn 1800 1.3 mrg 1801 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_control_def_ptr ( @ 1802 1.5 mrg gomp_continue *s) 1803 1.1 mrg Same as above, but return the pointer. 1804 1.1 mrg @end deftypefn 1805 1.3 mrg 1806 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_set_control_def ( @ 1807 1.5 mrg gomp_continue *s) 1808 1.1 mrg Set the control variable definition for a @code{GIMPLE_OMP_CONTINUE} 1809 1.1 mrg statement in @code{S}. 1810 1.1 mrg @end deftypefn 1811 1.3 mrg 1812 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_control_use ( @ 1813 1.5 mrg const gomp_continue *s) 1814 1.1 mrg Return the use of the control variable on a @code{GIMPLE_OMP_CONTINUE} 1815 1.1 mrg in @code{S}. 1816 1.1 mrg @end deftypefn 1817 1.3 mrg 1818 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_control_use_ptr ( @ 1819 1.5 mrg gomp_continue *s) 1820 1.1 mrg Same as above, but return the pointer. 1821 1.1 mrg @end deftypefn 1822 1.3 mrg 1823 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_continue_set_control_use ( @ 1824 1.5 mrg gomp_continue *s) 1825 1.1 mrg Set the control variable use for a @code{GIMPLE_OMP_CONTINUE} statement 1826 1.1 mrg in @code{S}. 1827 1.1 mrg @end deftypefn 1828 1.1 mrg 1829 1.1 mrg 1830 1.1 mrg @node @code{GIMPLE_OMP_CRITICAL} 1831 1.1 mrg @subsection @code{GIMPLE_OMP_CRITICAL} 1832 1.1 mrg @cindex @code{GIMPLE_OMP_CRITICAL} 1833 1.1 mrg 1834 1.5 mrg @deftypefn {GIMPLE function} gomp_critical *gimple_build_omp_critical ( @ 1835 1.5 mrg gimple_seq body, tree name) 1836 1.1 mrg Build a @code{GIMPLE_OMP_CRITICAL} statement. @code{BODY} is the sequence of 1837 1.1 mrg statements for which only one thread can execute. @code{NAME} is an 1838 1.1 mrg optional identifier for this critical block. 1839 1.1 mrg @end deftypefn 1840 1.1 mrg 1841 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_critical_name ( @ 1842 1.5 mrg const gomp_critical *g) 1843 1.3 mrg Return the name associated with @code{OMP_CRITICAL} statement @code{G}. 1844 1.1 mrg @end deftypefn 1845 1.1 mrg 1846 1.5 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_critical_name_ptr ( @ 1847 1.5 mrg gomp_critical *g) 1848 1.1 mrg Return a pointer to the name associated with @code{OMP} critical 1849 1.3 mrg statement @code{G}. 1850 1.1 mrg @end deftypefn 1851 1.1 mrg 1852 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_critical_set_name ( @ 1853 1.5 mrg gomp_critical *g, tree name) 1854 1.3 mrg Set @code{NAME} to be the name associated with @code{OMP} critical statement @code{G}. 1855 1.1 mrg @end deftypefn 1856 1.1 mrg 1857 1.1 mrg @node @code{GIMPLE_OMP_FOR} 1858 1.1 mrg @subsection @code{GIMPLE_OMP_FOR} 1859 1.1 mrg @cindex @code{GIMPLE_OMP_FOR} 1860 1.1 mrg 1861 1.5 mrg @deftypefn {GIMPLE function} gomp_for *gimple_build_omp_for (gimple_seq body, @ 1862 1.1 mrg tree clauses, tree index, tree initial, tree final, tree incr, @ 1863 1.1 mrg gimple_seq pre_body, enum tree_code omp_for_cond) 1864 1.1 mrg Build a @code{GIMPLE_OMP_FOR} statement. @code{BODY} is sequence of statements 1865 1.5 mrg inside the for loop. @code{CLAUSES}, are any of the loop 1866 1.5 mrg construct's clauses. @code{PRE_BODY} is the 1867 1.1 mrg sequence of statements that are loop invariant. @code{INDEX} is the 1868 1.1 mrg index variable. @code{INITIAL} is the initial value of @code{INDEX}. @code{FINAL} is 1869 1.1 mrg final value of @code{INDEX}. OMP_FOR_COND is the predicate used to 1870 1.1 mrg compare @code{INDEX} and @code{FINAL}. @code{INCR} is the increment expression. 1871 1.1 mrg @end deftypefn 1872 1.1 mrg 1873 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_for_clauses (gimple g) 1874 1.3 mrg Return the clauses associated with @code{OMP_FOR} @code{G}. 1875 1.1 mrg @end deftypefn 1876 1.1 mrg 1877 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_for_clauses_ptr (gimple g) 1878 1.3 mrg Return a pointer to the @code{OMP_FOR} @code{G}. 1879 1.1 mrg @end deftypefn 1880 1.1 mrg 1881 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_clauses (gimple g, tree clauses) 1882 1.3 mrg Set @code{CLAUSES} to be the list of clauses associated with @code{OMP_FOR} @code{G}. 1883 1.1 mrg @end deftypefn 1884 1.1 mrg 1885 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_for_index (gimple g) 1886 1.3 mrg Return the index variable for @code{OMP_FOR} @code{G}. 1887 1.1 mrg @end deftypefn 1888 1.1 mrg 1889 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_for_index_ptr (gimple g) 1890 1.3 mrg Return a pointer to the index variable for @code{OMP_FOR} @code{G}. 1891 1.1 mrg @end deftypefn 1892 1.1 mrg 1893 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_index (gimple g, tree index) 1894 1.3 mrg Set @code{INDEX} to be the index variable for @code{OMP_FOR} @code{G}. 1895 1.1 mrg @end deftypefn 1896 1.1 mrg 1897 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_for_initial (gimple g) 1898 1.3 mrg Return the initial value for @code{OMP_FOR} @code{G}. 1899 1.1 mrg @end deftypefn 1900 1.1 mrg 1901 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_for_initial_ptr (gimple g) 1902 1.3 mrg Return a pointer to the initial value for @code{OMP_FOR} @code{G}. 1903 1.1 mrg @end deftypefn 1904 1.1 mrg 1905 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_initial (gimple g, tree initial) 1906 1.1 mrg Set @code{INITIAL} to be the initial value for @code{OMP_FOR} @code{G}. 1907 1.1 mrg @end deftypefn 1908 1.1 mrg 1909 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_for_final (gimple g) 1910 1.3 mrg Return the final value for @code{OMP_FOR} @code{G}. 1911 1.1 mrg @end deftypefn 1912 1.1 mrg 1913 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_for_final_ptr (gimple g) 1914 1.3 mrg turn a pointer to the final value for @code{OMP_FOR} @code{G}. 1915 1.1 mrg @end deftypefn 1916 1.1 mrg 1917 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_final (gimple g, tree final) 1918 1.3 mrg Set @code{FINAL} to be the final value for @code{OMP_FOR} @code{G}. 1919 1.1 mrg @end deftypefn 1920 1.1 mrg 1921 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_for_incr (gimple g) 1922 1.3 mrg Return the increment value for @code{OMP_FOR} @code{G}. 1923 1.1 mrg @end deftypefn 1924 1.1 mrg 1925 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_for_incr_ptr (gimple g) 1926 1.3 mrg Return a pointer to the increment value for @code{OMP_FOR} @code{G}. 1927 1.1 mrg @end deftypefn 1928 1.1 mrg 1929 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_incr (gimple g, tree incr) 1930 1.3 mrg Set @code{INCR} to be the increment value for @code{OMP_FOR} @code{G}. 1931 1.1 mrg @end deftypefn 1932 1.1 mrg 1933 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_omp_for_pre_body (gimple g) 1934 1.1 mrg Return the sequence of statements to execute before the @code{OMP_FOR} 1935 1.3 mrg statement @code{G} starts. 1936 1.1 mrg @end deftypefn 1937 1.1 mrg 1938 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_pre_body (gimple g, gimple_seq pre_body) 1939 1.1 mrg Set @code{PRE_BODY} to be the sequence of statements to execute before 1940 1.1 mrg the @code{OMP_FOR} statement @code{G} starts. 1941 1.1 mrg @end deftypefn 1942 1.3 mrg 1943 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_for_set_cond (gimple g, enum tree_code cond) 1944 1.3 mrg Set @code{COND} to be the condition code for @code{OMP_FOR} @code{G}. 1945 1.1 mrg @end deftypefn 1946 1.1 mrg 1947 1.3 mrg @deftypefn {GIMPLE function} {enum tree_code} gimple_omp_for_cond (gimple g) 1948 1.3 mrg Return the condition code associated with @code{OMP_FOR} @code{G}. 1949 1.1 mrg @end deftypefn 1950 1.1 mrg 1951 1.1 mrg 1952 1.1 mrg @node @code{GIMPLE_OMP_MASTER} 1953 1.1 mrg @subsection @code{GIMPLE_OMP_MASTER} 1954 1.1 mrg @cindex @code{GIMPLE_OMP_MASTER} 1955 1.1 mrg 1956 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_omp_master (gimple_seq body) 1957 1.1 mrg Build a @code{GIMPLE_OMP_MASTER} statement. @code{BODY} is the sequence of 1958 1.1 mrg statements to be executed by just the master. 1959 1.1 mrg @end deftypefn 1960 1.1 mrg 1961 1.1 mrg 1962 1.1 mrg @node @code{GIMPLE_OMP_ORDERED} 1963 1.1 mrg @subsection @code{GIMPLE_OMP_ORDERED} 1964 1.1 mrg @cindex @code{GIMPLE_OMP_ORDERED} 1965 1.1 mrg 1966 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_omp_ordered (gimple_seq body) 1967 1.1 mrg Build a @code{GIMPLE_OMP_ORDERED} statement. 1968 1.1 mrg @end deftypefn 1969 1.1 mrg 1970 1.1 mrg @code{BODY} is the sequence of statements inside a loop that will 1971 1.1 mrg executed in sequence. 1972 1.1 mrg 1973 1.1 mrg 1974 1.1 mrg @node @code{GIMPLE_OMP_PARALLEL} 1975 1.1 mrg @subsection @code{GIMPLE_OMP_PARALLEL} 1976 1.1 mrg @cindex @code{GIMPLE_OMP_PARALLEL} 1977 1.1 mrg 1978 1.5 mrg @deftypefn {GIMPLE function} gomp_parallel *gimple_build_omp_parallel (@ 1979 1.5 mrg gimple_seq body, tree clauses, tree child_fn, tree data_arg) 1980 1.1 mrg Build a @code{GIMPLE_OMP_PARALLEL} statement. 1981 1.1 mrg @end deftypefn 1982 1.1 mrg 1983 1.1 mrg @code{BODY} is sequence of statements which are executed in parallel. 1984 1.1 mrg @code{CLAUSES}, are the @code{OMP} parallel construct's clauses. @code{CHILD_FN} is 1985 1.1 mrg the function created for the parallel threads to execute. 1986 1.1 mrg @code{DATA_ARG} are the shared data argument(s). 1987 1.1 mrg 1988 1.1 mrg @deftypefn {GIMPLE function} bool gimple_omp_parallel_combined_p (gimple g) 1989 1.1 mrg Return true if @code{OMP} parallel statement @code{G} has the 1990 1.1 mrg @code{GF_OMP_PARALLEL_COMBINED} flag set. 1991 1.1 mrg @end deftypefn 1992 1.3 mrg 1993 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_parallel_set_combined_p (gimple g) 1994 1.1 mrg Set the @code{GF_OMP_PARALLEL_COMBINED} field in @code{OMP} parallel statement 1995 1.1 mrg @code{G}. 1996 1.1 mrg @end deftypefn 1997 1.3 mrg 1998 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_omp_body (gimple g) 1999 1.3 mrg Return the body for the @code{OMP} statement @code{G}. 2000 1.1 mrg @end deftypefn 2001 1.1 mrg 2002 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_set_body (gimple g, gimple_seq body) 2003 1.3 mrg Set @code{BODY} to be the body for the @code{OMP} statement @code{G}. 2004 1.1 mrg @end deftypefn 2005 1.1 mrg 2006 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_parallel_clauses (gimple g) 2007 1.3 mrg Return the clauses associated with @code{OMP_PARALLEL} @code{G}. 2008 1.1 mrg @end deftypefn 2009 1.1 mrg 2010 1.5 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_parallel_clauses_ptr ( @ 2011 1.5 mrg gomp_parallel *g) 2012 1.3 mrg Return a pointer to the clauses associated with @code{OMP_PARALLEL} @code{G}. 2013 1.1 mrg @end deftypefn 2014 1.1 mrg 2015 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_parallel_set_clauses ( @ 2016 1.5 mrg gomp_parallel *g, tree clauses) 2017 1.1 mrg Set @code{CLAUSES} to be the list of clauses associated with 2018 1.3 mrg @code{OMP_PARALLEL} @code{G}. 2019 1.1 mrg @end deftypefn 2020 1.1 mrg 2021 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_parallel_child_fn ( @ 2022 1.5 mrg const gomp_parallel *g) 2023 1.1 mrg Return the child function used to hold the body of @code{OMP_PARALLEL} 2024 1.3 mrg @code{G}. 2025 1.1 mrg @end deftypefn 2026 1.1 mrg 2027 1.5 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_parallel_child_fn_ptr ( @ 2028 1.5 mrg gomp_parallel *g) 2029 1.1 mrg Return a pointer to the child function used to hold the body of 2030 1.3 mrg @code{OMP_PARALLEL} @code{G}. 2031 1.1 mrg @end deftypefn 2032 1.1 mrg 2033 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_parallel_set_child_fn ( @ 2034 1.5 mrg gomp_parallel *g, tree child_fn) 2035 1.3 mrg Set @code{CHILD_FN} to be the child function for @code{OMP_PARALLEL} @code{G}. 2036 1.1 mrg @end deftypefn 2037 1.1 mrg 2038 1.5 mrg @deftypefn {GIMPLE function} tree gimple_omp_parallel_data_arg ( @ 2039 1.5 mrg const gomp_parallel *g) 2040 1.1 mrg Return the artificial argument used to send variables and values 2041 1.3 mrg from the parent to the children threads in @code{OMP_PARALLEL} @code{G}. 2042 1.1 mrg @end deftypefn 2043 1.1 mrg 2044 1.5 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_parallel_data_arg_ptr ( @ 2045 1.5 mrg gomp_parallel *g) 2046 1.3 mrg Return a pointer to the data argument for @code{OMP_PARALLEL} @code{G}. 2047 1.1 mrg @end deftypefn 2048 1.1 mrg 2049 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_parallel_set_data_arg ( @ 2050 1.5 mrg gomp_parallel *g, tree data_arg) 2051 1.3 mrg Set @code{DATA_ARG} to be the data argument for @code{OMP_PARALLEL} @code{G}. 2052 1.1 mrg @end deftypefn 2053 1.1 mrg 2054 1.1 mrg 2055 1.1 mrg @node @code{GIMPLE_OMP_RETURN} 2056 1.1 mrg @subsection @code{GIMPLE_OMP_RETURN} 2057 1.1 mrg @cindex @code{GIMPLE_OMP_RETURN} 2058 1.1 mrg 2059 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_omp_return (bool wait_p) 2060 1.1 mrg Build a @code{GIMPLE_OMP_RETURN} statement. @code{WAIT_P} is true if this is a 2061 1.1 mrg non-waiting return. 2062 1.1 mrg @end deftypefn 2063 1.1 mrg 2064 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_return_set_nowait (gimple s) 2065 1.1 mrg Set the nowait flag on @code{GIMPLE_OMP_RETURN} statement @code{S}. 2066 1.1 mrg @end deftypefn 2067 1.3 mrg 2068 1.1 mrg 2069 1.1 mrg @deftypefn {GIMPLE function} bool gimple_omp_return_nowait_p (gimple g) 2070 1.1 mrg Return true if @code{OMP} return statement @code{G} has the 2071 1.1 mrg @code{GF_OMP_RETURN_NOWAIT} flag set. 2072 1.1 mrg @end deftypefn 2073 1.1 mrg 2074 1.1 mrg @node @code{GIMPLE_OMP_SECTION} 2075 1.1 mrg @subsection @code{GIMPLE_OMP_SECTION} 2076 1.1 mrg @cindex @code{GIMPLE_OMP_SECTION} 2077 1.1 mrg 2078 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_omp_section (gimple_seq body) 2079 1.1 mrg Build a @code{GIMPLE_OMP_SECTION} statement for a sections statement. 2080 1.1 mrg @end deftypefn 2081 1.1 mrg 2082 1.1 mrg @code{BODY} is the sequence of statements in the section. 2083 1.1 mrg 2084 1.1 mrg @deftypefn {GIMPLE function} bool gimple_omp_section_last_p (gimple g) 2085 1.1 mrg Return true if @code{OMP} section statement @code{G} has the 2086 1.1 mrg @code{GF_OMP_SECTION_LAST} flag set. 2087 1.1 mrg @end deftypefn 2088 1.3 mrg 2089 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_section_set_last (gimple g) 2090 1.1 mrg Set the @code{GF_OMP_SECTION_LAST} flag on @code{G}. 2091 1.1 mrg @end deftypefn 2092 1.1 mrg 2093 1.1 mrg @node @code{GIMPLE_OMP_SECTIONS} 2094 1.1 mrg @subsection @code{GIMPLE_OMP_SECTIONS} 2095 1.1 mrg @cindex @code{GIMPLE_OMP_SECTIONS} 2096 1.1 mrg 2097 1.5 mrg @deftypefn {GIMPLE function} gomp_sections *gimple_build_omp_sections ( @ 2098 1.5 mrg gimple_seq body, tree clauses) 2099 1.1 mrg Build a @code{GIMPLE_OMP_SECTIONS} statement. @code{BODY} is a sequence of 2100 1.1 mrg section statements. @code{CLAUSES} are any of the @code{OMP} sections 2101 1.1 mrg construct's clauses: private, firstprivate, lastprivate, 2102 1.1 mrg reduction, and nowait. 2103 1.1 mrg @end deftypefn 2104 1.1 mrg 2105 1.1 mrg 2106 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_omp_sections_switch (void) 2107 1.1 mrg Build a @code{GIMPLE_OMP_SECTIONS_SWITCH} statement. 2108 1.1 mrg @end deftypefn 2109 1.1 mrg 2110 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_sections_control (gimple g) 2111 1.1 mrg Return the control variable associated with the 2112 1.1 mrg @code{GIMPLE_OMP_SECTIONS} in @code{G}. 2113 1.1 mrg @end deftypefn 2114 1.3 mrg 2115 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_sections_control_ptr (gimple g) 2116 1.1 mrg Return a pointer to the clauses associated with the 2117 1.1 mrg @code{GIMPLE_OMP_SECTIONS} in @code{G}. 2118 1.1 mrg @end deftypefn 2119 1.3 mrg 2120 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_sections_set_control (gimple g, tree control) 2121 1.1 mrg Set @code{CONTROL} to be the set of clauses associated with the 2122 1.1 mrg @code{GIMPLE_OMP_SECTIONS} in @code{G}. 2123 1.1 mrg @end deftypefn 2124 1.3 mrg 2125 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_sections_clauses (gimple g) 2126 1.3 mrg Return the clauses associated with @code{OMP_SECTIONS} @code{G}. 2127 1.1 mrg @end deftypefn 2128 1.1 mrg 2129 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_sections_clauses_ptr (gimple g) 2130 1.3 mrg Return a pointer to the clauses associated with @code{OMP_SECTIONS} @code{G}. 2131 1.1 mrg @end deftypefn 2132 1.1 mrg 2133 1.1 mrg @deftypefn {GIMPLE function} void gimple_omp_sections_set_clauses (gimple g, tree clauses) 2134 1.1 mrg Set @code{CLAUSES} to be the set of clauses associated with @code{OMP_SECTIONS} 2135 1.3 mrg @code{G}. 2136 1.1 mrg @end deftypefn 2137 1.1 mrg 2138 1.1 mrg 2139 1.1 mrg @node @code{GIMPLE_OMP_SINGLE} 2140 1.1 mrg @subsection @code{GIMPLE_OMP_SINGLE} 2141 1.1 mrg @cindex @code{GIMPLE_OMP_SINGLE} 2142 1.1 mrg 2143 1.5 mrg @deftypefn {GIMPLE function} gomp_single *gimple_build_omp_single ( @ 2144 1.5 mrg gimple_seq body, tree clauses) 2145 1.1 mrg Build a @code{GIMPLE_OMP_SINGLE} statement. @code{BODY} is the sequence of 2146 1.1 mrg statements that will be executed once. @code{CLAUSES} are any of the 2147 1.1 mrg @code{OMP} single construct's clauses: private, firstprivate, 2148 1.1 mrg copyprivate, nowait. 2149 1.1 mrg @end deftypefn 2150 1.1 mrg 2151 1.1 mrg @deftypefn {GIMPLE function} tree gimple_omp_single_clauses (gimple g) 2152 1.3 mrg Return the clauses associated with @code{OMP_SINGLE} @code{G}. 2153 1.1 mrg @end deftypefn 2154 1.1 mrg 2155 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_omp_single_clauses_ptr (gimple g) 2156 1.3 mrg Return a pointer to the clauses associated with @code{OMP_SINGLE} @code{G}. 2157 1.1 mrg @end deftypefn 2158 1.1 mrg 2159 1.5 mrg @deftypefn {GIMPLE function} void gimple_omp_single_set_clauses ( @ 2160 1.5 mrg gomp_single *g, tree clauses) 2161 1.3 mrg Set @code{CLAUSES} to be the clauses associated with @code{OMP_SINGLE} @code{G}. 2162 1.1 mrg @end deftypefn 2163 1.1 mrg 2164 1.1 mrg 2165 1.1 mrg @node @code{GIMPLE_PHI} 2166 1.1 mrg @subsection @code{GIMPLE_PHI} 2167 1.1 mrg @cindex @code{GIMPLE_PHI} 2168 1.1 mrg 2169 1.1 mrg @deftypefn {GIMPLE function} unsigned gimple_phi_capacity (gimple g) 2170 1.3 mrg Return the maximum number of arguments supported by @code{GIMPLE_PHI} @code{G}. 2171 1.1 mrg @end deftypefn 2172 1.1 mrg 2173 1.1 mrg @deftypefn {GIMPLE function} unsigned gimple_phi_num_args (gimple g) 2174 1.1 mrg Return the number of arguments in @code{GIMPLE_PHI} @code{G}. This must always 2175 1.1 mrg be exactly the number of incoming edges for the basic block 2176 1.3 mrg holding @code{G}. 2177 1.1 mrg @end deftypefn 2178 1.1 mrg 2179 1.1 mrg @deftypefn {GIMPLE function} tree gimple_phi_result (gimple g) 2180 1.3 mrg Return the @code{SSA} name created by @code{GIMPLE_PHI} @code{G}. 2181 1.1 mrg @end deftypefn 2182 1.1 mrg 2183 1.3 mrg @deftypefn {GIMPLE function} {tree *} gimple_phi_result_ptr (gimple g) 2184 1.3 mrg Return a pointer to the @code{SSA} name created by @code{GIMPLE_PHI} @code{G}. 2185 1.1 mrg @end deftypefn 2186 1.1 mrg 2187 1.5 mrg @deftypefn {GIMPLE function} void gimple_phi_set_result (gphi *g, tree result) 2188 1.3 mrg Set @code{RESULT} to be the @code{SSA} name created by @code{GIMPLE_PHI} @code{G}. 2189 1.1 mrg @end deftypefn 2190 1.1 mrg 2191 1.3 mrg @deftypefn {GIMPLE function} {struct phi_arg_d *} gimple_phi_arg (gimple g, index) 2192 1.1 mrg Return the @code{PHI} argument corresponding to incoming edge @code{INDEX} for 2193 1.3 mrg @code{GIMPLE_PHI} @code{G}. 2194 1.1 mrg @end deftypefn 2195 1.1 mrg 2196 1.5 mrg @deftypefn {GIMPLE function} void gimple_phi_set_arg (gphi *g, index, @ 2197 1.5 mrg struct phi_arg_d * phiarg) 2198 1.1 mrg Set @code{PHIARG} to be the argument corresponding to incoming edge 2199 1.3 mrg @code{INDEX} for @code{GIMPLE_PHI} @code{G}. 2200 1.1 mrg @end deftypefn 2201 1.1 mrg 2202 1.1 mrg @node @code{GIMPLE_RESX} 2203 1.1 mrg @subsection @code{GIMPLE_RESX} 2204 1.1 mrg @cindex @code{GIMPLE_RESX} 2205 1.1 mrg 2206 1.5 mrg @deftypefn {GIMPLE function} gresx *gimple_build_resx (int region) 2207 1.1 mrg Build a @code{GIMPLE_RESX} statement which is a statement. This 2208 1.1 mrg statement is a placeholder for _Unwind_Resume before we know if a 2209 1.1 mrg function call or a branch is needed. @code{REGION} is the exception 2210 1.1 mrg region from which control is flowing. 2211 1.1 mrg @end deftypefn 2212 1.1 mrg 2213 1.5 mrg @deftypefn {GIMPLE function} int gimple_resx_region (const gresx *g) 2214 1.3 mrg Return the region number for @code{GIMPLE_RESX} @code{G}. 2215 1.1 mrg @end deftypefn 2216 1.1 mrg 2217 1.5 mrg @deftypefn {GIMPLE function} void gimple_resx_set_region (gresx *g, int region) 2218 1.3 mrg Set @code{REGION} to be the region number for @code{GIMPLE_RESX} @code{G}. 2219 1.1 mrg @end deftypefn 2220 1.1 mrg 2221 1.1 mrg @node @code{GIMPLE_RETURN} 2222 1.1 mrg @subsection @code{GIMPLE_RETURN} 2223 1.1 mrg @cindex @code{GIMPLE_RETURN} 2224 1.1 mrg 2225 1.5 mrg @deftypefn {GIMPLE function} greturn *gimple_build_return (tree retval) 2226 1.1 mrg Build a @code{GIMPLE_RETURN} statement whose return value is retval. 2227 1.1 mrg @end deftypefn 2228 1.1 mrg 2229 1.5 mrg @deftypefn {GIMPLE function} tree gimple_return_retval (const greturn *g) 2230 1.3 mrg Return the return value for @code{GIMPLE_RETURN} @code{G}. 2231 1.1 mrg @end deftypefn 2232 1.1 mrg 2233 1.5 mrg @deftypefn {GIMPLE function} void gimple_return_set_retval (greturn *g, @ 2234 1.5 mrg tree retval) 2235 1.3 mrg Set @code{RETVAL} to be the return value for @code{GIMPLE_RETURN} @code{G}. 2236 1.1 mrg @end deftypefn 2237 1.1 mrg 2238 1.1 mrg @node @code{GIMPLE_SWITCH} 2239 1.1 mrg @subsection @code{GIMPLE_SWITCH} 2240 1.1 mrg @cindex @code{GIMPLE_SWITCH} 2241 1.1 mrg 2242 1.5 mrg @deftypefn {GIMPLE function} gswitch *gimple_build_switch (tree index, @ 2243 1.5 mrg tree default_label, @code{vec}<tree> *args) 2244 1.3 mrg Build a @code{GIMPLE_SWITCH} statement. @code{INDEX} is the index variable 2245 1.3 mrg to switch on, and @code{DEFAULT_LABEL} represents the default label. 2246 1.3 mrg @code{ARGS} is a vector of @code{CASE_LABEL_EXPR} trees that contain the 2247 1.3 mrg non-default case labels. Each label is a tree of code @code{CASE_LABEL_EXPR}. 2248 1.1 mrg @end deftypefn 2249 1.1 mrg 2250 1.5 mrg @deftypefn {GIMPLE function} unsigned gimple_switch_num_labels ( @ 2251 1.5 mrg const gswitch *g) 2252 1.1 mrg Return the number of labels associated with the switch statement 2253 1.3 mrg @code{G}. 2254 1.1 mrg @end deftypefn 2255 1.1 mrg 2256 1.5 mrg @deftypefn {GIMPLE function} void gimple_switch_set_num_labels (gswitch *g, @ 2257 1.3 mrg unsigned nlabels) 2258 1.1 mrg Set @code{NLABELS} to be the number of labels for the switch statement 2259 1.3 mrg @code{G}. 2260 1.1 mrg @end deftypefn 2261 1.1 mrg 2262 1.5 mrg @deftypefn {GIMPLE function} tree gimple_switch_index (const gswitch *g) 2263 1.3 mrg Return the index variable used by the switch statement @code{G}. 2264 1.1 mrg @end deftypefn 2265 1.1 mrg 2266 1.5 mrg @deftypefn {GIMPLE function} void gimple_switch_set_index (gswitch *g, @ 2267 1.5 mrg tree index) 2268 1.3 mrg Set @code{INDEX} to be the index variable for switch statement @code{G}. 2269 1.1 mrg @end deftypefn 2270 1.1 mrg 2271 1.5 mrg @deftypefn {GIMPLE function} tree gimple_switch_label (const gswitch *g, @ 2272 1.5 mrg unsigned index) 2273 1.1 mrg Return the label numbered @code{INDEX}. The default label is 0, followed 2274 1.3 mrg by any labels in a switch statement. 2275 1.1 mrg @end deftypefn 2276 1.1 mrg 2277 1.5 mrg @deftypefn {GIMPLE function} void gimple_switch_set_label (gswitch *g, @ 2278 1.5 mrg unsigned index, tree label) 2279 1.1 mrg Set the label number @code{INDEX} to @code{LABEL}. 0 is always the default 2280 1.3 mrg label. 2281 1.1 mrg @end deftypefn 2282 1.1 mrg 2283 1.5 mrg @deftypefn {GIMPLE function} tree gimple_switch_default_label ( @ 2284 1.5 mrg const gswitch *g) 2285 1.3 mrg Return the default label for a switch statement. 2286 1.1 mrg @end deftypefn 2287 1.1 mrg 2288 1.5 mrg @deftypefn {GIMPLE function} void gimple_switch_set_default_label (gswitch *g, @ 2289 1.3 mrg tree label) 2290 1.3 mrg Set the default label for a switch statement. 2291 1.1 mrg @end deftypefn 2292 1.1 mrg 2293 1.1 mrg 2294 1.1 mrg @node @code{GIMPLE_TRY} 2295 1.1 mrg @subsection @code{GIMPLE_TRY} 2296 1.1 mrg @cindex @code{GIMPLE_TRY} 2297 1.1 mrg 2298 1.5 mrg @deftypefn {GIMPLE function} gtry *gimple_build_try (gimple_seq eval, @ 2299 1.3 mrg gimple_seq cleanup, unsigned int kind) 2300 1.1 mrg Build a @code{GIMPLE_TRY} statement. @code{EVAL} is a sequence with the 2301 1.1 mrg expression to evaluate. @code{CLEANUP} is a sequence of statements to 2302 1.1 mrg run at clean-up time. @code{KIND} is the enumeration value 2303 1.1 mrg @code{GIMPLE_TRY_CATCH} if this statement denotes a try/catch construct 2304 1.1 mrg or @code{GIMPLE_TRY_FINALLY} if this statement denotes a try/finally 2305 1.1 mrg construct. 2306 1.1 mrg @end deftypefn 2307 1.1 mrg 2308 1.3 mrg @deftypefn {GIMPLE function} {enum gimple_try_flags} gimple_try_kind (gimple g) 2309 1.1 mrg Return the kind of try block represented by @code{GIMPLE_TRY} @code{G}. This is 2310 1.3 mrg either @code{GIMPLE_TRY_CATCH} or @code{GIMPLE_TRY_FINALLY}. 2311 1.1 mrg @end deftypefn 2312 1.1 mrg 2313 1.1 mrg @deftypefn {GIMPLE function} bool gimple_try_catch_is_cleanup (gimple g) 2314 1.3 mrg Return the @code{GIMPLE_TRY_CATCH_IS_CLEANUP} flag. 2315 1.1 mrg @end deftypefn 2316 1.1 mrg 2317 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_try_eval (gimple g) 2318 1.1 mrg Return the sequence of statements used as the body for @code{GIMPLE_TRY} 2319 1.3 mrg @code{G}. 2320 1.1 mrg @end deftypefn 2321 1.1 mrg 2322 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_try_cleanup (gimple g) 2323 1.1 mrg Return the sequence of statements used as the cleanup body for 2324 1.3 mrg @code{GIMPLE_TRY} @code{G}. 2325 1.1 mrg @end deftypefn 2326 1.1 mrg 2327 1.3 mrg @deftypefn {GIMPLE function} void gimple_try_set_catch_is_cleanup (gimple g, @ 2328 1.3 mrg bool catch_is_cleanup) 2329 1.3 mrg Set the @code{GIMPLE_TRY_CATCH_IS_CLEANUP} flag. 2330 1.1 mrg @end deftypefn 2331 1.1 mrg 2332 1.5 mrg @deftypefn {GIMPLE function} void gimple_try_set_eval (gtry *g, gimple_seq eval) 2333 1.1 mrg Set @code{EVAL} to be the sequence of statements to use as the body for 2334 1.3 mrg @code{GIMPLE_TRY} @code{G}. 2335 1.1 mrg @end deftypefn 2336 1.1 mrg 2337 1.5 mrg @deftypefn {GIMPLE function} void gimple_try_set_cleanup (gtry *g, @ 2338 1.5 mrg gimple_seq cleanup) 2339 1.1 mrg Set @code{CLEANUP} to be the sequence of statements to use as the 2340 1.3 mrg cleanup body for @code{GIMPLE_TRY} @code{G}. 2341 1.1 mrg @end deftypefn 2342 1.1 mrg 2343 1.1 mrg @node @code{GIMPLE_WITH_CLEANUP_EXPR} 2344 1.1 mrg @subsection @code{GIMPLE_WITH_CLEANUP_EXPR} 2345 1.1 mrg @cindex @code{GIMPLE_WITH_CLEANUP_EXPR} 2346 1.1 mrg 2347 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_build_wce (gimple_seq cleanup) 2348 1.1 mrg Build a @code{GIMPLE_WITH_CLEANUP_EXPR} statement. @code{CLEANUP} is the 2349 1.1 mrg clean-up expression. 2350 1.1 mrg @end deftypefn 2351 1.1 mrg 2352 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_wce_cleanup (gimple g) 2353 1.3 mrg Return the cleanup sequence for cleanup statement @code{G}. 2354 1.1 mrg @end deftypefn 2355 1.1 mrg 2356 1.1 mrg @deftypefn {GIMPLE function} void gimple_wce_set_cleanup (gimple g, gimple_seq cleanup) 2357 1.3 mrg Set @code{CLEANUP} to be the cleanup sequence for @code{G}. 2358 1.1 mrg @end deftypefn 2359 1.1 mrg 2360 1.1 mrg @deftypefn {GIMPLE function} bool gimple_wce_cleanup_eh_only (gimple g) 2361 1.3 mrg Return the @code{CLEANUP_EH_ONLY} flag for a @code{WCE} tuple. 2362 1.1 mrg @end deftypefn 2363 1.1 mrg 2364 1.1 mrg @deftypefn {GIMPLE function} void gimple_wce_set_cleanup_eh_only (gimple g, bool eh_only_p) 2365 1.3 mrg Set the @code{CLEANUP_EH_ONLY} flag for a @code{WCE} tuple. 2366 1.1 mrg @end deftypefn 2367 1.1 mrg 2368 1.1 mrg 2369 1.3 mrg @node GIMPLE sequences 2370 1.3 mrg @section GIMPLE sequences 2371 1.3 mrg @cindex GIMPLE sequences 2372 1.1 mrg 2373 1.1 mrg GIMPLE sequences are the tuple equivalent of @code{STATEMENT_LIST}'s 2374 1.1 mrg used in @code{GENERIC}. They are used to chain statements together, and 2375 1.1 mrg when used in conjunction with sequence iterators, provide a 2376 1.1 mrg framework for iterating through statements. 2377 1.1 mrg 2378 1.1 mrg GIMPLE sequences are of type struct @code{gimple_sequence}, but are more 2379 1.1 mrg commonly passed by reference to functions dealing with sequences. 2380 1.1 mrg The type for a sequence pointer is @code{gimple_seq} which is the same 2381 1.1 mrg as struct @code{gimple_sequence} *. When declaring a local sequence, 2382 1.1 mrg you can define a local variable of type struct @code{gimple_sequence}. 2383 1.1 mrg When declaring a sequence allocated on the garbage collected 2384 1.1 mrg heap, use the function @code{gimple_seq_alloc} documented below. 2385 1.1 mrg 2386 1.1 mrg There are convenience functions for iterating through sequences 2387 1.1 mrg in the section entitled Sequence Iterators. 2388 1.1 mrg 2389 1.1 mrg Below is a list of functions to manipulate and query sequences. 2390 1.1 mrg 2391 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_add_stmt (gimple_seq *seq, gimple g) 2392 1.1 mrg Link a gimple statement to the end of the sequence *@code{SEQ} if @code{G} is 2393 1.1 mrg not @code{NULL}. If *@code{SEQ} is @code{NULL}, allocate a sequence before linking. 2394 1.1 mrg @end deftypefn 2395 1.1 mrg 2396 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_add_seq (gimple_seq *dest, gimple_seq src) 2397 1.1 mrg Append sequence @code{SRC} to the end of sequence *@code{DEST} if @code{SRC} is not 2398 1.1 mrg @code{NULL}. If *@code{DEST} is @code{NULL}, allocate a new sequence before 2399 1.1 mrg appending. 2400 1.1 mrg @end deftypefn 2401 1.1 mrg 2402 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_seq_deep_copy (gimple_seq src) 2403 1.1 mrg Perform a deep copy of sequence @code{SRC} and return the result. 2404 1.1 mrg @end deftypefn 2405 1.1 mrg 2406 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_seq_reverse (gimple_seq seq) 2407 1.1 mrg Reverse the order of the statements in the sequence @code{SEQ}. Return 2408 1.1 mrg @code{SEQ}. 2409 1.1 mrg @end deftypefn 2410 1.1 mrg 2411 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_seq_first (gimple_seq s) 2412 1.1 mrg Return the first statement in sequence @code{S}. 2413 1.1 mrg @end deftypefn 2414 1.1 mrg 2415 1.1 mrg @deftypefn {GIMPLE function} gimple gimple_seq_last (gimple_seq s) 2416 1.1 mrg Return the last statement in sequence @code{S}. 2417 1.1 mrg @end deftypefn 2418 1.1 mrg 2419 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_set_last (gimple_seq s, gimple last) 2420 1.1 mrg Set the last statement in sequence @code{S} to the statement in @code{LAST}. 2421 1.1 mrg @end deftypefn 2422 1.1 mrg 2423 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_set_first (gimple_seq s, gimple first) 2424 1.1 mrg Set the first statement in sequence @code{S} to the statement in @code{FIRST}. 2425 1.1 mrg @end deftypefn 2426 1.1 mrg 2427 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_init (gimple_seq s) 2428 1.1 mrg Initialize sequence @code{S} to an empty sequence. 2429 1.1 mrg @end deftypefn 2430 1.1 mrg 2431 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gimple_seq_alloc (void) 2432 1.1 mrg Allocate a new sequence in the garbage collected store and return 2433 1.1 mrg it. 2434 1.1 mrg @end deftypefn 2435 1.1 mrg 2436 1.1 mrg @deftypefn {GIMPLE function} void gimple_seq_copy (gimple_seq dest, gimple_seq src) 2437 1.1 mrg Copy the sequence @code{SRC} into the sequence @code{DEST}. 2438 1.1 mrg @end deftypefn 2439 1.1 mrg 2440 1.1 mrg @deftypefn {GIMPLE function} bool gimple_seq_empty_p (gimple_seq s) 2441 1.1 mrg Return true if the sequence @code{S} is empty. 2442 1.1 mrg @end deftypefn 2443 1.1 mrg 2444 1.1 mrg @deftypefn {GIMPLE function} gimple_seq bb_seq (basic_block bb) 2445 1.1 mrg Returns the sequence of statements in @code{BB}. 2446 1.1 mrg @end deftypefn 2447 1.1 mrg 2448 1.1 mrg @deftypefn {GIMPLE function} void set_bb_seq (basic_block bb, gimple_seq seq) 2449 1.1 mrg Sets the sequence of statements in @code{BB} to @code{SEQ}. 2450 1.1 mrg @end deftypefn 2451 1.1 mrg 2452 1.1 mrg @deftypefn {GIMPLE function} bool gimple_seq_singleton_p (gimple_seq seq) 2453 1.1 mrg Determine whether @code{SEQ} contains exactly one statement. 2454 1.1 mrg @end deftypefn 2455 1.1 mrg 2456 1.3 mrg @node Sequence iterators 2457 1.3 mrg @section Sequence iterators 2458 1.3 mrg @cindex Sequence iterators 2459 1.1 mrg 2460 1.1 mrg Sequence iterators are convenience constructs for iterating 2461 1.1 mrg through statements in a sequence. Given a sequence @code{SEQ}, here is 2462 1.1 mrg a typical use of gimple sequence iterators: 2463 1.1 mrg 2464 1.1 mrg @smallexample 2465 1.1 mrg gimple_stmt_iterator gsi; 2466 1.1 mrg 2467 1.1 mrg for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi)) 2468 1.1 mrg @{ 2469 1.1 mrg gimple g = gsi_stmt (gsi); 2470 1.1 mrg /* Do something with gimple statement @code{G}. */ 2471 1.1 mrg @} 2472 1.1 mrg @end smallexample 2473 1.1 mrg 2474 1.1 mrg Backward iterations are possible: 2475 1.1 mrg 2476 1.1 mrg @smallexample 2477 1.1 mrg for (gsi = gsi_last (seq); !gsi_end_p (gsi); gsi_prev (&gsi)) 2478 1.1 mrg @end smallexample 2479 1.1 mrg 2480 1.1 mrg Forward and backward iterations on basic blocks are possible with 2481 1.1 mrg @code{gsi_start_bb} and @code{gsi_last_bb}. 2482 1.1 mrg 2483 1.1 mrg In the documentation below we sometimes refer to enum 2484 1.1 mrg @code{gsi_iterator_update}. The valid options for this enumeration are: 2485 1.1 mrg 2486 1.1 mrg @itemize @bullet 2487 1.1 mrg @item @code{GSI_NEW_STMT} 2488 1.1 mrg Only valid when a single statement is added. Move the iterator to it. 2489 1.1 mrg 2490 1.1 mrg @item @code{GSI_SAME_STMT} 2491 1.1 mrg Leave the iterator at the same statement. 2492 1.1 mrg 2493 1.1 mrg @item @code{GSI_CONTINUE_LINKING} 2494 1.1 mrg Move iterator to whatever position is suitable for linking other 2495 1.1 mrg statements in the same direction. 2496 1.1 mrg @end itemize 2497 1.1 mrg 2498 1.1 mrg Below is a list of the functions used to manipulate and use 2499 1.1 mrg statement iterators. 2500 1.1 mrg 2501 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_start (gimple_seq seq) 2502 1.1 mrg Return a new iterator pointing to the sequence @code{SEQ}'s first 2503 1.1 mrg statement. If @code{SEQ} is empty, the iterator's basic block is @code{NULL}. 2504 1.1 mrg Use @code{gsi_start_bb} instead when the iterator needs to always have 2505 1.1 mrg the correct basic block set. 2506 1.1 mrg @end deftypefn 2507 1.1 mrg 2508 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_start_bb (basic_block bb) 2509 1.1 mrg Return a new iterator pointing to the first statement in basic 2510 1.1 mrg block @code{BB}. 2511 1.1 mrg @end deftypefn 2512 1.1 mrg 2513 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_last (gimple_seq seq) 2514 1.1 mrg Return a new iterator initially pointing to the last statement of 2515 1.1 mrg sequence @code{SEQ}. If @code{SEQ} is empty, the iterator's basic block is 2516 1.1 mrg @code{NULL}. Use @code{gsi_last_bb} instead when the iterator needs to always 2517 1.1 mrg have the correct basic block set. 2518 1.1 mrg @end deftypefn 2519 1.1 mrg 2520 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_last_bb (basic_block bb) 2521 1.1 mrg Return a new iterator pointing to the last statement in basic 2522 1.1 mrg block @code{BB}. 2523 1.1 mrg @end deftypefn 2524 1.1 mrg 2525 1.1 mrg @deftypefn {GIMPLE function} bool gsi_end_p (gimple_stmt_iterator i) 2526 1.1 mrg Return @code{TRUE} if at the end of @code{I}. 2527 1.1 mrg @end deftypefn 2528 1.1 mrg 2529 1.1 mrg @deftypefn {GIMPLE function} bool gsi_one_before_end_p (gimple_stmt_iterator i) 2530 1.1 mrg Return @code{TRUE} if we're one statement before the end of @code{I}. 2531 1.1 mrg @end deftypefn 2532 1.1 mrg 2533 1.1 mrg @deftypefn {GIMPLE function} void gsi_next (gimple_stmt_iterator *i) 2534 1.1 mrg Advance the iterator to the next gimple statement. 2535 1.1 mrg @end deftypefn 2536 1.1 mrg 2537 1.1 mrg @deftypefn {GIMPLE function} void gsi_prev (gimple_stmt_iterator *i) 2538 1.1 mrg Advance the iterator to the previous gimple statement. 2539 1.1 mrg @end deftypefn 2540 1.1 mrg 2541 1.1 mrg @deftypefn {GIMPLE function} gimple gsi_stmt (gimple_stmt_iterator i) 2542 1.1 mrg Return the current stmt. 2543 1.1 mrg @end deftypefn 2544 1.1 mrg 2545 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_after_labels (basic_block bb) 2546 1.1 mrg Return a block statement iterator that points to the first 2547 1.1 mrg non-label statement in block @code{BB}. 2548 1.1 mrg @end deftypefn 2549 1.1 mrg 2550 1.3 mrg @deftypefn {GIMPLE function} {gimple *} gsi_stmt_ptr (gimple_stmt_iterator *i) 2551 1.1 mrg Return a pointer to the current stmt. 2552 1.1 mrg @end deftypefn 2553 1.1 mrg 2554 1.1 mrg @deftypefn {GIMPLE function} basic_block gsi_bb (gimple_stmt_iterator i) 2555 1.1 mrg Return the basic block associated with this iterator. 2556 1.1 mrg @end deftypefn 2557 1.1 mrg 2558 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gsi_seq (gimple_stmt_iterator i) 2559 1.1 mrg Return the sequence associated with this iterator. 2560 1.1 mrg @end deftypefn 2561 1.1 mrg 2562 1.1 mrg @deftypefn {GIMPLE function} void gsi_remove (gimple_stmt_iterator *i, bool remove_eh_info) 2563 1.1 mrg Remove the current stmt from the sequence. The iterator is 2564 1.1 mrg updated to point to the next statement. When @code{REMOVE_EH_INFO} is 2565 1.1 mrg true we remove the statement pointed to by iterator @code{I} from the @code{EH} 2566 1.1 mrg tables. Otherwise we do not modify the @code{EH} tables. Generally, 2567 1.1 mrg @code{REMOVE_EH_INFO} should be true when the statement is going to be 2568 1.1 mrg removed from the @code{IL} and not reinserted elsewhere. 2569 1.1 mrg @end deftypefn 2570 1.1 mrg 2571 1.1 mrg @deftypefn {GIMPLE function} void gsi_link_seq_before (gimple_stmt_iterator *i, gimple_seq seq, enum gsi_iterator_update mode) 2572 1.1 mrg Links the sequence of statements @code{SEQ} before the statement pointed 2573 1.1 mrg by iterator @code{I}. @code{MODE} indicates what to do with the iterator 2574 1.1 mrg after insertion (see @code{enum gsi_iterator_update} above). 2575 1.1 mrg @end deftypefn 2576 1.1 mrg 2577 1.1 mrg @deftypefn {GIMPLE function} void gsi_link_before (gimple_stmt_iterator *i, gimple g, enum gsi_iterator_update mode) 2578 1.1 mrg Links statement @code{G} before the statement pointed-to by iterator @code{I}. 2579 1.1 mrg Updates iterator @code{I} according to @code{MODE}. 2580 1.1 mrg @end deftypefn 2581 1.1 mrg 2582 1.3 mrg @deftypefn {GIMPLE function} void gsi_link_seq_after (gimple_stmt_iterator *i, @ 2583 1.3 mrg gimple_seq seq, enum gsi_iterator_update mode) 2584 1.1 mrg Links sequence @code{SEQ} after the statement pointed-to by iterator @code{I}. 2585 1.1 mrg @code{MODE} is as in @code{gsi_insert_after}. 2586 1.1 mrg @end deftypefn 2587 1.1 mrg 2588 1.3 mrg @deftypefn {GIMPLE function} void gsi_link_after (gimple_stmt_iterator *i, @ 2589 1.3 mrg gimple g, enum gsi_iterator_update mode) 2590 1.1 mrg Links statement @code{G} after the statement pointed-to by iterator @code{I}. 2591 1.1 mrg @code{MODE} is as in @code{gsi_insert_after}. 2592 1.1 mrg @end deftypefn 2593 1.1 mrg 2594 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gsi_split_seq_after (gimple_stmt_iterator i) 2595 1.1 mrg Move all statements in the sequence after @code{I} to a new sequence. 2596 1.1 mrg Return this new sequence. 2597 1.1 mrg @end deftypefn 2598 1.1 mrg 2599 1.1 mrg @deftypefn {GIMPLE function} gimple_seq gsi_split_seq_before (gimple_stmt_iterator *i) 2600 1.1 mrg Move all statements in the sequence before @code{I} to a new sequence. 2601 1.1 mrg Return this new sequence. 2602 1.1 mrg @end deftypefn 2603 1.1 mrg 2604 1.3 mrg @deftypefn {GIMPLE function} void gsi_replace (gimple_stmt_iterator *i, @ 2605 1.3 mrg gimple stmt, bool update_eh_info) 2606 1.1 mrg Replace the statement pointed-to by @code{I} to @code{STMT}. If @code{UPDATE_EH_INFO} 2607 1.1 mrg is true, the exception handling information of the original 2608 1.1 mrg statement is moved to the new statement. 2609 1.1 mrg @end deftypefn 2610 1.1 mrg 2611 1.3 mrg @deftypefn {GIMPLE function} void gsi_insert_before (gimple_stmt_iterator *i, @ 2612 1.3 mrg gimple stmt, enum gsi_iterator_update mode) 2613 1.1 mrg Insert statement @code{STMT} before the statement pointed-to by iterator 2614 1.1 mrg @code{I}, update @code{STMT}'s basic block and scan it for new operands. @code{MODE} 2615 1.1 mrg specifies how to update iterator @code{I} after insertion (see enum 2616 1.1 mrg @code{gsi_iterator_update}). 2617 1.1 mrg @end deftypefn 2618 1.1 mrg 2619 1.3 mrg @deftypefn {GIMPLE function} void gsi_insert_seq_before (gimple_stmt_iterator *i, @ 2620 1.3 mrg gimple_seq seq, enum gsi_iterator_update mode) 2621 1.1 mrg Like @code{gsi_insert_before}, but for all the statements in @code{SEQ}. 2622 1.1 mrg @end deftypefn 2623 1.1 mrg 2624 1.3 mrg @deftypefn {GIMPLE function} void gsi_insert_after (gimple_stmt_iterator *i, @ 2625 1.3 mrg gimple stmt, enum gsi_iterator_update mode) 2626 1.1 mrg Insert statement @code{STMT} after the statement pointed-to by iterator 2627 1.1 mrg @code{I}, update @code{STMT}'s basic block and scan it for new operands. @code{MODE} 2628 1.1 mrg specifies how to update iterator @code{I} after insertion (see enum 2629 1.1 mrg @code{gsi_iterator_update}). 2630 1.1 mrg @end deftypefn 2631 1.1 mrg 2632 1.3 mrg @deftypefn {GIMPLE function} void gsi_insert_seq_after (gimple_stmt_iterator *i, @ 2633 1.3 mrg gimple_seq seq, enum gsi_iterator_update mode) 2634 1.1 mrg Like @code{gsi_insert_after}, but for all the statements in @code{SEQ}. 2635 1.1 mrg @end deftypefn 2636 1.1 mrg 2637 1.1 mrg @deftypefn {GIMPLE function} gimple_stmt_iterator gsi_for_stmt (gimple stmt) 2638 1.1 mrg Finds iterator for @code{STMT}. 2639 1.1 mrg @end deftypefn 2640 1.1 mrg 2641 1.3 mrg @deftypefn {GIMPLE function} void gsi_move_after (gimple_stmt_iterator *from, @ 2642 1.3 mrg gimple_stmt_iterator *to) 2643 1.1 mrg Move the statement at @code{FROM} so it comes right after the statement 2644 1.1 mrg at @code{TO}. 2645 1.1 mrg @end deftypefn 2646 1.1 mrg 2647 1.3 mrg @deftypefn {GIMPLE function} void gsi_move_before (gimple_stmt_iterator *from, @ 2648 1.3 mrg gimple_stmt_iterator *to) 2649 1.1 mrg Move the statement at @code{FROM} so it comes right before the statement 2650 1.1 mrg at @code{TO}. 2651 1.1 mrg @end deftypefn 2652 1.1 mrg 2653 1.3 mrg @deftypefn {GIMPLE function} void gsi_move_to_bb_end (gimple_stmt_iterator *from, @ 2654 1.3 mrg basic_block bb) 2655 1.1 mrg Move the statement at @code{FROM} to the end of basic block @code{BB}. 2656 1.1 mrg @end deftypefn 2657 1.1 mrg 2658 1.1 mrg @deftypefn {GIMPLE function} void gsi_insert_on_edge (edge e, gimple stmt) 2659 1.1 mrg Add @code{STMT} to the pending list of edge @code{E}. No actual insertion is 2660 1.1 mrg made until a call to @code{gsi_commit_edge_inserts}() is made. 2661 1.1 mrg @end deftypefn 2662 1.1 mrg 2663 1.1 mrg @deftypefn {GIMPLE function} void gsi_insert_seq_on_edge (edge e, gimple_seq seq) 2664 1.1 mrg Add the sequence of statements in @code{SEQ} to the pending list of edge 2665 1.1 mrg @code{E}. No actual insertion is made until a call to 2666 1.1 mrg @code{gsi_commit_edge_inserts}() is made. 2667 1.1 mrg @end deftypefn 2668 1.1 mrg 2669 1.1 mrg @deftypefn {GIMPLE function} basic_block gsi_insert_on_edge_immediate (edge e, gimple stmt) 2670 1.1 mrg Similar to @code{gsi_insert_on_edge}+@code{gsi_commit_edge_inserts}. If a new 2671 1.1 mrg block has to be created, it is returned. 2672 1.1 mrg @end deftypefn 2673 1.1 mrg 2674 1.1 mrg @deftypefn {GIMPLE function} void gsi_commit_one_edge_insert (edge e, basic_block *new_bb) 2675 1.1 mrg Commit insertions pending at edge @code{E}. If a new block is created, 2676 1.1 mrg set @code{NEW_BB} to this block, otherwise set it to @code{NULL}. 2677 1.1 mrg @end deftypefn 2678 1.1 mrg 2679 1.1 mrg @deftypefn {GIMPLE function} void gsi_commit_edge_inserts (void) 2680 1.1 mrg This routine will commit all pending edge insertions, creating 2681 1.1 mrg any new basic blocks which are necessary. 2682 1.1 mrg @end deftypefn 2683 1.1 mrg 2684 1.1 mrg 2685 1.1 mrg @node Adding a new GIMPLE statement code 2686 1.1 mrg @section Adding a new GIMPLE statement code 2687 1.1 mrg @cindex Adding a new GIMPLE statement code 2688 1.1 mrg 2689 1.1 mrg The first step in adding a new GIMPLE statement code, is 2690 1.1 mrg modifying the file @code{gimple.def}, which contains all the GIMPLE 2691 1.6 mrg codes. Then you must add a corresponding gimple subclass 2692 1.5 mrg located in @code{gimple.h}. This in turn, will require you to add a 2693 1.5 mrg corresponding @code{GTY} tag in @code{gsstruct.def}, and code to handle 2694 1.12 mrg this tag in @code{gss_for_code} which is located in @code{gimple.cc}. 2695 1.1 mrg 2696 1.1 mrg In order for the garbage collector to know the size of the 2697 1.1 mrg structure you created in @code{gimple.h}, you need to add a case to 2698 1.1 mrg handle your new GIMPLE statement in @code{gimple_size} which is located 2699 1.12 mrg in @code{gimple.cc}. 2700 1.1 mrg 2701 1.1 mrg You will probably want to create a function to build the new 2702 1.12 mrg gimple statement in @code{gimple.cc}. The function should be called 2703 1.3 mrg @code{gimple_build_@var{new-tuple-name}}, and should return the new tuple 2704 1.6 mrg as a pointer to the appropriate gimple subclass. 2705 1.1 mrg 2706 1.1 mrg If your new statement requires accessors for any members or 2707 1.1 mrg operands it may have, put simple inline accessors in 2708 1.12 mrg @code{gimple.h} and any non-trivial accessors in @code{gimple.cc} with a 2709 1.1 mrg corresponding prototype in @code{gimple.h}. 2710 1.1 mrg 2711 1.5 mrg You should add the new statement subclass to the class hierarchy diagram 2712 1.5 mrg in @code{gimple.texi}. 2713 1.5 mrg 2714 1.1 mrg 2715 1.1 mrg @node Statement and operand traversals 2716 1.1 mrg @section Statement and operand traversals 2717 1.1 mrg @cindex Statement and operand traversals 2718 1.3 mrg 2719 1.1 mrg There are two functions available for walking statements and 2720 1.1 mrg sequences: @code{walk_gimple_stmt} and @code{walk_gimple_seq}, 2721 1.1 mrg accordingly, and a third function for walking the operands in a 2722 1.1 mrg statement: @code{walk_gimple_op}. 2723 1.1 mrg 2724 1.3 mrg @deftypefn {GIMPLE function} tree walk_gimple_stmt (gimple_stmt_iterator *gsi, @ 2725 1.3 mrg walk_stmt_fn callback_stmt, walk_tree_fn callback_op, struct walk_stmt_info *wi) 2726 1.1 mrg This function is used to walk the current statement in @code{GSI}, 2727 1.1 mrg optionally using traversal state stored in @code{WI}. If @code{WI} is @code{NULL}, no 2728 1.1 mrg state is kept during the traversal. 2729 1.1 mrg 2730 1.1 mrg The callback @code{CALLBACK_STMT} is called. If @code{CALLBACK_STMT} returns 2731 1.1 mrg true, it means that the callback function has handled all the 2732 1.1 mrg operands of the statement and it is not necessary to walk its 2733 1.1 mrg operands. 2734 1.1 mrg 2735 1.1 mrg If @code{CALLBACK_STMT} is @code{NULL} or it returns false, @code{CALLBACK_OP} is 2736 1.1 mrg called on each operand of the statement via @code{walk_gimple_op}. If 2737 1.1 mrg @code{walk_gimple_op} returns non-@code{NULL} for any operand, the remaining 2738 1.1 mrg operands are not scanned. 2739 1.1 mrg 2740 1.1 mrg The return value is that returned by the last call to 2741 1.1 mrg @code{walk_gimple_op}, or @code{NULL_TREE} if no @code{CALLBACK_OP} is specified. 2742 1.1 mrg @end deftypefn 2743 1.1 mrg 2744 1.1 mrg 2745 1.3 mrg @deftypefn {GIMPLE function} tree walk_gimple_op (gimple stmt, @ 2746 1.3 mrg walk_tree_fn callback_op, struct walk_stmt_info *wi) 2747 1.1 mrg Use this function to walk the operands of statement @code{STMT}. Every 2748 1.1 mrg operand is walked via @code{walk_tree} with optional state information 2749 1.1 mrg in @code{WI}. 2750 1.1 mrg 2751 1.1 mrg @code{CALLBACK_OP} is called on each operand of @code{STMT} via @code{walk_tree}. 2752 1.1 mrg Additional parameters to @code{walk_tree} must be stored in @code{WI}. For 2753 1.1 mrg each operand @code{OP}, @code{walk_tree} is called as: 2754 1.1 mrg 2755 1.1 mrg @smallexample 2756 1.3 mrg walk_tree (&@code{OP}, @code{CALLBACK_OP}, @code{WI}, @code{PSET}) 2757 1.1 mrg @end smallexample 2758 1.1 mrg 2759 1.1 mrg If @code{CALLBACK_OP} returns non-@code{NULL} for an operand, the remaining 2760 1.1 mrg operands are not scanned. The return value is that returned by 2761 1.1 mrg the last call to @code{walk_tree}, or @code{NULL_TREE} if no @code{CALLBACK_OP} is 2762 1.1 mrg specified. 2763 1.1 mrg @end deftypefn 2764 1.1 mrg 2765 1.1 mrg 2766 1.3 mrg @deftypefn {GIMPLE function} tree walk_gimple_seq (gimple_seq seq, @ 2767 1.3 mrg walk_stmt_fn callback_stmt, walk_tree_fn callback_op, struct walk_stmt_info *wi) 2768 1.1 mrg This function walks all the statements in the sequence @code{SEQ} 2769 1.1 mrg calling @code{walk_gimple_stmt} on each one. @code{WI} is as in 2770 1.1 mrg @code{walk_gimple_stmt}. If @code{walk_gimple_stmt} returns non-@code{NULL}, the walk 2771 1.1 mrg is stopped and the value returned. Otherwise, all the statements 2772 1.1 mrg are walked and @code{NULL_TREE} returned. 2773 1.1 mrg @end deftypefn 2774