patch: add GCC bit to Attr.td and use it to disable -Wgcc-compat

Nick Lewycky nlewycky at google.com
Mon Oct 28 19:52:35 PDT 2013


On 18 October 2013 10:50, Aaron Ballman <aaron at aaronballman.com> 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 <richard at metafoo.co.uk>
> wrote:
> > Can you arrange to only emit the generated function once? Otherwise,
> lgtm.
> >
> > On 18 Oct 2013 01:15, "Nick Lewycky" <nlewycky at google.com> 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
> >> cfe-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >>
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131028/0f1fb2af/attachment.html>


More information about the cfe-commits mailing list