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

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 16 16:55:24 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
----------------
efriedma-quic wrote:

If we want to leave open the possibility of the compiler making choices along the lines of allow_ubsan_check, can we relax "allowed in the current context" a bit?

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


More information about the cfe-commits mailing list