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]

Re: Restore obj-c++ boostrap [Was Re: patch: enable -fshow-column by default]


>         (ii) The signature of finish_decl for C++ not matching the one  
> for C
> anymore (is it intended?)

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?

Simon, if a C++ maintainer agrees, then there's no need for
declaring objcp_finish_decl, instead you can just define a finish_decl
macro that calls cp_finish_decl.

If the C++ finish_decl() is needed, then I'll fix the C++ FE to match
the C's version.

Aldy

p.s. Simon, your {start,finish}_struct changes are obviously correct.
Feel free to test them separately and commit.

> +void
> +objcp_finish_decl (tree decl, location_t init_loc ATTRIBUTE_UNUSED,
> +		   tree init, tree origtype, tree asmspec_tree)
> +{
> +  finish_decl (decl, init, origtype, asmspec_tree);
> +}
> +
>  tree
>  objcp_xref_tag (enum tree_code code ATTRIBUTE_UNUSED, tree name)
>  {
> Index: gcc/objcp/objcp-decl.h
> ===================================================================
> --- gcc/objcp/objcp-decl.h	(revision 148450)
> +++ gcc/objcp/objcp-decl.h	(working copy)
> @@ -26,6 +26,7 @@
>  extern tree objcp_start_struct (location_t, enum tree_code, tree);
>  extern tree objcp_finish_struct (location_t, tree, tree, tree);
>  extern void objcp_finish_function (void);
> +extern void objcp_finish_decl (tree, location_t, tree, tree, tree);
>  extern tree objcp_build_function_call (tree, tree);
>  extern tree objcp_xref_tag (enum tree_code, tree);
>  extern int objcp_comptypes (tree, tree);
> @@ -37,12 +38,14 @@
>     invoke the original C++ functions if needed).  */
>  #ifdef OBJCP_REMAP_FUNCTIONS
>  
> -#define start_struct(code, name, in_struct, struct_types, loc) \
> -	objcp_start_struct (code, name)
> -#define finish_struct(t, fieldlist, attributes, in_struct, struct_types) \
> -	objcp_finish_struct (t, fieldlist, attributes)
> +#define start_struct(loc, code, name, in_struct, struct_types)	\
> +  objcp_start_struct (loc, code, name)
> +#define finish_struct(loc, t, fieldlist, attributes, in_struct, struct_types) \
> +  objcp_finish_struct (loc, t, fieldlist, attributes)
>  #define finish_function() \
>  	objcp_finish_function ()
> +#define finish_decl(decl, loc, init, origtype, asmspec) \
> +	objcp_finish_decl(decl, loc, init, origtype, asmspec)
>  #define xref_tag(code, name) \
>  	objcp_xref_tag (code, name)
>  #define comptypes(type1, type2) \
> 
> 
> 


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