This is the mail archive of the 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: [PATCH] make a bunch of attribute handlers globally available


Following up a on recent exchange about vector_size handling for Ada
at, this is a
re-post of the patch initially suggested at

  << A number of GCC attribute handlers today shared by the C family of
     languages are needed by at least Ada and possibly others, e.g. for
     builtins support.
     For Ada, we so far dealt with this by copy-paste operations, not
     exactly proper software engineering practice.  We'd like to
     improve the situation, all the more that we now have needs for
     the vector_size attribute as well, and maybe others in the future.

... adjusted to account for Paolo's suggestion to move the common
attribute handling object files to libbackend instead of explicitely
adding them to every front-end.

Tested on x86_64-linux-suse with languages=all,ada.

Thanks in advance,

With Kind Regards,


2009-06-26  Olivier Hainque  <>

	* c-common.c (handle_noreturn_attribute, handle_const_attribute,
	handle_malloc_attribute, handle_pure_attribute,
	handle_novops_attribute, handle_vector_size_attribute,
	handle_nonnull_attribute, handle_nothrow_attribute, 
	handle_sentinel_attribute, handle_type_generic_attribute,
	get_nonnull_operand): Move bodies to attrib-handlers.c.
	(c_common_attribute_table, "noreturn", "volatile", "const", "malloc",
	"pure", "no vops", "vector_size", "nonnull", "nothrow", "sentinel",
	"type generic"): Move entries to global_attribute_table in ...
	* attrib-handlers.c: New file. Host global attribute handlers
	extracted from c-common.c.
	(global_attribute_table): Define.
	* tree.h (get_nonnull_operand): Declare.
	* attribs.c (global_attribute_table): Declare.
	(attribute_tables, init_attributes): Handle global_attribute_table.
	Use enum symbols instead of harcoded constants to designate the slots.
	* (attrib-handlers.o): List dependencies.
	(OBJS-common): Add attribs.o and attrib-handlers.o.
	(C_AND_OBJC_OBJS): Remove attribs.o.
	* (ADA_BACKEND): Remove.
	(gnat1): Use $(BACKEND) instead.
	* gcc-interface/utils.c: Remove attribute handlers formerly
	imported from c-common and now available to all languages.  Use
	NULL instead of fake_attribute_handler and remove the latter.

	* (CXX_C_OBJS): Remove attribs.o.

	* (f951): Remove attribs.o from the dependencies.

	* (jc1): Remove attribs.o from the dependencies.
	* lang.c (java_attribute_table, LANG_HOOKS_ATTRIBUTE_TABLE): Remove.

Attachment: attrib-handlers.dif
Description: Text document

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