]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: GIMPLE API | |
7 | ||
8 | .. _gimple-api: | |
9 | ||
10 | GIMPLE API | |
11 | ********** | |
12 | ||
13 | .. function:: tree gimple_simplify (enum tree_code, tree, tree, gimple_seq *, tree (*)(tree)) | |
14 | tree gimple_simplify (enum tree_code, tree, tree, tree, gimple_seq *, tree (*)(tree)) | |
15 | tree gimple_simplify (enum tree_code, tree, tree, tree, tree, gimple_seq *, tree (*)(tree)) | |
16 | tree gimple_simplify (enum built_in_function, tree, tree, gimple_seq *, tree (*)(tree)) | |
17 | tree gimple_simplify (enum built_in_function, tree, tree, tree, gimple_seq *, tree (*)(tree)) | |
18 | tree gimple_simplify (enum built_in_function, tree, tree, tree, tree, gimple_seq *, tree (*)(tree)) | |
19 | ||
20 | The main GIMPLE API entry to the expression simplifications mimicking | |
21 | that of the GENERIC fold_{unary,binary,ternary} functions. | |
22 | ||
23 | thus providing n-ary overloads for operation or function. The | |
24 | additional arguments are a gimple_seq where built statements are | |
25 | inserted on (if ``NULL`` then simplifications requiring new statements | |
26 | are not performed) and a valueization hook that can be used to | |
27 | tie simplifications to a SSA lattice. | |
28 | ||
29 | In addition to those APIs ``fold_stmt`` is overloaded with | |
30 | a valueization hook: | |
31 | ||
32 | .. function:: fold_stmt (gimple_stmt_iterator *, tree (*)(tree)); | |
33 | ||
34 | On top of these a ``fold_buildN`` -like API for GIMPLE is introduced: | |
35 | ||
36 | .. function:: tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree (*valueize) (tree) = NULL); | |
37 | tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree, tree (*valueize) (tree) = NULL); | |
38 | tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree, tree, tree (*valueize) (tree) = NULL); | |
39 | tree gimple_build (gimple_seq *, location_t, enum built_in_function, tree, tree, tree (*valueize) (tree) = NULL); | |
40 | tree gimple_build (gimple_seq *, location_t, enum built_in_function, tree, tree, tree, tree (*valueize) (tree) = NULL); | |
41 | tree gimple_build (gimple_seq *, location_t, enum built_in_function, tree, tree, tree, tree, tree (*valueize) (tree) = NULL); | |
42 | tree gimple_convert (gimple_seq *, location_t, tree, tree); | |
43 | ||
44 | which is supposed to replace ``force_gimple_operand (fold_buildN (...), ...)`` | |
45 | and calls to ``fold_convert``. Overloads without the ``location_t`` | |
46 | argument exist. Built statements are inserted on the provided sequence | |
3ed1b4ce | 47 | and simplification is performed using the optional valueization hook. |