mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 12:23:59 +08:00
langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove.
2004-08-19 Eric Christopher <echristo@redhat.com> * langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove. * langhooks.h (unsave_expr_now): Ditto. * tree.h (unsave_expr_1): Remove prototype. (lhd_unsave_expr_now): Rename to unsave_expr_now. * tree-inline.c (unsave_expr_1): Move here from tree.c. Make static. (unsave_expr_now): Rename from lhd_unsave_expr_now. * tree-sra.c: Fix up for rename. * tree-ssa-copy.c: Ditto. * tree-eh.c: Ditto. * tree.c (unsave_expr_1): Move to tree-inline.c. 2004-08-19 Eric Christopher <echristo@redhat.com> * cp-tree.h (cxx_unsave_expr_now): Delete prototype. * tree.c (cxx_unsave_expr_now): Delete. (cp_unsave_r): Ditto. From-SVN: r86277
This commit is contained in:
parent
b850582895
commit
19114537c5
@ -1,3 +1,17 @@
|
||||
2004-08-19 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove.
|
||||
* langhooks.h (unsave_expr_now): Ditto.
|
||||
* tree.h (unsave_expr_1): Remove prototype.
|
||||
(lhd_unsave_expr_now): Rename to unsave_expr_now.
|
||||
* tree-inline.c (unsave_expr_1): Move here
|
||||
from tree.c. Make static.
|
||||
(unsave_expr_now): Rename from lhd_unsave_expr_now.
|
||||
* tree-sra.c: Fix up for rename.
|
||||
* tree-ssa-copy.c: Ditto.
|
||||
* tree-eh.c: Ditto.
|
||||
* tree.c (unsave_expr_1): Move to tree-inline.c.
|
||||
|
||||
2004-08-19 Caroline Tice <ctice@apple.com>
|
||||
|
||||
* config/i386/cygming.h (switch_to_section): Fix typo (change
|
||||
@ -2604,7 +2618,7 @@
|
||||
* config/i386/xmmintrin.h: Include <mm_malloc.h>.
|
||||
|
||||
2004-08-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
Tanguy Fautrà <tfautre@pandora.be>
|
||||
Tanguy FautrÃ? <tfautre@pandora.be>
|
||||
|
||||
* config/i386/pmm_malloc.h: New file.
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
2004-08-19 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* cp-tree.h (cxx_unsave_expr_now): Delete prototype.
|
||||
* tree.c (cxx_unsave_expr_now): Delete.
|
||||
(cp_unsave_r): Ditto.
|
||||
|
||||
2004-08-19 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/15890
|
||||
|
@ -4192,7 +4192,6 @@ extern void lang_check_failed (const char *, int,
|
||||
extern tree stabilize_expr (tree, tree *);
|
||||
extern void stabilize_call (tree, tree *);
|
||||
extern bool stabilize_init (tree, tree *);
|
||||
extern tree cxx_unsave_expr_now (tree);
|
||||
extern tree cxx_maybe_build_cleanup (tree);
|
||||
extern void init_tree (void);
|
||||
extern int pod_type_p (tree);
|
||||
|
@ -43,7 +43,6 @@ static hashval_t list_hash_pieces (tree, tree, tree);
|
||||
static hashval_t list_hash (const void *);
|
||||
static cp_lvalue_kind lvalue_p_1 (tree, int);
|
||||
static tree mark_local_for_remap_r (tree *, int *, void *);
|
||||
static tree cp_unsave_r (tree *, int *, void *);
|
||||
static tree build_target_expr (tree, tree);
|
||||
static tree count_trees_r (tree *, int *, void *);
|
||||
static tree verify_stmt_tree_r (tree *, int *, void *);
|
||||
@ -2171,65 +2170,6 @@ mark_local_for_remap_r (tree* tp,
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* 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
|
||||
cp_unsave_r (tree* tp,
|
||||
int* walk_subtrees,
|
||||
void* data)
|
||||
{
|
||||
splay_tree st = (splay_tree) data;
|
||||
splay_tree_node n;
|
||||
|
||||
/* Only a local declaration (variable or label). */
|
||||
if (nonstatic_local_decl_p (*tp))
|
||||
{
|
||||
/* Lookup the declaration. */
|
||||
n = splay_tree_lookup (st, (splay_tree_key) *tp);
|
||||
|
||||
/* If it's there, remap it. */
|
||||
if (n)
|
||||
*tp = (tree) n->value;
|
||||
}
|
||||
else if (TREE_CODE (*tp) == SAVE_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;
|
||||
}
|
||||
|
||||
/* Called whenever an expression needs to be unsaved. */
|
||||
|
||||
tree
|
||||
cxx_unsave_expr_now (tree tp)
|
||||
{
|
||||
splay_tree st;
|
||||
|
||||
/* Create a splay-tree to map old local variable declarations to new
|
||||
ones. */
|
||||
st = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
|
||||
|
||||
/* Walk the tree once figuring out what needs to be remapped. */
|
||||
walk_tree (&tp, mark_local_for_remap_r, st, NULL);
|
||||
|
||||
/* Walk the tree again, copying, remapping, and unsaving. */
|
||||
walk_tree (&tp, cp_unsave_r, st, NULL);
|
||||
|
||||
/* Clean up. */
|
||||
splay_tree_delete (st);
|
||||
|
||||
return tp;
|
||||
}
|
||||
|
||||
/* Returns the kind of special function that DECL (a FUNCTION_DECL)
|
||||
is. Note that sfk_none is zero, so this function can be used as a
|
||||
predicate to test whether or not DECL is a special function. */
|
||||
|
@ -107,7 +107,6 @@ extern int lhd_gimplify_expr (tree *, tree *, tree *);
|
||||
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
|
||||
#define LANG_HOOKS_STATICP lhd_staticp
|
||||
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
|
||||
#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
|
||||
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
|
||||
#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P lhd_can_use_bit_fields_p
|
||||
#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS false
|
||||
@ -271,7 +270,6 @@ extern tree lhd_make_node (enum tree_code);
|
||||
LANG_HOOKS_MARK_ADDRESSABLE, \
|
||||
LANG_HOOKS_STATICP, \
|
||||
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
|
||||
LANG_HOOKS_UNSAVE_EXPR_NOW, \
|
||||
LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
|
||||
LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
|
||||
LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
|
||||
|
@ -305,11 +305,6 @@ struct lang_hooks
|
||||
DECL_NODE with a newly GC-allocated copy. */
|
||||
void (*dup_lang_specific_decl) (tree);
|
||||
|
||||
/* Reset argument so that it can be expanded again.
|
||||
Modify it in-place so that all the evaluate only once
|
||||
things are cleared out. */
|
||||
tree (*unsave_expr_now) (tree);
|
||||
|
||||
/* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of
|
||||
thing that the assembler should talk about, set
|
||||
DECL_ASSEMBLER_NAME to an appropriate IDENTIFIER_NODE.
|
||||
|
@ -709,7 +709,7 @@ lower_try_finally_dup_block (tree t, struct leh_state *outer_state)
|
||||
{
|
||||
tree region = NULL;
|
||||
|
||||
t = lhd_unsave_expr_now (t);
|
||||
t = unsave_expr_now (t);
|
||||
|
||||
if (outer_state->tf)
|
||||
region = outer_state->tf->try_finally_expr;
|
||||
|
@ -135,6 +135,7 @@ static void remap_block (tree *, inline_data *);
|
||||
static tree remap_decls (tree, inline_data *);
|
||||
static void copy_bind_expr (tree *, int *, inline_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 bind_expr, tree vars);
|
||||
|
||||
@ -2370,6 +2371,31 @@ mark_local_for_remap_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
|
||||
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. */
|
||||
@ -2411,11 +2437,11 @@ unsave_r (tree *tp, int *walk_subtrees, void *data)
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Default lang hook for "unsave_expr_now". Copies everything in EXPR and
|
||||
replaces variables, labels and SAVE_EXPRs local to EXPR. */
|
||||
/* Copies everything in EXPR and replaces variables, labels
|
||||
and SAVE_EXPRs local to EXPR. */
|
||||
|
||||
tree
|
||||
lhd_unsave_expr_now (tree expr)
|
||||
unsave_expr_now (tree expr)
|
||||
{
|
||||
inline_data id;
|
||||
|
||||
|
@ -1697,7 +1697,7 @@ insert_edge_copies (tree stmt, basic_block bb)
|
||||
first_copy = false;
|
||||
}
|
||||
else
|
||||
bsi_insert_on_edge (e, lhd_unsave_expr_now (stmt));
|
||||
bsi_insert_on_edge (e, unsave_expr_now (stmt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ replace_exp_1 (use_operand_p op_p, tree val,
|
||||
SET_USE (op_p, val);
|
||||
}
|
||||
else
|
||||
SET_USE (op_p, lhd_unsave_expr_now (val));
|
||||
SET_USE (op_p, unsave_expr_now (val));
|
||||
}
|
||||
|
||||
|
||||
@ -262,7 +262,7 @@ propagate_tree_value (tree *op_p, tree val)
|
||||
*op_p = val;
|
||||
}
|
||||
else
|
||||
*op_p = lhd_unsave_expr_now (val);
|
||||
*op_p = unsave_expr_now (val);
|
||||
}
|
||||
|
||||
|
||||
|
25
gcc/tree.c
25
gcc/tree.c
@ -1564,31 +1564,6 @@ tree_node_structure (tree t)
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform any modifications to EXPR required when it is unsaved. Does
|
||||
not recurse into EXPR's subtrees. */
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
|
||||
or offset that depends on a field within a record. */
|
||||
|
@ -3203,11 +3203,6 @@ extern int first_rtl_op (enum tree_code);
|
||||
|
||||
enum tree_node_structure_enum tree_node_structure (tree);
|
||||
|
||||
/* Reset EXP in place so that it can be expanded again. Does not
|
||||
recurse into subtrees. */
|
||||
|
||||
extern void unsave_expr_1 (tree);
|
||||
|
||||
/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
|
||||
or offset that depends on a field within a record.
|
||||
|
||||
@ -3362,7 +3357,6 @@ extern tree get_set_constructor_bytes (tree, unsigned char *, int);
|
||||
extern tree get_callee_fndecl (tree);
|
||||
extern void change_decl_assembler_name (tree, tree);
|
||||
extern int type_num_arguments (tree);
|
||||
extern tree lhd_unsave_expr_now (tree);
|
||||
extern bool associative_tree_code (enum tree_code);
|
||||
extern bool commutative_tree_code (enum tree_code);
|
||||
|
||||
@ -3551,6 +3545,9 @@ extern void indent_to (FILE *, int);
|
||||
|
||||
/* In tree-inline.c: */
|
||||
extern bool debug_find_tree (tree, tree);
|
||||
/* This is in tree-inline.c since the routine uses
|
||||
data structures from the inliner. */
|
||||
extern tree unsave_expr_now (tree);
|
||||
|
||||
/* In expr.c */
|
||||
extern rtx expand_builtin_return_addr (enum built_in_function, int, rtx);
|
||||
|
Loading…
Reference in New Issue
Block a user