]> granicus.if.org Git - clang/commitdiff
Add some basic documentation for the __attribute__((target(""))) support.
authorEric Christopher <echristo@gmail.com>
Mon, 6 Jul 2015 23:51:56 +0000 (23:51 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 6 Jul 2015 23:51:56 +0000 (23:51 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241524 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/AttrDocs.td

index 107458e461456822f3e26a0f6e6c08a63101c5cf..e4ca0cb4778e568494e37cefdddc9acad4bf4f89 100644 (file)
@@ -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 = [{