* 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
+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>
/* 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
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))
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;
}
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. */