aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2013-11-12 20:26:43 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2013-11-12 20:26:43 +0000
commit45b0be94bed1f11918c43b420934eac6e2a11bf6 (patch)
treeec5ecce5dd0b07212d3416eab7b065b138ed7577 /gcc/gimple.h
parentc9a584aa7ab99230c50c659b209195e6b52ccde0 (diff)
downloadgcc-45b0be94bed1f11918c43b420934eac6e2a11bf6.zip
gcc-45b0be94bed1f11918c43b420934eac6e2a11bf6.tar.gz
gcc-45b0be94bed1f11918c43b420934eac6e2a11bf6.tar.bz2
gimple-expr.h (create_tmp_var_name, [...]): Relocate prototypes from gimple.h.
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. From-SVN: r204717
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h116
1 files changed, 29 insertions, 87 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 33e790c..4f34a9ee 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -766,7 +766,6 @@ gimple gimple_build_call_valist (tree, unsigned, va_list);
gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
gimple gimple_build_call_from_tree (tree);
-gimple gimplify_assign (tree, tree, gimple_seq *);
gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
gimple gimple_build_label (tree label);
gimple gimple_build_goto (tree dest);
@@ -806,8 +805,6 @@ gimple gimple_build_omp_atomic_store (tree);
gimple gimple_build_transaction (gimple_seq, tree);
gimple gimple_build_predict (enum br_predictor, enum prediction);
enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
-void sort_case_labels (vec<tree> );
-void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
gimple_seq gimple_seq_alloc (void);
void gimple_seq_free (gimple_seq);
void gimple_seq_add_seq (gimple_seq *, gimple_seq);
@@ -834,8 +831,10 @@ bool gimple_has_side_effects (const_gimple);
bool gimple_could_trap_p (gimple);
bool gimple_could_trap_p_1 (gimple, bool, bool);
bool gimple_assign_rhs_could_trap_p (gimple);
-void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
bool empty_body_p (gimple_seq);
+extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
+ location_t);
+extern void annotate_all_with_location (gimple_seq, location_t);
unsigned get_gimple_rhs_num_ops (enum tree_code);
#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
@@ -859,48 +858,8 @@ extern bool gimple_ior_addresses_taken (bitmap, gimple);
extern bool gimple_call_builtin_p (gimple, enum built_in_class);
extern bool gimple_call_builtin_p (gimple, enum built_in_function);
extern bool gimple_asm_clobbers_memory_p (const_gimple);
-
-/* In gimplify.c */
-extern tree create_tmp_var_raw (tree, const char *);
-extern tree create_tmp_var_name (const char *);
-extern tree create_tmp_var (tree, const char *);
-extern tree create_tmp_reg (tree, const char *);
-extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
-extern tree get_formal_tmp_var (tree, gimple_seq *);
-extern void declare_vars (tree, gimple, bool);
-extern void annotate_all_with_location (gimple_seq, location_t);
extern unsigned gimple_call_get_nobnd_arg_index (const_gimple, unsigned);
-/* 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. */
-};
-
/* Formal (expression) temporary table handling: multiple occurrences of
the same scalar expression are evaluated into the same temporary. */
@@ -1010,31 +969,8 @@ inc_gimple_stmt_max_uid (struct function *fn)
return fn->last_stmt_uid++;
}
-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 *);
-enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, gimple_seq *,
- bool, tree);
-extern bool gimplify_stmt (tree *, gimple_seq *);
-extern gimple gimplify_body (tree, bool);
-extern void push_gimplify_context (struct gimplify_ctx *);
-extern void pop_gimplify_context (gimple);
-extern void gimplify_and_add (tree, gimple_seq *);
-
/* Miscellaneous helpers. */
-extern void gimple_add_tmp_var (tree);
-extern gimple gimple_current_bind_expr (void);
-extern vec<gimple> gimple_bind_expr_stack (void);
-extern tree voidify_wrapper_expr (tree, tree);
-extern tree build_and_jump (tree *);
-extern tree force_labels_r (tree *, int *, void *);
-extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
- gimple_seq *);
struct gimplify_omp_ctx;
-extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
-extern tree gimple_boolify (tree);
-extern gimple_predicate rhs_predicate_for (tree);
extern tree canonicalize_cond_expr_cond (tree);
extern void dump_decl_set (FILE *, bitmap);
extern bool nonfreeing_call_p (gimple);
@@ -1048,9 +984,6 @@ extern void compute_transaction_bits (void);
extern void lower_nested_functions (tree);
extern void insert_field_into_struct (tree, tree);
-/* In gimplify.c. */
-extern void gimplify_function_tree (tree);
-
/* In cfgexpand.c. */
extern tree gimple_assign_rhs_to_tree (gimple);
@@ -1121,14 +1054,8 @@ gimple_seq_empty_p (gimple_seq s)
return s == NULL;
}
-void gimple_seq_add_stmt (gimple_seq *, gimple);
-
-/* Link gimple statement GS to the end of the sequence *SEQ_P. If
- *SEQ_P is NULL, a new sequence is allocated. This function is
- similar to gimple_seq_add_stmt, but does not scan the operands.
- During gimplification, we need to manipulate statement sequences
- before the def/use vectors have been constructed. */
-void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
+extern void gimple_seq_add_stmt (gimple_seq *, gimple);
+extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
/* Allocate a new sequence and initialize its first element with STMT. */
@@ -5563,15 +5490,6 @@ void gsi_commit_one_edge_insert (edge, basic_block *);
void gsi_commit_edge_inserts (void);
gimple gimple_call_copy_skip_args (gimple, bitmap);
-/* In gimplify.c. */
-tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
-tree force_gimple_operand (tree, gimple_seq *, bool, tree);
-tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree,
- gimple_predicate, tree,
- bool, enum gsi_iterator_update);
-tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
- bool, enum gsi_iterator_update);
-
/* Convenience routines to walk all statements of a gimple function.
Note that this is useful exclusively before the code is converted
into SSA form. Once the program is in SSA form, the standard
@@ -5684,6 +5602,27 @@ gimple_seq_set_location (gimple_seq seq, location_t loc)
gimple_set_location (gsi_stmt (i), loc);
}
+/* Return true if a location should not be emitted for this statement
+ by annotate_all_with_location. */
+
+static inline bool
+gimple_do_not_emit_location_p (gimple g)
+{
+ return gimple_plf (g, GF_PLF_1);
+}
+
+/* Mark statement G so a location will not be emitted by
+ annotate_one_with_location. */
+
+static inline void
+gimple_set_do_not_emit_location (gimple g)
+{
+ /* The PLF flags are initialized to 0 when a new tuple is created,
+ so no need to initialize it anywhere. */
+ gimple_set_plf (g, GF_PLF_1, true);
+}
+
+
/* Macros for showing usage statistics. */
#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
? (x) \
@@ -5695,4 +5634,7 @@ gimple_seq_set_location (gimple_seq seq, location_t loc)
#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
+extern void sort_case_labels (vec<tree> );
+extern void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
+
#endif /* GCC_GIMPLE_H */