cp-tree.h (LOCAL_CLASS_P): Use decl_function_context.

* cp-tree.h (LOCAL_CLASS_P): Use decl_function_context.

        * tree.c (bot_manip): Check TREE_CONSTANT rather than
        !TREE_SIDE_EFFECTS.  Call break_out_target_exprs and
        build_target_expr_with_type for the non-AGGR_INIT_EXPR case.

        * decl.c (start_function): Always call make_function_rtl.

From-SVN: r36080
This commit is contained in:
Jason Merrill 2000-08-30 19:43:53 -04:00
parent bf6a611300
commit 495d26d6ce
4 changed files with 24 additions and 17 deletions

View file

@ -1,6 +1,16 @@
2000-08-30 Jason Merrill <jason@redhat.com>
* cp-tree.h (LOCAL_CLASS_P): Use decl_function_context.
* tree.c (bot_manip): Check TREE_CONSTANT rather than
!TREE_SIDE_EFFECTS. Call break_out_target_exprs and
build_target_expr_with_type for the non-AGGR_INIT_EXPR case.
* decl.c (start_function): Always call make_function_rtl.
2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
* cp/semantics.c (prune_unused_decls): New function.
* semantics.c (prune_unused_decls): New function.
(finish_stmt_tree): Call it via walk_tree.
2000-08-29 Zack Weinberg <zack@wolery.cumb.org>

View file

@ -2226,8 +2226,7 @@ struct lang_decl
/* 1 iff NODE is function-local, but for types. */
#define LOCAL_CLASS_P(NODE) \
(TYPE_CONTEXT (NODE) \
&& TREE_CODE (TYPE_CONTEXT (NODE)) == FUNCTION_DECL)
(decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
/* For a NAMESPACE_DECL: the list of using namespace directives
The PURPOSE is the used namespace, the value is the namespace

View file

@ -13838,10 +13838,11 @@ start_function (declspecs, declarator, attrs, flags)
cplus_decl_attributes (decl1, NULL_TREE, attrs);
if (!building_stmt_tree ())
{
GNU_xref_function (decl1, current_function_parms);
make_function_rtl (decl1);
}
GNU_xref_function (decl1, current_function_parms);
/* We need to do this even if we aren't expanding yet so that
assemble_external works. */
make_function_rtl (decl1);
/* Promote the value to int before returning it. */
if (C_PROMOTING_INTEGER_TYPE_P (restype))

View file

@ -1649,13 +1649,15 @@ bot_manip (tp, walk_subtrees, data)
splay_tree target_remap = ((splay_tree) data);
tree t = *tp;
if (TREE_CODE (t) != TREE_LIST && ! TREE_SIDE_EFFECTS (t))
if (TREE_CONSTANT (t))
{
/* There can't be any TARGET_EXPRs below this point. */
/* There can't be any TARGET_EXPRs or their slot variables below
this point. We used to check !TREE_SIDE_EFFECTS, but then we
failed to copy an ADDR_EXPR of the slot VAR_DECL. */
*walk_subtrees = 0;
return NULL_TREE;
}
else if (TREE_CODE (t) == TARGET_EXPR)
if (TREE_CODE (t) == TARGET_EXPR)
{
tree u;
@ -1667,13 +1669,8 @@ bot_manip (tp, walk_subtrees, data)
}
else
{
tree var;
u = copy_node (t);
var = build (VAR_DECL, TREE_TYPE (t));
DECL_CONTEXT (var) = current_function_decl;
layout_decl (var, 0);
TREE_OPERAND (u, 0) = var;
u = build_target_expr_with_type
(break_out_target_exprs (TREE_OPERAND (t, 1)), TREE_TYPE (t));
}
/* Map the old variable to the new one. */