This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[c++] replace finish_decl (was Re: Restore obj-c++ boostrap [Was Re: patch: enable -fshow-column by default])


On Sat, Jun 13, 2009 at 06:16:36PM -0400, Jason Merrill wrote:
> On 06/13/2009 07:28 AM, Aldy Hernandez wrote:
>> It seems the finish_decl() in cp/decl.c is no longer used as a callback
>> from c-common.c.  For that matter, there are no calls to it from
>> anywhere but from the C specific bits.
>>
>> Jason, would it be ok if we got rid of the finish_decl() definition in
>> cp/decl.c and replaced all calls to it to cp_finish_decl?
>
> Sounds fine.

Fixed thusly.

Bootstrapped and tested on x86-64 Linux with --enable-languages=all,obj-c++

OK?

cp/
	* class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
	* decl.c (finish_decl): Remove.
	(declare_global_var): Replace finish_decl with cp_finish_decl.
	(start_method): Same.
	* rtti.c (emit_tinfo_decl): Same.
	* pt.c (tsubst_expr): Same.
	(instantiate_decl): Same.
	* decl2.c (grokbitfield): Same.
	* name-lookup.c (pushdecl_top_level_1): Same.
	* cp-tree.h: Remove finish_decl.

Index: cp/class.c
===================================================================
--- cp/class.c	(revision 148556)
+++ cp/class.c	(working copy)
@@ -774,7 +774,7 @@ get_vtable_decl (tree type, int complete
   if (complete)
     {
       DECL_EXTERNAL (decl) = 1;
-      finish_decl (decl, NULL_TREE, NULL_TREE, NULL_TREE);
+      cp_finish_decl (decl, NULL_TREE, false, NULL_TREE, 0);
     }
 
   return decl;
Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 148556)
+++ cp/decl.c	(working copy)
@@ -5880,15 +5880,6 @@ cp_finish_decl (tree decl, tree init, bo
     mark_decl_referenced (decl);
 }
 
-/* This is here for a midend callback from c-common.c.  */
-
-void
-finish_decl (tree decl, tree init, tree origtype ATTRIBUTE_UNUSED,
-	     tree asmspec_tree)
-{
-  cp_finish_decl (decl, init, /*init_const_expr_p=*/false, asmspec_tree, 0);
-}
-
 /* Returns a declaration for a VAR_DECL as if:
 
      extern "C" TYPE NAME;
@@ -5911,7 +5902,7 @@ declare_global_var (tree name, tree type
      library), then it is possible that our declaration will be merged
      with theirs by pushdecl.  */
   decl = pushdecl (decl);
-  finish_decl (decl, NULL_TREE, NULL_TREE, NULL_TREE);
+  cp_finish_decl (decl, NULL_TREE, false, NULL_TREE, 0);
   pop_from_top_level ();
 
   return decl;
@@ -12523,7 +12514,7 @@ start_method (cp_decl_specifier_seq *dec
 	}
     }
 
-  finish_decl (fndecl, NULL_TREE, NULL_TREE, NULL_TREE);
+  cp_finish_decl (fndecl, NULL_TREE, false, NULL_TREE, 0);
 
   /* Make a place for the parms.  */
   begin_scope (sk_function_parms, fndecl);
Index: cp/rtti.c
===================================================================
--- cp/rtti.c	(revision 148556)
+++ cp/rtti.c	(working copy)
@@ -1532,7 +1532,7 @@ emit_tinfo_decl (tree decl)
       init = get_pseudo_ti_init (type, get_pseudo_ti_index (type));
       DECL_INITIAL (decl) = init;
       mark_used (decl);
-      finish_decl (decl, init, NULL_TREE, NULL_TREE);
+      cp_finish_decl (decl, init, false, NULL_TREE, 0);
       return true;
     }
   else
Index: cp/pt.c
===================================================================
--- cp/pt.c	(revision 148556)
+++ cp/pt.c	(working copy)
@@ -10819,7 +10819,7 @@ tsubst_expr (tree t, tree args, tsubst_f
 			  init = t;
 		      }
 
-		    finish_decl (decl, init, NULL_TREE, NULL_TREE);
+		    cp_finish_decl (decl, init, false, NULL_TREE, 0);
 		  }
 	      }
 	  }
@@ -15727,7 +15727,7 @@ instantiate_decl (tree d, int defer_ok,
 
       /* The initializer is placed in DECL_INITIAL by
 	 regenerate_decl_from_template.  Pull it out so that
-	 finish_decl can process it.  */
+	 cp_finish_decl can process it.  */
       init = DECL_INITIAL (d);
       DECL_INITIAL (d) = NULL_TREE;
       DECL_INITIALIZED_P (d) = 0;
@@ -15739,7 +15739,7 @@ instantiate_decl (tree d, int defer_ok,
 
       /* Enter the scope of D so that access-checking works correctly.  */
       push_nested_class (DECL_CONTEXT (d));
-      finish_decl (d, init, NULL_TREE, NULL_TREE);
+      cp_finish_decl (d, init, false, NULL_TREE, 0);
       pop_nested_class ();
     }
   else if (TREE_CODE (d) == FUNCTION_DECL)
Index: cp/decl2.c
===================================================================
--- cp/decl2.c	(revision 148556)
+++ cp/decl2.c	(working copy)
@@ -1002,7 +1002,7 @@ grokbitfield (const cp_declarator *decla
       error ("static member %qD cannot be a bit-field", value);
       return NULL_TREE;
     }
-  finish_decl (value, NULL_TREE, NULL_TREE, NULL_TREE);
+  cp_finish_decl (value, NULL_TREE, false, NULL_TREE, 0);
 
   if (width != error_mark_node)
     {
Index: cp/cp-tree.h
===================================================================
--- cp/cp-tree.h	(revision 148556)
+++ cp/cp-tree.h	(working copy)
@@ -4333,7 +4333,6 @@ extern tree start_decl				(const cp_decl
 extern void start_decl_1			(tree, bool);
 extern bool check_array_initializer		(tree, tree, tree);
 extern void cp_finish_decl			(tree, tree, bool, tree, int);
-extern void finish_decl				(tree, tree, tree, tree);
 extern int cp_complete_array_type		(tree *, tree, bool);
 extern tree build_ptrmemfunc_type		(tree);
 extern tree build_ptrmem_type			(tree, tree);
Index: cp/name-lookup.c
===================================================================
--- cp/name-lookup.c	(revision 148556)
+++ cp/name-lookup.c	(working copy)
@@ -3555,7 +3555,7 @@ pushdecl_top_level_1 (tree x, tree *init
   push_to_top_level ();
   x = pushdecl_namespace_level (x, is_friend);
   if (init)
-    finish_decl (x, *init, NULL_TREE, NULL_TREE);
+    cp_finish_decl (x, *init, false, NULL_TREE, 0);
   pop_from_top_level ();
   POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]