[patch i386,c,c++]: PR/12171 - calling convention omitted in error message

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Dec 23 16:29:00 GMT 2010


On Thu, Dec 23, 2010 at 6:25 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 22 Dec 2010, Gabriel Dos Reis wrote:
>
>> I'm satisfied with the patch.
>
> I still maintain that even if you do wish to print only some attributes
> (in which case I'd say the hook should be a hook to say what target
> attributes to print, not one saying what's a calling convention
> attribute, since the two sets need not be the same) the duplication
> between ix86_attribute_affects_calling_convention and other functions in
> knowing what attributes are calling convention attributes is best avoided.
> And manually handling the possibility of leading and trailing __ in a back
> end is certainly a bad idea; we have a perfectly good is_attribute_p
> function to handle this in one place only.
>
> Even better than a hook saying whether to print an attribute would be an
> additional field in struct attribute_spec saying whether an attribute
> (target or not) should be printed.  That way the information - if you do
> want to print only some attributes - would be provided via an existing
> data hook rather than needing a new function hook at all, and you can
> easily start printing some target-independent attributes as well if
> desired.

I agree that code duplication is not a good idea, and your suggestion of
is_attribute_p is a very good one.

On ther other hand, we should not embark on the road of printing
all possible attributes in a type, so having a general purpose
hook for that does not strike me as a good think.  That leaves the
possibility of adding a field to attribute_spec which I like.

-- Gaby



More information about the Gcc-patches mailing list