stmt.c (resolve_asm_operand_names): Call check_unique_operand_names here.
authorJason Merrill <jason@redhat.com>
Thu, 9 Oct 2003 05:44:57 +0000 (01:44 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 9 Oct 2003 05:44:57 +0000 (01:44 -0400)
        * stmt.c (resolve_asm_operand_names): Call check_unique_operand_names
        here.
        (expand_asm_operands): Not here.
        (parse_input_constraint): No longer static.
        * tree.h: Declare it.

        * coverage.c (build_ctr_info_value): Use build_decl to make a
        VAR_DECL.
        (create_coverage): Likewise.
java/
        * parse.y (patch_assignment): Use make_node to create a BLOCK.
        * parse.h (BUILD_PTR_FROM_NAME): Use make_node to create a
        POINTER_TYPE.
cp/
        * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL.
        (build_target_expr_with_type): Likewise.

        * pt.c (instantiate_class_template): Sanity check that our
        enclosing class has been instantiated.

From-SVN: r72255

gcc/ChangeLog
gcc/coverage.c
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/tree.c
gcc/java/ChangeLog
gcc/java/parse.h
gcc/java/parse.y
gcc/stmt.c
gcc/tree.h

index f4e78fc78c346d611304710828d933336418b1b9..32165693ab110fd29c11f411d5efd23c0b6dc6f8 100644 (file)
@@ -1,3 +1,15 @@
+2003-10-09  Jason Merrill  <jason@redhat.com>
+
+       * coverage.c (build_ctr_info_value): Use build_decl to make a
+       VAR_DECL.
+       (create_coverage): Likewise.
+
+       * stmt.c (resolve_asm_operand_names): Call check_unique_operand_names
+       here.
+       (expand_asm_operands): Not here.
+       (parse_input_constraint): No longer static.
+       * tree.h: Declare it.
+
 2003-10-08  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * config/sh/t-linux (SHLIB_LINK): Override to use a linker script
index e6f4129dd79011e368cd01ea477d1d2503e9b04a..b02c97c15d652a1702b331a934b3eefd19d74f50 100644 (file)
@@ -637,7 +637,7 @@ build_ctr_info_value (unsigned int counter, tree type)
       array_type = build_array_type (TREE_TYPE (TREE_TYPE (fields)),
                                     array_type);
 
-      array = build (VAR_DECL, array_type, NULL_TREE, NULL_TREE);
+      array = build_decl (VAR_DECL, NULL_TREE, array_type);
       TREE_STATIC (array) = 1;
       DECL_NAME (array) = get_identifier (XSTR (ctr_labels[counter], 0));
       assemble_variable (array, 0, 0, 0);
@@ -824,8 +824,7 @@ create_coverage (void)
 
   gcov_info_value = build_gcov_info ();
 
-  gcov_info = build (VAR_DECL, TREE_TYPE (gcov_info_value),
-                    NULL_TREE, NULL_TREE);
+  gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (gcov_info_value));
   DECL_INITIAL (gcov_info) = gcov_info_value;
 
   TREE_STATIC (gcov_info) = 1;
index e5955264af73919cf237d11e62a73708f9d05abc..b7cf0299843daa8514777b7538d4a4af5c503476 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-09  Jason Merrill  <jason@redhat.com>
+
+       * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL.
+       (build_target_expr_with_type): Likewise.
+
+       * pt.c (instantiate_class_template): Sanity check that our
+       enclosing class has been instantiated.
+
 2003-10-08  Giovanni Bajo  <giovannibajo@libero.it>
 
        * cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS.
index f0dc0e133681d555c0260373c49eddb9c9a3f813..909eede693d1fe10e83bafc3b3540bec98431759 100644 (file)
@@ -5182,7 +5182,18 @@ instantiate_class_template (tree type)
     SET_ANON_AGGR_TYPE_P (type);
 
   pbinfo = TYPE_BINFO (pattern);
-  
+
+#ifdef ENABLE_CHECKING
+  if (DECL_CLASS_SCOPE_P (TYPE_MAIN_DECL (pattern))
+      && ! COMPLETE_TYPE_P (TYPE_CONTEXT (type))
+      && ! TYPE_BEING_DEFINED (TYPE_CONTEXT (type)))
+    /* We should never instantiate a nested class before its enclosing
+       class; we need to look up the nested class by name before we can
+       instantiate it, and that lookup should instantiate the enclosing
+       class.  */
+    abort ();
+#endif
+
   if (BINFO_BASETYPES (pbinfo))
     {
       tree base_list = NULL_TREE;
index 0c729d6118c81b156eff8a2715e64792139b0fb4..109f7e52f187724951c27ee6fc84ed580275b0b7 100644 (file)
@@ -269,7 +269,7 @@ build_cplus_new (tree type, tree init)
             && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
             && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
 
-  slot = build (VAR_DECL, type);
+  slot = build_decl (VAR_DECL, NULL_TREE, type);
   DECL_ARTIFICIAL (slot) = 1;
   DECL_CONTEXT (slot) = current_function_decl;
   layout_decl (slot, 0);
@@ -311,7 +311,7 @@ build_target_expr_with_type (tree init, tree type)
   if (TREE_CODE (init) == TARGET_EXPR)
     return init;
 
-  slot = build (VAR_DECL, type);
+  slot = build_decl (VAR_DECL, NULL_TREE, type);
   DECL_ARTIFICIAL (slot) = 1;
   DECL_CONTEXT (slot) = current_function_decl;
   layout_decl (slot, 0);
index 25e70c2578b82296f6b4fed98c5cd5aa89fc96f7..d2b6d26ff0c1ea4bd28fcceffeb8053cd22526a1 100644 (file)
@@ -1,3 +1,9 @@
+2003-10-09  Jason Merrill  <jason@redhat.com>
+
+       * parse.y (patch_assignment): Use make_node to create a BLOCK.
+       * parse.h (BUILD_PTR_FROM_NAME): Use make_node to create a
+       POINTER_TYPE.
+
 2003-10-06  Mark Mitchell  <mark@codesourcery.com>
 
        * Make-lang.in (java.info): Replace with ...
index 023410842b2a9918d08fdb84f3a410575e8e63cc..70d2b1806b628debc42ba6f529934b46ee892880 100644 (file)
@@ -154,7 +154,7 @@ extern tree stabilize_reference (tree);
 /* Quickly build a temporary pointer on hypothetical type NAME. */
 #define BUILD_PTR_FROM_NAME(ptr, name)         \
   do {                                         \
-    ptr = build (POINTER_TYPE, NULL_TREE);     \
+    ptr = make_node (POINTER_TYPE);            \
     TYPE_NAME (ptr) = name;                    \
   } while (0)
 
index 541e2b2429ac70140d7c5e266f7c34e26aa896a8..144ac7e52cf06c551b2d5ae4a3cdd214d4788fe4 100644 (file)
@@ -12913,10 +12913,11 @@ patch_assignment (tree node, tree wfl_op1)
          {
            tree tmp = build_decl (VAR_DECL, get_identifier ("<tmp>"), 
                                   TREE_TYPE (new_rhs));
-           tree block = build (BLOCK, TREE_TYPE (new_rhs), NULL);
+           tree block = make_node (BLOCK);
            tree assignment 
              = build (MODIFY_EXPR, TREE_TYPE (new_rhs), tmp, fold (new_rhs));
            DECL_CONTEXT (tmp) = current_function_decl;
+           TREE_TYPE (block) = TREE_TYPE (new_rhs);
            BLOCK_VARS (block) = tmp;
            BLOCK_EXPR_BODY (block) 
              = build (COMPOUND_EXPR, TREE_TYPE (new_rhs), assignment, tmp);
index 72746dfc2b31de0614935d6667eb3a232f241430..718f2558e7dd260f0118d0337acdb17ec951e3ad 100644 (file)
@@ -391,8 +391,6 @@ struct stmt_status GTY(())
 static int using_eh_for_cleanups_p = 0;
 
 static int n_occurrences (int, const char *);
-static bool parse_input_constraint (const char **, int, int, int, int,
-                                   const char * const *, bool *, bool *);
 static bool decl_conflicts_with_clobbers_p (tree, const HARD_REG_SET);
 static void expand_goto_internal (tree, rtx, rtx);
 static int expand_fixup (tree, rtx, rtx);
@@ -1253,7 +1251,7 @@ parse_output_constraint (const char **constraint_p, int operand_num,
 
 /* Similar, but for input constraints.  */
 
-static bool
+bool
 parse_input_constraint (const char **constraint_p, int input_num,
                        int ninputs, int noutputs, int ninout,
                        const char * const * constraints,
@@ -1465,9 +1463,6 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
   if (! check_operand_nalternatives (outputs, inputs))
     return;
 
-  if (! check_unique_operand_names (outputs, inputs))
-    return;
-
   string = resolve_asm_operand_names (string, outputs, inputs);
 
   /* Collect constraints.  */
@@ -1975,6 +1970,8 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
   const char *c;
   tree t;
 
+  check_unique_operand_names (outputs, inputs);
+
   /* Substitute [<name>] in input constraint strings.  There should be no
      named operands in output constraints.  */
   for (t = inputs; t ; t = TREE_CHAIN (t))
index a2a04a7cafc8e7ea144d47505ad7e673aa7036ee..d46e60ac3768fefd7596d0f0e3de69f1a9636433 100644 (file)
@@ -2977,6 +2977,8 @@ extern void emit_nop (void);
 extern void expand_computed_goto (tree);
 extern bool parse_output_constraint (const char **, int, int, int,
                                     bool *, bool *, bool *);
+extern bool parse_input_constraint (const char **, int, int, int, int,
+                                   const char * const *, bool *, bool *);
 extern void expand_asm_operands (tree, tree, tree, tree, int, location_t);
 extern tree resolve_asm_operand_names (tree, tree, tree);
 extern int any_pending_cleanups (void);