[PATCH] D108202: [tsan] Add support for disable_sanitizer_instrumentation attribute
Marco Elver via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 17 13:53:02 PDT 2021
melver accepted this revision.
melver added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/docs/ThreadSanitizer.rst:106
+
+The ``disable_sanitizer_instrumentation`` attribute can be applied to a certain
+function to prevent all kinds of instrumentation. This attribute overrides
----------------
s/to a certain function/to functions/
================
Comment at: clang/docs/ThreadSanitizer.rst:108
+function to prevent all kinds of instrumentation. This attribute overrides
+``no_sanitize("thread")`` and may introduce false positives, so it should
+be used with care, e.g. when the user wants to ensure critical code does not
----------------
It might be clearer to say
```
.. of instrumentation. As a result, it may introduce false positives and incorrect stack traces. Therefore, it should be used with care, and only if absolutely required; for example for certain code that cannot tolerate any instrumentation and resulting side-effects. This attribute overrides ``no_sanitize("thread")``.
```
to deter normal users from using this.
================
Comment at: clang/test/CodeGen/sanitize-thread-disable.c:11
+//
+// CHECK: @instrumented1
+// TSAN: call void @__tsan_func_entry
----------------
================
Comment at: clang/test/CodeGen/sanitize-thread-disable.c:29
+//
+// CHECK: @no_false_positives1
+// TSAN: call void @__tsan_func_entry
----------------
================
Comment at: clang/test/CodeGen/sanitize-thread-disable.c:45
+//
+// CHECK: @no_instrumentation1
+// TSAN-NOT: call void @__tsan_func_entry
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108202/new/
https://reviews.llvm.org/D108202
More information about the cfe-commits
mailing list