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