[llvm] [LLVM] Make sanitizers respect the disable_santizer_instrumentation attribute. (PR #91732)

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 05:10:16 PDT 2024


================
@@ -803,6 +803,8 @@ bool GCOVProfiler::emitProfileNotes(
         continue;
       if (F.hasFnAttribute(llvm::Attribute::SkipProfile))
         continue;
+      if (F.hasFnAttribute(llvm::Attribute::DisableSanitizerInstrumentation))
----------------
melver wrote:

As Vitaly said this is not a sanitizer, so it'll be unintuitive if the attribute also kills instrumentation here.

For code that needs to disable all kinds of instrumentation, something like Linux's `noinstr` is needed, and you have to build a list of attributes that also includes `__attribute__((no_profile_instrument_function))`.

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


More information about the llvm-commits mailing list