On 18 October 2013 10:50, Aaron Ballman <[email protected]> wrote:
> Can this be done as part of the attribute spelling instead of a
> separate bit? Eg) introduce GCC as a spelling that implies GNU?
>
You can add a GCC spelling but you can't make a single spelling imply both
GNU and CXX11<"gnu",...>. I tried this first -- having one GCC entry in the
Spellings list imply two spellings under the hood, but it was really,
nasty. Do not suggest that I do this unless you try it.
> def Const : InheritableAttr {
> > - let Spellings = [GNU<"const">, GNU<"__const">, CXX11<"gnu", "const">];
> > + let Spellings = [GNU<"const">, GNU<"__const">, CXX11<"gnu", "const">,
> > + CXX11<"gnu", "__const">];
> > + let GCC = 1;
> > }
>
> This should be a separate patch with a test case for the additional
> spelling.
>
So indeed it can. I'll land that.
> def NoSanitizeAddress : InheritableAttr {
> > let Spellings = [GNU<"no_address_safety_analysis">,
> > - GNU<"no_sanitize_address">];
> > + GNU<"no_sanitize_address">,
> > + CXX11<"gnu", "no_address_safety_analysis">,
> > + CXX11<"gnu", "no_sanitize_address">];
> > + let GCC = 1;
> > }
>
> As should this.
>
And I'll land this.
Nick
Otherwise, patch LTGTM!
>
> ~Aaron
>
> On Fri, Oct 18, 2013 at 1:45 PM, Richard Smith <[email protected]>
> wrote:
> > Can you arrange to only emit the generated function once? Otherwise,
> lgtm.
> >
> > On 18 Oct 2013 01:15, "Nick Lewycky" <[email protected]> wrote:
> >>
> >> The attached patch refactors a string switch table about attributes into
> >> the Attrs.td file. Any behaviour change is incidental (ie., the table
> was
> >> out of sync before this change), this is a refactoring.
> >>
> >> Please review!
> >>
> >> Nick
> >>
> >>
> >>
> >> _______________________________________________
> >> cfe-commits mailing list
> >> [email protected]
> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >>
> >
> > _______________________________________________
> > cfe-commits mailing list
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits