summaryrefslogtreecommitdiff
path: root/gcc/gimplify.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2013-11-14 19:39:38 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2013-11-14 19:39:38 +0000
commit18f429e29ca809340f044625c0b767beec38fba4 (patch)
treec74c4d1bb5473fdc2c9d6c2a6ad1153f0c1c25de /gcc/gimplify.h
parent6495f8e61f6bd2eb279d1df529cdbbac1cc12214 (diff)
downloadgcc-18f429e29ca809340f044625c0b767beec38fba4.tar.gz
gimplify-be.h: New file.
* gimplify-be.h: New file. Add prototypes. * gimplify.h: Don't include gimple.h. (struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos, gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h. * gimple.h (struct gimplify_hasher, gimplify_hasher::hash, gimplify_hasher::equal, struct gimplify_ctx, is_gimple_sizepos): Move to gimplify.h. (enum gsi_iterator_update): Move to gimple-iterator.h. * gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h. * gimplify-be.c: New File. (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Relocate from gimplify.c. * gimplify.c (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Move to gimplify-be.c. * Makefile.in (OBJS): Add gimplify-be.o * asan.c: Include only gimplify.h, gimplify-be.h, and/or gimple.h as required. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple.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: Likewise. * 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-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-conversion.c: Likewise. * 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. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Likewise. * 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. * c/c-typeck.c: Include only gimplify.h and gimple.h as needed. * c-family/c-common.c: Likewise. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * cp/class.c: Include only gimplify.h and gimple.h as needed. * 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. * fortran/trans-expr.c: Include only gimplify.h and gimple.h as needed. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include only gimplify.h and gimple.h as needed. * java/java-gimplify.c: Include only gimplify.h and gimple.h as needed. * objc/objc-act.c: Include only gimplify.h and gimple.h as needed. From-SVN: r204812
Diffstat (limited to 'gcc/gimplify.h')
-rw-r--r--gcc/gimplify.h62
1 files changed, 51 insertions, 11 deletions
diff --git a/gcc/gimplify.h b/gcc/gimplify.h
index 5f81cf2fe77..3f7e1b327a9 100644
--- a/gcc/gimplify.h
+++ b/gcc/gimplify.h
@@ -20,8 +20,6 @@ along with GCC; see the file COPYING3. If not see
#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. */
@@ -50,7 +48,38 @@ enum gimplify_status {
GS_OK = 0, /* We did something, maybe more to do. */
GS_ALL_DONE = 1 /* The expression is fully gimplified. */
};
+/* Gimplify hashtable helper. */
+
+struct gimplify_hasher : typed_free_remove <elt_t>
+{
+ typedef elt_t value_type;
+ typedef elt_t compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
+};
+
+struct gimplify_ctx
+{
+ struct gimplify_ctx *prev_context;
+
+ vec<gimple> bind_expr_stack;
+ tree temps;
+ gimple_seq conditional_cleanups;
+ tree exit_label;
+ tree return_temp;
+
+ vec<tree> case_labels;
+ /* The formal temporary table. Should this be persistent? */
+ hash_table <gimplify_hasher> temp_htab;
+
+ int conditions;
+ bool save_stack;
+ bool into_ssa;
+ bool allow_rhs_cond_expr;
+ bool in_cleanup_point_expr;
+};
+extern struct gimplify_ctx *gimplify_ctxp;
extern void push_gimplify_context (struct gimplify_ctx *);
extern void pop_gimplify_context (gimple);
extern gimple gimple_current_bind_expr (void);
@@ -67,6 +96,7 @@ 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 gimple_predicate rhs_predicate_for (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 *,
@@ -76,17 +106,27 @@ 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 *);
+/* Return true if gimplify_one_sizepos doesn't need to gimplify
+ expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
+ fields). */
+
+static inline bool
+is_gimple_sizepos (tree expr)
+{
+ /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
+ is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do
+ anything if it's already a VAR_DECL. If it's a VAR_DECL from another
+ function, the gimplifier will want to replace it with a new variable,
+ but that will cause problems if this type is from outside the function.
+ It's OK to have that here. */
+ return (expr == NULL_TREE
+ || TREE_CONSTANT (expr)
+ || TREE_CODE (expr) == VAR_DECL
+ || CONTAINS_PLACEHOLDER_P (expr));
+}
+
#endif /* GCC_GIMPLIFY_H */