]> granicus.if.org Git - clang/commitdiff
Moving the documentation for the sanitizer negation attributes into AttrDocs.
authorAaron Ballman <aaron@aaronballman.com>
Fri, 21 Feb 2014 13:44:43 +0000 (13:44 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 21 Feb 2014 13:44:43 +0000 (13:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201850 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 6e5d2157608ff59a11d3df205534a974146da202..ef301f5dc5abbb8acbe4ddd3386d65c89ecae9f9 100644 (file)
@@ -291,6 +291,44 @@ not ODR-equivalent.
 Query for this feature with ``__has_attribute(enable_if)``.\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
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","X","",""\r
+\r
+Use ``__attribute__((no_sanitize_address))`` on a function declaration to\r
+specify that address safety instrumentation (e.g. AddressSanitizer) should\r
+not be applied to that function.\r
+\r
+\r
+no_sanitize_memory\r
+------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","","",""\r
+\r
+Use ``__attribute__((no_sanitize_memory))`` on a function declaration to\r
+specify that checks for uninitialized memory should not be inserted \r
+(e.g. by MemorySanitizer). The function may still be instrumented by the tool\r
+to avoid false positives in other places.\r
+\r
+\r
+no_sanitize_thread\r
+------------------\r
+.. csv-table:: Supported Syntaxes\r
+   :header: "GNU", "C++11", "__declspec", "Keyword"\r
+\r
+   "X","","",""\r
+\r
+Use ``__attribute__((no_sanitize_thread))`` on a function declaration to\r
+specify that checks for data races on plain (non-atomic) memory accesses should\r
+not be inserted by ThreadSanitizer. The function is still instrumented by the\r
+tool to avoid false positives and provide meaningful stack traces.\r
+\r
+\r
 objc_method_family\r
 ------------------\r
 .. csv-table:: Supported Syntaxes\r
index 2c0c7d2b3d25efed637776c777e7fcf881a45b36..9474bf2069fde6189a1a34cdde9e3f9e94e6e08f 100644 (file)
@@ -1639,46 +1639,15 @@ in the analyzer's `list of source-level annotations
 Extensions for Dynamic Analysis
 ===============================
 
-.. _langext-address_sanitizer:
-
-AddressSanitizer
-----------------
-
 Use ``__has_feature(address_sanitizer)`` to check if the code is being built
 with :doc:`AddressSanitizer`.
 
-Use ``__attribute__((no_sanitize_address))``
-on a function declaration
-to specify that address safety instrumentation (e.g. AddressSanitizer) should
-not be applied to that function.
-
-.. _langext-thread_sanitizer:
-
-ThreadSanitizer
-----------------
-
 Use ``__has_feature(thread_sanitizer)`` to check if the code is being built
 with :doc:`ThreadSanitizer`.
 
-Use ``__attribute__((no_sanitize_thread))`` on a function declaration
-to specify that checks for data races on plain (non-atomic) memory accesses
-should not be inserted by ThreadSanitizer.
-The function is still instrumented by the tool to avoid false positives and
-provide meaningful stack traces.
-
-.. _langext-memory_sanitizer:
-
-MemorySanitizer
-----------------
 Use ``__has_feature(memory_sanitizer)`` to check if the code is being built
 with :doc:`MemorySanitizer`.
 
-Use ``__attribute__((no_sanitize_memory))`` on a function declaration
-to specify that checks for uninitialized memory should not be inserted 
-(e.g. by MemorySanitizer). The function may still be instrumented by the tool
-to avoid false positives in other places.
-
-
 Thread Safety Analysis
 ======================
 
index 922dfa53feea23bca3ee4c33aa18823e91621d86..5c597bf99c6e8411da920625f854af5599f62b6e 100644 (file)
@@ -1244,21 +1244,21 @@ def NoSanitizeAddress : InheritableAttr {
   let Spellings = [GCC<"no_address_safety_analysis">,
                    GCC<"no_sanitize_address">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
-  let Documentation = [Undocumented];
+  let Documentation = [NoSanitizeAddressDocs];
 }
 
 // Attribute to disable ThreadSanitizer checks.
 def NoSanitizeThread : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_thread">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
-  let Documentation = [Undocumented];
+  let Documentation = [NoSanitizeThreadDocs];
 }
 
 // Attribute to disable MemorySanitizer checks.
 def NoSanitizeMemory : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
-  let Documentation = [Undocumented];
+  let Documentation = [NoSanitizeMemoryDocs];
 }
 
 // C/C++ Thread safety attributes (e.g. for deadlock, data race checking)
index e344946d9d21e5f6a8734cdd4cb8046559e34304..37ffee1c75a9b6343f9f152c05dd3a3a20940964 100644 (file)
@@ -571,3 +571,35 @@ This attribute accepts a single parameter that must be one of the following:
 ``unknown``, ``consumed``, or ``unconsumed``.
   }];
 }
+
+def NoSanitizeAddressDocs : Documentation {
+  let Category = DocCatFunction;
+  // This function has multiple distinct spellings, and so it requires a custom
+  // heading to be specified. The most common spelling is sufficient.
+  let Heading = "no_sanitize_address";
+  let Content = [{
+Use ``__attribute__((no_sanitize_address))`` on a function declaration to
+specify that address safety instrumentation (e.g. AddressSanitizer) should
+not be applied to that function.
+  }];
+}
+
+def NoSanitizeThreadDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use ``__attribute__((no_sanitize_thread))`` on a function declaration to
+specify that checks for data races on plain (non-atomic) memory accesses should
+not be inserted by ThreadSanitizer. The function is still instrumented by the
+tool to avoid false positives and provide meaningful stack traces.
+  }];
+}
+
+def NoSanitizeMemoryDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use ``__attribute__((no_sanitize_memory))`` on a function declaration to
+specify that checks for uninitialized memory should not be inserted 
+(e.g. by MemorySanitizer). The function may still be instrumented by the tool
+to avoid false positives in other places.
+  }];
+}