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