https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Bill Wendling from comment #33)
>   __builtin_get_attr_arg (ptr, attr_name)
> 
> This could have an optional argument to specify which argument to get if the
> attr has more than one:
> 
>   __builtin_get_attr_arg (ptr, attr_name, pos)

This is a bad idea.  The first argument of counted_by attribute is an
identifier, that isn't really useful for anything and how you'd return that? 
And for other attributes which do have arguments, what exactly the argument is
is heavily dependent on the attribute and there is simply no way how to
represent those easily.
Consider
  [[omp::sequence (directive (parallel private (p)),
    omp::directive (single copyprivate (p) firstprivate (f) allocate (f)))]]
or
  __attribute__((mode (DI)))
or
  __attribute__((vector_size (16)))
or
  __attribute__ ((__format__(__printf__, 1, 2)))
or
  [[gnu::alias ("foobar")]]
etc.
What would be the argument of some of these attributes for the return of the
builtin, what types it would have, ...?

Reply via email to