summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-09 08:26:45 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-09 08:26:45 +0000
commit26a87c78d5df7143def6b896d115d01cc2667c8e (patch)
tree9b1db49fe5feed259ac50f8a472a6cc007528ad7 /gcc/tree-inline.c
parent30f5e2bc79259cb5827de8e74bb14c65e23f3616 (diff)
downloadlinaro-gcc-26a87c78d5df7143def6b896d115d01cc2667c8e.tar.gz
linaro-gcc-26a87c78d5df7143def6b896d115d01cc2667c8e.tar.bz2
linaro-gcc-26a87c78d5df7143def6b896d115d01cc2667c8e.zip
2013-04-09 Richard Biener <rguenther@suse.de>
* tree.h (unsave_expr_now): Remove. * tree-inline.c (mark_local_for_remap_r): Remove. (unsave_expr_1): Likewise. (unsave_r): Likewise. (unsave_expr_now): Likewise. * tree-ssa-copy.c (replace_exp_1): Use unshare_expr. (propagate_tree_value): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197620 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c134
1 files changed, 0 insertions, 134 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 978db6ea006..b94ba10ee0b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -114,9 +114,6 @@ eni_weights eni_time_weights;
static tree declare_return_variable (copy_body_data *, tree, tree, basic_block);
static void remap_block (tree *, copy_body_data *);
static void copy_bind_expr (tree *, int *, copy_body_data *);
-static tree mark_local_for_remap_r (tree *, int *, void *);
-static void unsave_expr_1 (tree);
-static tree unsave_r (tree *, int *, void *);
static void declare_inline_vars (tree, tree);
static void remap_save_expr (tree *, void *, int *);
static void prepend_lexical_block (tree current_block, tree new_block);
@@ -4473,137 +4470,6 @@ remap_save_expr (tree *tp, void *st_, int *walk_subtrees)
*tp = t;
}
-/* Called via walk_tree. If *TP points to a DECL_STMT for a local label,
- copies the declaration and enters it in the splay_tree in DATA (which is
- really an `copy_body_data *'). */
-
-static tree
-mark_local_for_remap_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data)
-{
- copy_body_data *id = (copy_body_data *) data;
-
- /* Don't walk into types. */
- if (TYPE_P (*tp))
- *walk_subtrees = 0;
-
- else if (TREE_CODE (*tp) == LABEL_EXPR)
- {
- tree decl = TREE_OPERAND (*tp, 0);
-
- /* Copy the decl and remember the copy. */
- insert_decl_map (id, decl, id->copy_decl (decl, id));
- }
-
- return NULL_TREE;
-}
-
-/* Perform any modifications to EXPR required when it is unsaved. Does
- not recurse into EXPR's subtrees. */
-
-static void
-unsave_expr_1 (tree expr)
-{
- switch (TREE_CODE (expr))
- {
- case TARGET_EXPR:
- /* Don't mess with a TARGET_EXPR that hasn't been expanded.
- It's OK for this to happen if it was part of a subtree that
- isn't immediately expanded, such as operand 2 of another
- TARGET_EXPR. */
- if (TREE_OPERAND (expr, 1))
- break;
-
- TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
- TREE_OPERAND (expr, 3) = NULL_TREE;
- break;
-
- default:
- break;
- }
-}
-
-/* Called via walk_tree when an expression is unsaved. Using the
- splay_tree pointed to by ST (which is really a `splay_tree'),
- remaps all local declarations to appropriate replacements. */
-
-static tree
-unsave_r (tree *tp, int *walk_subtrees, void *data)
-{
- copy_body_data *id = (copy_body_data *) data;
- struct pointer_map_t *st = id->decl_map;
- tree *n;
-
- /* Only a local declaration (variable or label). */
- if ((TREE_CODE (*tp) == VAR_DECL && !TREE_STATIC (*tp))
- || TREE_CODE (*tp) == LABEL_DECL)
- {
- /* Lookup the declaration. */
- n = (tree *) pointer_map_contains (st, *tp);
-
- /* If it's there, remap it. */
- if (n)
- *tp = *n;
- }
-
- else if (TREE_CODE (*tp) == STATEMENT_LIST)
- gcc_unreachable ();
- else if (TREE_CODE (*tp) == BIND_EXPR)
- copy_bind_expr (tp, walk_subtrees, id);
- else if (TREE_CODE (*tp) == SAVE_EXPR
- || TREE_CODE (*tp) == TARGET_EXPR)
- remap_save_expr (tp, st, walk_subtrees);
- else
- {
- copy_tree_r (tp, walk_subtrees, NULL);
-
- /* Do whatever unsaving is required. */
- unsave_expr_1 (*tp);
- }
-
- /* Keep iterating. */
- return NULL_TREE;
-}
-
-/* Copies everything in EXPR and replaces variables, labels
- and SAVE_EXPRs local to EXPR. */
-
-tree
-unsave_expr_now (tree expr)
-{
- copy_body_data id;
-
- /* There's nothing to do for NULL_TREE. */
- if (expr == 0)
- return expr;
-
- /* Set up ID. */
- memset (&id, 0, sizeof (id));
- id.src_fn = current_function_decl;
- id.dst_fn = current_function_decl;
- id.decl_map = pointer_map_create ();
- id.debug_map = NULL;
-
- id.copy_decl = copy_decl_no_change;
- id.transform_call_graph_edges = CB_CGE_DUPLICATE;
- id.transform_new_cfg = false;
- id.transform_return_to_modify = false;
- id.transform_lang_insert_block = NULL;
-
- /* Walk the tree once to find local labels. */
- walk_tree_without_duplicates (&expr, mark_local_for_remap_r, &id);
-
- /* Walk the tree again, copying, remapping, and unsaving. */
- walk_tree (&expr, unsave_r, &id, NULL);
-
- /* Clean up. */
- pointer_map_destroy (id.decl_map);
- if (id.debug_map)
- pointer_map_destroy (id.debug_map);
-
- return expr;
-}
-
/* Called via walk_gimple_seq. If *GSIP points to a GIMPLE_LABEL for a local
label, copies the declaration and enters it in the splay_tree in DATA (which
is really a 'copy_body_data *'. */