GCC Middle and Back End API Reference
gimplify.h
Go to the documentation of this file.
1/* Header file for gimplification.
2 Copyright (C) 2013-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
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. */
26typedef bool (*gimple_predicate)(tree);
27
28/* FIXME we should deduce this from the predicate. */
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. */
41};
42
43typedef int fallback_t;
44
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};
51
52extern void free_gimplify_stack (void);
53extern void push_gimplify_context (bool in_ssa = false,
54 bool rhs_cond_ok = false);
55extern void pop_gimplify_context (gimple *);
56extern gbind *gimple_current_bind_expr (void);
58extern void gimplify_and_add (tree, gimple_seq *);
61 bool = true);
62extern void declare_vars (tree, gimple *, bool);
63extern void gimple_add_tmp_var (tree);
64extern void gimple_add_tmp_var_fn (struct function *, tree);
66extern tree build_and_jump (tree *);
68 gimple_seq *, bool, tree);
69extern tree gimple_boolify (tree);
71extern bool gimplify_stmt (tree *, gimple_seq *);
74 bool (*) (tree), fallback_t);
75
77int omp_has_novariants (void);
78
80 gimple_seq * = NULL);
82
83extern void gimplify_type_sizes (tree, gimple_seq *);
84extern void gimplify_one_sizepos (tree *, gimple_seq *);
85extern gbind *gimplify_body (tree, bool);
86extern enum gimplify_status gimplify_arg (tree *, gimple_seq *, location_t,
87 bool = true);
88extern void gimplify_function_tree (tree);
90 gimple_seq *);
93
94#endif /* GCC_GIMPLIFY_H */
Definition genmatch.cc:1625
gimple * gimple_seq
Definition coretypes.h:100
union tree_node * tree
Definition coretypes.h:97
bool(*) gimple_predicate(tree)
Definition gimplify-me.h:26
enum gimplify_status gimplify_self_mod_expr(tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, bool want_value, tree arith_type)
Definition gimplify.cc:3623
enum gimplify_status gimplify_arg(tree *arg_p, gimple_seq *pre_p, location_t call_location, bool allow_ssa)
Definition gimplify.cc:3738
enum gimplify_status gimplify_va_arg_expr(tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
Definition gimplify.cc:22169
gbind * gimple_current_bind_expr(void)
Definition gimplify.cc:448
tree get_formal_tmp_var(tree val, gimple_seq *pre_p)
Definition gimplify.cc:741
static gimple_seq * enter_omp_iterator_loop_context(tree c, gimple_seq *loops_seq_p, gimple_seq *alt_seq_p)
Definition gimplify.cc:10241
int omp_has_novariants(void)
Definition gimplify.cc:16528
void push_gimplify_context(bool in_ssa, bool rhs_cond_ok)
Definition gimplify.cc:391
bool generic_expr_could_trap_p(tree expr)
Definition gimplify.cc:5392
void gimplify_one_sizepos(tree *expr_p, gimple_seq *stmt_p)
Definition gimplify.cc:21751
gimple * gimplify_assign(tree dst, tree src, gimple_seq *seq_p)
Definition gimplify.cc:22255
void gimplify_and_add(tree t, gimple_seq *seq_p)
Definition gimplify.cc:556
void declare_vars(tree vars, gimple *gs, bool debug_info)
Definition gimplify.cc:761
void pop_gimplify_context(gimple *body)
Definition gimplify.cc:408
void gimple_add_tmp_var_fn(struct function *fn, tree tmp)
Definition gimplify.cc:824
tree get_initialized_tmp_var(tree val, gimple_seq *pre_p, gimple_seq *post_p, bool allow_ssa)
Definition gimplify.cc:750
void gimplify_function_tree(tree fndecl)
Definition gimplify.cc:22006
gbind * gimplify_body(tree fndecl, bool do_parms)
Definition gimplify.cc:21784
gimple_predicate rhs_predicate_for(tree lhs)
Definition gimplify.cc:6167
void free_gimplify_stack(void)
Definition gimplify.cc:376
tree build_and_jump(tree *label_p)
Definition gimplify.cc:3093
vec< gbind * > gimple_bind_expr_stack(void)
Definition gimplify.cc:456
void gimplify_type_sizes(tree type, gimple_seq *list_p)
Definition gimplify.cc:21639
bool gimplify_stmt(tree *stmt_p, gimple_seq *seq_p)
Definition gimplify.cc:8572
void omp_firstprivatize_variable(struct gimplify_omp_ctx *ctx, tree decl)
Definition gimplify.cc:8586
tree gimple_boolify(tree expr)
Definition gimplify.cc:5270
tree voidify_wrapper_expr(tree wrapper, tree temp)
Definition gimplify.cc:1019
tree omp_get_construct_context(void)
Definition gimplify.cc:16586
void exit_omp_iterator_loop_context(tree c)
Definition gimplify.cc:10270
void gimple_add_tmp_var(tree tmp)
Definition gimplify.cc:843
enum gimplify_status gimplify_expr(tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, bool(*gimple_test_f)(tree), fallback_t fallback)
Definition gimplify.cc:20328
int fallback_t
Definition gimplify.h:43
fallback
Definition gimplify.h:29
@ fb_lvalue
Definition gimplify.h:35
@ fb_either
Definition gimplify.h:40
@ fb_rvalue
Definition gimplify.h:32
@ fb_none
Definition gimplify.h:30
@ fb_mayfail
Definition gimplify.h:38
gimplify_status
Definition gimplify.h:45
@ GS_OK
Definition gimplify.h:48
@ GS_ERROR
Definition gimplify.h:46
@ GS_UNHANDLED
Definition gimplify.h:47
@ GS_ALL_DONE
Definition gimplify.h:49
Definition function.h:249
Definition gimple.h:392
Definition gimple.h:224
Definition gimplify.cc:281
Definition gimple.h:664
Definition vec.h:450
#define NULL
Definition system.h:58
#define bool
Definition system.h:891