[PATCH] Implement the flatten attribute.

Peter Collingbourne peter at pcc.me.uk
Mon May 19 15:21:08 PDT 2014


On Mon, May 19, 2014 at 02:44:40PM -0400, Aaron Ballman wrote:
> > Index: include/clang/Basic/Attr.td
> > ===================================================================
> > --- include/clang/Basic/Attr.td
> > +++ include/clang/Basic/Attr.td
> > @@ -668,6 +668,12 @@
> >    let Documentation = [Undocumented];
> >  }
> >
> > +def Flatten : InheritableAttr {
> > +  let Spellings = [GNU<"flatten">];
> 
> This should be spelled with a GCC spelling instead of GNU.

Done.

> > +  let Subjects = SubjectList<[Function]>;
> 
> What about member functions? Templates? Obj-C methods?

First two yes, last not sure.

> > +  let Documentation = [Undocumented];
> 
> Please document this attribute prior to committing.

Done.

> Second if can be hoisted into the first if. That being said, I prefer
> the way Alp proposed to implement it as it is a bit more concise and
> doesn't require a signature change where the caller is required.

I decided to change it to the way Alp proposed.

> Missing test cases for semantics of the attribute (that it applies to
> the subjects you expect, takes no arguments, etc).

Added.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list