[PATCH] D102772: [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 17:05:06 PDT 2021


vitalybuka accepted this revision.
vitalybuka added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757-760
+    bool HaveSanitizeCoverage =
+        CGM.getCodeGenOpts().SanitizeCoverageType ||
+        CGM.getCodeGenOpts().SanitizeCoverageIndirectCalls ||
+        CGM.getCodeGenOpts().SanitizeCoverageTraceCmp;
----------------
consider adding method into CodeGenOptions and replace here and and the rest 
ideally in a separate patch



================
Comment at: clang/test/CodeGen/sanitize-coverage.c:23-87
+static inline __attribute__((__always_inline__)) void always_inlined_fn(int n) {
+  if (n)
+    x[n] = 42;
+}
+// CHECK-LABEL: define dso_local void @test_always_inline(
+void test_always_inline(int n) {
+  // CHECK-DAG: call void @__sanitizer_cov_trace_pc
----------------
you are adding tests for unrelated code.
Could you please land is as a separate NFC patch first?


================
Comment at: llvm/lib/AsmParser/LLLexer.cpp:674
   KEYWORD(nounwind);
+  KEYWORD(no_sanitize_coverage);
   KEYWORD(null_pointer_is_valid);
----------------
looking at the rest, seems "nosanitize_coverage" follows pattern better :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102772



More information about the llvm-commits mailing list