]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h (LOCAL_CLASS_P): Use decl_function_context.
authorJason Merrill <jason@gcc.gnu.org>
Wed, 30 Aug 2000 23:43:53 +0000 (19:43 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 30 Aug 2000 23:43:53 +0000 (19:43 -0400)
        * 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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/tree.c

index b0842f5f7cbbf230841a05f17bede1538b12606b..033185e40219898e6fc33c2994c341a6a30b2797 100644 (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>
index cc5046921f967426caa4e0e64fea2b25f1f8c623..4fee6fffc6361d87812b0ad36c2118da753df256 100644 (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
index e84232d64b5fbd5f84d9d2a7731cd63e2981e318..b5627f1df2c9030d02ed83bcd7bd307778e42144 100644 (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))
index cd7d45f0d29c9301f59812484339924a85f0776f..009cb0e388e3eee31c66f8942f91772b45e4e681 100644 (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.  */