Adding manual headings to the new capability attributes' documentation.
authorAaron Ballman <aaron@aaronballman.com>
Sat, 22 Feb 2014 19:04:55 +0000 (19:04 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Sat, 22 Feb 2014 19:04:55 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201942 91177308-0d34-0410-b5e6-96231b3b80d8

docs/AttributeReference.rst
include/clang/Basic/AttrDocs.td

index 84b5440ac30d871464405967db0fcb8a3846ed6c..1f3af06ae36a14158778449d2e7d24066612df26 100644 (file)
@@ -63,6 +63,27 @@ The semantics are as follows:
   a sequence equivalent to "movs pc, lr" will be used.\r
 \r
 \r
+acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability)\r
+-----------------------------------------------------------------------------------------------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","X","",""\r
+\r
+Marks a function as acquiring a capability.\r
+\r
+\r
+assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability)\r
+-------------------------------------------------------------------------------------------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","X","",""\r
+\r
+Marks a function that dynamically tests whether a capability is held, and halts\r
+the program if it is not held.\r
+\r
+\r
 availability\r
 ------------\r
 .. csv-table:: Supported Syntaxes\r
@@ -356,6 +377,52 @@ Clang implements two kinds of checks with this attribute.
    incorrect, the caller of ``foo`` will receive a warning.\r
 \r
 \r
+noduplicate (clang::noduplicate)\r
+--------------------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","X","",""\r
+\r
+The ``noduplicate`` attribute can be placed on function declarations to control\r
+whether function calls to this function can be duplicated \r
+or not as a result of optimizations. This is required for the implementation\r
+of functions with certain special requirements, like the OpenCL "barrier", \r
+function that, depending on the hardware, might require to be run concurrently\r
+by all the threads that are currently executing in lockstep on the hardware.\r
+For example this attribute applied on the function "nodupfunc" \r
+avoids that this code:\r
+\r
+.. code-block:: c\r
+\r
+  void nodupfunc() __attribute__((noduplicate));\r
+  // Setting it as a C++11 attribute is also valid\r
+  // void nodupfunc() [[clang::noduplicate]];\r
+  void foo();\r
+  void bar();\r
+\r
+  nodupfunc();\r
+  if (a > n) {\r
+    foo();\r
+  } else {\r
+    bar();\r
+  }\r
+\r
+gets possibly modified by some optimization into code similar to this:\r
+\r
+.. code-block:: c\r
+\r
+  if (a > n) {\r
+    nodupfunc();\r
+    foo();\r
+  } else {\r
+    nodupfunc();\r
+    bar();\r
+  }\r
+\r
+where the barrier call is duplicated and sunk into the two branches of the condition.\r
+\r
+\r
 no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address)\r
 -----------------------------------------------------------------------------------------------------------\r
 .. csv-table:: Supported Syntaxes\r
@@ -558,50 +625,29 @@ caveats to this use of name mangling:
 \r
 Query for this feature with ``__has_extension(attribute_overloadable)``.\r
 \r
-noduplicate\r
------------\r
+\r
+release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability)\r
+-----------------------------------------------------------------------------------------------------------\r
 .. csv-table:: Supported Syntaxes\r
    :header: "GNU", "C++11", "__declspec", "Keyword"\r
 \r
    "X","X","",""\r
 \r
-The ``noduplicate`` attribute can be placed on function declarations to control\r
-whether function calls to this function can be duplicated \r
-or not as a result of optimizations. This is required for the implementation\r
-of functions with certain special requirements, like the OpenCL "barrier", \r
-function that, depending on the hardware, might require to be run concurrently\r
-by all the threads that are currently executing in lockstep on the hardware.\r
-For example this attribute applied on the function "nodupfunc" \r
-avoids that this code:\r
-\r
-.. code-block:: c\r
-\r
-  void nodupfunc() __attribute__((noduplicate));\r
-  // Setting it as a C++11 attribute is also valid\r
-  // void nodupfunc() [[clang::noduplicate]];\r
-  void foo();\r
-  void bar();\r
+Marks a function as releasing a capability.\r
 \r
-  nodupfunc();\r
-  if (a > n) {\r
-    foo();\r
-  } else {\r
-    bar();\r
-  }\r
 \r
-gets possibly modified by some optimization into code similar to this:\r
+try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability)\r
+---------------------------------------------------------------------------------------------------------------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
 \r
-.. code-block:: c\r
+   "X","X","",""\r
 \r
-  if (a > n) {\r
-    nodupfunc();\r
-    foo();\r
-  } else {\r
-    nodupfunc();\r
-    bar();\r
-  }\r
+Marks a function that attemps to aquire a capability. This function may fail to\r
+actually acquire the capability; they accept a Boolean value determining\r
+whether acquiring the capability means success (true), or failing to acquire\r
+the capability means success (false).\r
 \r
-where the barrier call is duplicated and sunk into the two branches of the condition.\r
 \r
 Variable Attributes\r
 ===================\r
index ebe4bb9abb2e6722052b5d6756540e311a1ab6ef..1e67db09706b20182ba1019a07940f33b82237dd 100644 (file)
@@ -79,6 +79,7 @@ that appears to be capable of returning to its caller.
 
 def AssertCapabilityDocs : Documentation {
   let Category = DocCatFunction;
+  let Heading = "assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability)";
   let Content = [{
 Marks a function that dynamically tests whether a capability is held, and halts
 the program if it is not held.
@@ -87,6 +88,7 @@ the program if it is not held.
 
 def AcquireCapabilityDocs : Documentation {
   let Category = DocCatFunction;
+  let Heading = "acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability)";
   let Content = [{
 Marks a function as acquiring a capability.
   }];
@@ -94,6 +96,7 @@ Marks a function as acquiring a capability.
 
 def TryAcquireCapabilityDocs : Documentation {
   let Category = DocCatFunction;
+  let Heading = "try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability)";
   let Content = [{
 Marks a function that attemps to aquire a capability. This function may fail to
 actually acquire the capability; they accept a Boolean value determining
@@ -104,6 +107,7 @@ the capability means success (false).
 
 def ReleaseCapabilityDocs : Documentation {
   let Category = DocCatFunction;
+  let Heading = "release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability)";
   let Content = [{
 Marks a function as releasing a capability.
   }];