diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 20:26:43 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 20:26:43 +0000 |
commit | a8783bee0f1128c01d3768789a03b60b5a6ebd99 (patch) | |
tree | ec5ecce5dd0b07212d3416eab7b065b138ed7577 /gcc/gimplify.h | |
parent | 2873e7a09ea37c5a6d10e27cf44993e97f9b7b7f (diff) | |
download | gcc-a8783bee0f1128c01d3768789a03b60b5a6ebd99.tar.gz |
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
* gimple-expr.h (create_tmp_var_name, create_tmp_var_raw,
create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs):
Relocate prototypes from gimple.h.
* gimplify.h: New File. Relocate some prototypes from gimple.h here.
(gimple_predicate, enum fallback, enum gimplify_status): Relocate
from gimple.h.
* gimple.h: Move some prototypes to gimplify.h.
(gimple_predicate, enum fallback, enum gimplify_status): Move to
gimplify.h.
(gimple_do_not_emit_location_p, gimple_set_do_not_emit_location):
Relocate from gimpify.c.
* gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name,
create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable,
is_gimple_reg_rhs) Relocate from gimplify.c.
* gimplify.c (mark_addressable): Move to gimple-expr.c.
(gimple_seq_add_stmt_without_update): Move to gimple.c.
(remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw,
create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to
gimple-expr.c.
(should_carry_location_p): Move to gimple.c.
(gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move
to gimple.h.
(annotate_one_with_location, annotate_all_with_location_after,
annotate_all_with_location): Move to gimple.c.
(compare_case_labels, sort_case_labels,
preprocess_case_label_vec_for_gimple): Move to gimple.c.
(rhs_predicate_for): Make static.
(gimplify_assign): Relocate from gimple.c.
* gimple.c (gimplify_assign): Move to gimplify.c.
(gimple_seq_add_stmt_without_update, should_carry_location_p,
annotate_one_with_location, annotate_all_with_location_after,
annotate_all_with_location, compare_case_labels, sort_case_labels,
preprocess_case_label_vec_for_gimple): Relocate from gimplify.c.
* tree.h (unshare_expr, unshare_expr_without_location,
mark_addressable): Move prototypes to gimplify.h.
* Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for
tmp_var_id_num
* asan.c: Include gimplify.h rather than gimple.h.
* cfgloopmanip.c: Likewise.
* cgraphunit.c: Likewise.
* cilk-common.c: Likewise.
* dwarf2out.c: Dont include gimple.h.
* fold-const.c: Include gimplify.h rather than gimple.h.
* function.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* graphite-clast-to-gimple.c: Likewise.
* graphite-sese-to-poly.c: Likewise.
* ipa-prop.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* langhooks.c: Dont include gimple.h.
* loop-init.c: Include gimplify.h rather than gimple.h.
* omp-low.c: Likewise.
* sese.c: Likewise.
* stor-layout.c: Likewise.
* targhooks.c: Likewise.
* trans-mem.c: Likewise.
* tree-affine.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-complex.c: Likewise.
* tree-if-conv.c: Likewise.
* tree-inline.c: Likewise.
* tree-iterator.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-nested.c: Likewise.
* tree-parloops.c: Likewise.
* tree-predcom.c: Likewise.
* tree-profile.c: Likewise.
* tree-scalar-evolution.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-address.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-dce.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-ifcombine.c: Likewise.
* tree-ssa-loop-im.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-manip.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-ssa-loop-prefetch.c: Likewise.
* tree-ssa-loop-unswitch.c: Likewise.
* tree-ssa-math-opts.c: Likewise.
* tree-ssa-phiopt.c: Likewise.
* tree-ssa-phiprop.c: Likewise.
* tree-ssa-pre.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-reassoc.c: Likewise.
* tree-ssa-sccvn.c: Likewise.
* tree-ssa-strlen.c: Likewise.
* tree-ssa.c: Likewise.
* tree-switch-conversio: Likewise.n.c
* tree-tailcall.c: Likewise.
* tree-vect-data-refs.c: Likewise.
* tree-vect-generic.c: Likewise.
* tree-vect-loop-manip.c: Likewise.
* tree-vect-loop.c: Likewise.
* tree-vect-patterns.c: Likewise.
* tree-vect-stmts.c: Likewise.
* tsan.c: Likewise.
* value-prof.c: Likewise.
* config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h.
* config/alpha/alpha.c: Likewise.
* config/darwin.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/mep/mep.c: Likewise.
* config/mips/mips.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/s390/s390.c: Likewise.
* config/sh/sh.c: Likewise.
* config/sparc/sparc.c: Likewise.
* config/spu/spu.c: Likewise.
* config/stormy16/stormy16.c: Likewise.
* config/tilegx/tilegx.c: Likewise.
* config/tilepro/tilepro.c: Likewise.
* config/xtensa/xtensa.c: Likewise.
* ada/gcc-interface/trans.c: Include gimplify.h.
* c/c-typeck.c: Include gimplify.h.
* c-family/c-common.c: Include gimplify.h.
* c-family/c-gimplify.c: Likewise.
* c-family/cilk.c: Likewise.
* c-family/c-omp.c: Include gimple-expr.h instead of gimple.h.
* c-family/c-ubsan.c: Don't include gimple.h.
* cp/class.c: Include gimplify.h.
* cp/cp-gimplify.c: Likewise.
* cp/error.c: Likewise.
* cp/init.c: Likewise.
* cp/optimize.c: Likewise.
* cp/pt.c: Likewise.
* cp/semantics.c: Likewise.
* cp/tree.c: Likewise.
* cp/vtable-class-hierarchy.c: Likewise.
* cp/decl2.c: Don't include gimple.h.
* cp/except.c: Likewise.
* cp/method.c: Include pointer-set.h instead of gimple.h.
* fortran/f95-lang.c: Don't include gimple.h.
* fortran/trans-array.c: Include gimple-expr.h instead of gimple.h.
* fortran/trans.c: Likewise.
* fortran/trans-decl.c: Likewise.
* fortran/trans-expr.c: Include gimplify.h.
* fortran/trans-openmp.c: Likewise.
* go/go-lang.c: Include gimplify.h.
* java/java-gimplify.c: Include gimplify.h.
* objc/objc-act.c: Include gimplify.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204717 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.h')
-rw-r--r-- | gcc/gimplify.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/gcc/gimplify.h b/gcc/gimplify.h new file mode 100644 index 00000000000..5f81cf2fe77 --- /dev/null +++ b/gcc/gimplify.h @@ -0,0 +1,92 @@ +/* Header file for gimplification. + Copyright (C) 2013 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#ifndef GCC_GIMPLIFY_H +#define GCC_GIMPLIFY_H + +#include "gimple.h" + +/* Validation of GIMPLE expressions. Note that these predicates only check + the basic form of the expression, they don't recurse to make sure that + underlying nodes are also of the right form. */ +typedef bool (*gimple_predicate)(tree); + +/* FIXME we should deduce this from the predicate. */ +enum fallback { + fb_none = 0, /* Do not generate a temporary. */ + + fb_rvalue = 1, /* Generate an rvalue to hold the result of a + gimplified expression. */ + + fb_lvalue = 2, /* Generate an lvalue to hold the result of a + gimplified expression. */ + + fb_mayfail = 4, /* Gimplification may fail. Error issued + afterwards. */ + fb_either= fb_rvalue | fb_lvalue +}; + +typedef int fallback_t; + +enum gimplify_status { + GS_ERROR = -2, /* Something Bad Seen. */ + GS_UNHANDLED = -1, /* A langhook result for "I dunno". */ + GS_OK = 0, /* We did something, maybe more to do. */ + GS_ALL_DONE = 1 /* The expression is fully gimplified. */ +}; + +extern void push_gimplify_context (struct gimplify_ctx *); +extern void pop_gimplify_context (gimple); +extern gimple gimple_current_bind_expr (void); +extern vec<gimple> gimple_bind_expr_stack (void); +extern void gimplify_and_add (tree, gimple_seq *); +extern tree get_formal_tmp_var (tree, gimple_seq *); +extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); +extern void declare_vars (tree, gimple, bool); +extern void gimple_add_tmp_var (tree); +extern tree unshare_expr (tree); +extern tree unshare_expr_without_location (tree); +extern tree voidify_wrapper_expr (tree, tree); +extern tree build_and_jump (tree *); +extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, + gimple_seq *, bool, tree); +extern tree gimple_boolify (tree); +extern bool gimplify_stmt (tree *, gimple_seq *); +extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree); +extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *, + bool (*) (tree), fallback_t); + +extern void gimplify_type_sizes (tree, gimple_seq *); +extern void gimplify_one_sizepos (tree *, gimple_seq *); +extern gimple gimplify_body (tree, bool); +extern void gimplify_function_tree (tree); +extern void gimple_regimplify_operands (gimple, gimple_stmt_iterator *); +extern tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree); +extern tree force_gimple_operand (tree, gimple_seq *, bool, tree); +extern tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree, + gimple_predicate, tree, + bool, enum gsi_iterator_update); +extern tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree, + bool, enum gsi_iterator_update); + +extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *, + gimple_seq *); +gimple gimplify_assign (tree, tree, gimple_seq *); + +#endif /* GCC_GIMPLIFY_H */ |