[PATCH] D108029: [clang][Codegen] Introduce the disable_sanitizer_instrumentation attribute

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 02:54:55 PDT 2021


glider added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:2945
+  let Spellings = [Clang<"disable_sanitizer_instrumentation">];
+  let Subjects = SubjectList<[Function]>;
+  let Documentation = [DisableSanitizerInstrumentationDocs];
----------------
aaron.ballman wrote:
> Do we want this to also appertain to `GlobalVar` and `ObjCMethod` so it's got the same subjects as `no_sanitize`?
Good catch, thank you. When adding the new attribute to ASan, we probably want it to mimic the behavior of `no_sanitize("address")`


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:526-528
+  if (CurFuncDecl->hasAttr<DisableSanitizerInstrumentationAttr>())
+    return true;
+  return false;
----------------
aaron.ballman wrote:
> 
Right :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108029/new/

https://reviews.llvm.org/D108029



More information about the llvm-commits mailing list