]>
Commit | Line | Data |
---|---|---|
45b0be94 | 1 | /* Header file for gimplification. |
7adcbafe | 2 | Copyright (C) 2013-2022 Free Software Foundation, Inc. |
45b0be94 AM |
3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #ifndef GCC_GIMPLIFY_H | |
21 | #define GCC_GIMPLIFY_H | |
22 | ||
45b0be94 AM |
23 | /* Validation of GIMPLE expressions. Note that these predicates only check |
24 | the basic form of the expression, they don't recurse to make sure that | |
25 | underlying nodes are also of the right form. */ | |
26 | typedef bool (*gimple_predicate)(tree); | |
27 | ||
28 | /* FIXME we should deduce this from the predicate. */ | |
29 | enum fallback { | |
30 | fb_none = 0, /* Do not generate a temporary. */ | |
31 | ||
32 | fb_rvalue = 1, /* Generate an rvalue to hold the result of a | |
33 | gimplified expression. */ | |
34 | ||
35 | fb_lvalue = 2, /* Generate an lvalue to hold the result of a | |
36 | gimplified expression. */ | |
37 | ||
38 | fb_mayfail = 4, /* Gimplification may fail. Error issued | |
39 | afterwards. */ | |
40 | fb_either= fb_rvalue | fb_lvalue | |
41 | }; | |
42 | ||
43 | typedef int fallback_t; | |
44 | ||
45 | enum gimplify_status { | |
46 | GS_ERROR = -2, /* Something Bad Seen. */ | |
47 | GS_UNHANDLED = -1, /* A langhook result for "I dunno". */ | |
48 | GS_OK = 0, /* We did something, maybe more to do. */ | |
49 | GS_ALL_DONE = 1 /* The expression is fully gimplified. */ | |
50 | }; | |
18f429e2 | 51 | |
45852dcc AM |
52 | extern void free_gimplify_stack (void); |
53 | extern void push_gimplify_context (bool in_ssa = false, | |
54 | bool rhs_cond_ok = false); | |
355fe088 | 55 | extern void pop_gimplify_context (gimple *); |
538dd0b7 DM |
56 | extern gbind *gimple_current_bind_expr (void); |
57 | extern vec<gbind *> gimple_bind_expr_stack (void); | |
45b0be94 AM |
58 | extern void gimplify_and_add (tree, gimple_seq *); |
59 | extern tree get_formal_tmp_var (tree, gimple_seq *); | |
8e5993e2 | 60 | extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq * = NULL, |
381cdae4 | 61 | bool = true); |
355fe088 | 62 | extern void declare_vars (tree, gimple *, bool); |
45b0be94 | 63 | extern void gimple_add_tmp_var (tree); |
45b62594 | 64 | extern void gimple_add_tmp_var_fn (struct function *, tree); |
640b23d7 | 65 | extern void copy_if_shared (tree *, void * = NULL); |
45b0be94 AM |
66 | extern tree unshare_expr (tree); |
67 | extern tree unshare_expr_without_location (tree); | |
68 | extern tree voidify_wrapper_expr (tree, tree); | |
69 | extern tree build_and_jump (tree *); | |
70 | extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, | |
71 | gimple_seq *, bool, tree); | |
72 | extern tree gimple_boolify (tree); | |
18f429e2 | 73 | extern gimple_predicate rhs_predicate_for (tree); |
45b0be94 AM |
74 | extern bool gimplify_stmt (tree *, gimple_seq *); |
75 | extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree); | |
76 | extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *, | |
77 | bool (*) (tree), fallback_t); | |
78 | ||
d0c464d2 | 79 | int omp_construct_selector_matches (enum tree_code *, int, int *); |
135df52c | 80 | |
45b0be94 AM |
81 | extern void gimplify_type_sizes (tree, gimple_seq *); |
82 | extern void gimplify_one_sizepos (tree *, gimple_seq *); | |
538dd0b7 | 83 | extern gbind *gimplify_body (tree, bool); |
381cdae4 RB |
84 | extern enum gimplify_status gimplify_arg (tree *, gimple_seq *, location_t, |
85 | bool = true); | |
45b0be94 | 86 | extern void gimplify_function_tree (tree); |
45b0be94 AM |
87 | extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *, |
88 | gimple_seq *); | |
3f6f3319 | 89 | extern bool generic_expr_could_trap_p (tree expr); |
355fe088 | 90 | gimple *gimplify_assign (tree, tree, gimple_seq *); |
45b0be94 AM |
91 | |
92 | #endif /* GCC_GIMPLIFY_H */ |