r241524 - Add some basic documentation for the __attribute__((target(""))) support.

Eric Christopher echristo at gmail.com
Mon Jul 6 17:03:22 PDT 2015


On Mon, Jul 6, 2015 at 4:55 PM Aaron Ballman <aaron at aaronballman.com> wrote:

> On Mon, Jul 6, 2015 at 7:51 PM, Eric Christopher <echristo at gmail.com>
> wrote:
> > Author: echristo
> > Date: Mon Jul  6 18:51:56 2015
> > New Revision: 241524
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=241524&view=rev
> > Log:
> > Add some basic documentation for the __attribute__((target(""))) support.
> >
> > Describes the general syntax of how it's used with the unfortunate
> > usage of "subtarget features" and some examples from the x86 port
> > to help users.
> >
> > Modified:
> >     cfe/trunk/include/clang/Basic/AttrDocs.td
>
> Did you forget to change the Undocument in Attr.td for the TargetAttr
> object?
>

Why yes, yes I did.

dzur:~/sources/llvm/tools/clang> git svn dcommit
Committing to https://llvm.org/svn/llvm-project/cfe/trunk ...
M include/clang/Basic/Attr.td
Committed r241529

Thanks!

-eric


>
> ~Aaron
>
> >
> > Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=241524&r1=241523&r2=241524&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
> > +++ cfe/trunk/include/clang/Basic/AttrDocs.td Mon Jul  6 18:51:56 2015
> > @@ -678,6 +678,25 @@ The semantics are as follows:
> >    }];
> >  }
> >
> > +def TargetDocs : Documentation {
> > +  let Category = DocCatFunction;
> > +  let Content = [{
> > +Clang supports the GNU style ``__attribute__((target("OPTIONS")))``
> attribute.
> > +This attribute may be attached to a function definition and instructs
> > +the backend to use different code generation options than were passed
> on the
> > +command line.
> > +
> > +The current set of options correspond to the existing "subtarget
> features" for
> > +the target with or without a "-mno-" in front corresponding to the
> absence
> > +of the feature, as well as ``arch="CPU"`` which will change the default
> "CPU"
> > +for the function.
> > +
> > +Example "subtarget features" from the x86 backend include: "mmx",
> "sse", "sse4.2",
> > +"avx", "xop" and largely correspond to the machine specific options
> handled by
> > +the front end.
> > +}];
> > +}
> > +
> >  def DocCatAMDGPURegisterAttributes :
> >    DocumentationCategory<"AMD GPU Register Attributes"> {
> >    let Content = [{
> >
> >
> > _______________________________________________
> > 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/20150707/6803b593/attachment.html>


More information about the cfe-commits mailing list