]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gccint/gimple-api.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / gimple-api.rst
CommitLineData
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
10GIMPLE 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
23thus providing n-ary overloads for operation or function. The
24additional arguments are a gimple_seq where built statements are
25inserted on (if ``NULL`` then simplifications requiring new statements
26are not performed) and a valueization hook that can be used to
27tie simplifications to a SSA lattice.
28
29In addition to those APIs ``fold_stmt`` is overloaded with
30a valueization hook:
31
32.. function:: fold_stmt (gimple_stmt_iterator *, tree (*)(tree));
33
34On 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
44which is supposed to replace ``force_gimple_operand (fold_buildN (...), ...)``
45and calls to ``fold_convert``. Overloads without the ``location_t``
46argument exist. Built statements are inserted on the provided sequence
3ed1b4ce 47and simplification is performed using the optional valueization hook.