[clang] [Clang] Improve documentation for __builtin_allow_sanitize_check() (PR #175106)

Marco Elver via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 17 13:16:48 PST 2026


================
@@ -254,37 +254,39 @@ AddressSanitizer also supports
 works similarly to ``__attribute__((no_sanitize("address")))``, but it also
 prevents instrumentation performed by other sanitizers.
 
-Conditional Sanitizer Checks with ``__builtin_allow_sanitize_check``
---------------------------------------------------------------------
+Explicit Sanitizer Checks with ``__builtin_allow_sanitize_check``
+-----------------------------------------------------------------
 
 The ``__builtin_allow_sanitize_check("address")`` builtin can be used to
-conditionally execute code only when AddressSanitizer is active for the current
-function (after inlining). This is particularly useful for inserting explicit,
-sanitizer-specific checks around operations like syscalls or inline assembly,
-which might otherwise be unchecked by the sanitizer.
+conditionally execute code only when AddressSanitizer checks are allowed in the
+current context (after inlining). This is particularly useful for inserting
----------------
melver wrote:

"[..] conditionally execute code only when AddressSanitizer checks are allowed in the
current context (after inlining)" -> "[..] conditionally execute code depending on whether AddressSanitizer checks are enabled and permitted by the current policy (after inlining)"

Does that sound better?

https://github.com/llvm/llvm-project/pull/175106


More information about the cfe-commits mailing list