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: [autovect][patch]Enable fortran to declare a "const" builtin function



On Mar 1, 2005, at 3:43 PM, Keith Besaw wrote:

Rather than have fortran's builtin_function search just for the "const" attribute I could provide a routine decl_common_attributes in c-common.c that is modeled after decl_attribute from attribs.c. It could just search for const, noreturn, and pure and call routines in c-common.c such as handle_const_attribute. Alternatively, it could traverse the attributes in lang_hooks.common_attribute_table, and I would need to construct a common_attribute_table for fortran that included const, noreturn, and pure.

Note, decl_attributes in attribs.c traverses the following four attribute
tables
attribute_tables[0] = lang_hooks.common_attribute_table;
attribute_tables[1] = lang_hooks.attribute_table;
attribute_tables[2] = lang_hooks.format_attribute_table;
attribute_tables[3] = targetm.attribute_table;


Opinion or another alternative?

Yes have attribute_tables include a common between languages attribute table
and move the handling of const, noreturn, pure (and a couple of others) into
a common between all languages file.


-- Pinski


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