summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-02-21 13:44:43 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-02-21 13:44:43 +0000
commit7803b888c4daf4523ba6fa64234aba29cbe36d95 (patch)
treeefddc9981d08352e2c71f21a4a6a5c07185c7896
parenta0c95eb2d6490fff3a2566c150e31dc98783b4b9 (diff)
downloadbcm5719-llvm-7803b888c4daf4523ba6fa64234aba29cbe36d95.tar.gz
bcm5719-llvm-7803b888c4daf4523ba6fa64234aba29cbe36d95.zip
Moving the documentation for the sanitizer negation attributes into AttrDocs.
llvm-svn: 201850
-rw-r--r--clang/docs/AttributeReference.rst38
-rw-r--r--clang/docs/LanguageExtensions.rst31
-rw-r--r--clang/include/clang/Basic/Attr.td6
-rw-r--r--clang/include/clang/Basic/AttrDocs.td32
4 files changed, 73 insertions, 34 deletions
diff --git a/clang/docs/AttributeReference.rst b/clang/docs/AttributeReference.rst
index 6e5d2157608..ef301f5dc5a 100644
--- a/clang/docs/AttributeReference.rst
+++ b/clang/docs/AttributeReference.rst
@@ -291,6 +291,44 @@ not ODR-equivalent.
Query for this feature with ``__has_attribute(enable_if)``.
+no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address)
+-----------------------------------------------------------------------------------------------------------
+.. csv-table:: Supported Syntaxes
+ :header: "GNU", "C++11", "__declspec", "Keyword"
+
+ "X","X","",""
+
+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.
+
+
+no_sanitize_memory
+------------------
+.. csv-table:: Supported Syntaxes
+ :header: "GNU", "C++11", "__declspec", "Keyword"
+
+ "X","","",""
+
+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.
+
+
+no_sanitize_thread
+------------------
+.. csv-table:: Supported Syntaxes
+ :header: "GNU", "C++11", "__declspec", "Keyword"
+
+ "X","","",""
+
+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.
+
+
objc_method_family
------------------
.. csv-table:: Supported Syntaxes
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 2c0c7d2b3d2..9474bf2069f 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -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
======================
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 922dfa53fee..5c597bf99c6 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -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)
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index e344946d9d2..37ffee1c75a 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -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.
+ }];
+}
OpenPOWER on IntegriCloud