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


> Andrew Pinski <pinskia@physics.uc.edu> wrote on 03/01/2005 03:03:07 PM:
> 
> 
> 
> 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
> 

I think that lang_hooks.common_attribute_table is already supposed to be
the common attribute table between languages?  For C it is assigned the 
address
of the array c_common_attribute_table declared in c-common.c (see below).
For fortran I was proposing that I assign it a subset of these attributes.

Since it doesn't appear that lang_hooks.attribute_table is being assigned
a non-null value I could move attributes other than const, noreturn, and
pure into a new table c_attribute_table whose address I would then assign 
to
lang_hooks.attribute_table.


const struct attribute_spec c_common_attribute_table[] =
{
  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } 
*/
  { "packed",                 0, 0, false, false, false,
                              handle_packed_attribute },
  { "nocommon",               0, 0, true,  false, false,
                              handle_nocommon_attribute },
  { "common",                 0, 0, true,  false, false,
                              handle_common_attribute },
  /* FIXME: logically, noreturn attributes should be listed as
     "false, true, true" and apply to function types.  But implementing 
this
     would require all the places in the compiler that use 
TREE_THIS_VOLATILE
     on a decl to identify non-returning functions to be located and fixed
     to check the function type instead.  */
  { "noreturn",               0, 0, true,  false, false,
                              handle_noreturn_attribute },
  { "volatile",               0, 0, true,  false, false,
                              handle_noreturn_attribute },
  { "noinline",               0, 0, true,  false, false,
                              handle_noinline_attribute },
  { "always_inline",          0, 0, true,  false, false,
                              handle_always_inline_attribute },
  { "used",                   0, 0, true,  false, false,
                              handle_used_attribute },
  { "unused",                 0, 0, false, false, false,
                              handle_unused_attribute },
  /* The same comments as for noreturn attributes apply to const ones.  */
  { "const",                  0, 0, true,  false, false,
                              handle_const_attribute },
  { "transparent_union",      0, 0, false, false, false,
                              handle_transparent_union_attribute },
  { "constructor",            0, 0, true,  false, false,
                              handle_constructor_attribute },
  { "destructor",             0, 0, true,  false, false,
                              handle_destructor_attribute },
  { "mode",                   1, 1, false,  true, false,
                              handle_mode_attribute },
  { "section",                1, 1, true,  false, false,
                              handle_section_attribute },
  { "aligned",                0, 1, false, false, false,
                              handle_aligned_attribute },
  { "weak",                   0, 0, true,  false, false,
                              handle_weak_attribute },
  { "alias",                  1, 1, true,  false, false,
                              handle_alias_attribute },
  { "no_instrument_function", 0, 0, true,  false, false,
                              handle_no_instrument_function_attribute },
  { "malloc",                 0, 0, true,  false, false,
                              handle_malloc_attribute },
  { "no_stack_limit",         0, 0, true,  false, false,
                              handle_no_limit_stack_attribute },
  { "pure",                   0, 0, true,  false, false,
                              handle_pure_attribute },
  { "deprecated",             0, 0, false, false, false,
                              handle_deprecated_attribute },
  { "vector_size",            1, 1, false, true, false,
                              handle_vector_size_attribute },
  { "visibility",             1, 1, false, false, false,
                              handle_visibility_attribute },
  { "tls_model",              1, 1, true,  false, false,
                              handle_tls_model_attribute },
  { "nonnull",                0, -1, false, true, true,
                              handle_nonnull_attribute },
  { "nothrow",                0, 0, true,  false, false,
                              handle_nothrow_attribute },
  { "may_alias",              0, 0, false, true, false, NULL },
  { "cleanup",                1, 1, true, false, false,
                              handle_cleanup_attribute },
  { "warn_unused_result",     0, 0, false, true, true,
                              handle_warn_unused_result_attribute },
  { "sentinel",               0, 1, false, true, true,
                              handle_sentinel_attribute },
  { NULL,                     0, 0, false, false, false, NULL }
};


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