Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Sanitizer Coverage => Coverage Sanitizer #106505

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cor3ntin
Copy link
Contributor

This is so that we are consistent with other sanitizers. Importantly, this makes the docs clearer.

Driver flags are left unchanged (We are not proposing to rename sancov either). The good thing is that flags were already consistent with other sanitizers so there would not be any motivation to change them, even if we were feeling disruptive.

This is so that we are consistent with other sanitizers.
Importantly, this makes the docs clearer.

Driver flags are left unchanged. The good thing is that flags
were already consistent with other sanitizers so there
would not be any motivation to change them,
even if we were feeling disruptive.
@cor3ntin cor3ntin requested review from JDevlieghere and a team as code owners August 29, 2024 07:52
@llvmbot llvmbot added clang Clang issues not falling into any other category compiler-rt libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. lldb clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:codegen compiler-rt:asan Address sanitizer compiler-rt:fuzzer PGO Profile Guided Optimizations compiler-rt:sanitizer llvm:ir llvm:transforms labels Aug 29, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer
@llvm/pr-subscribers-clang-driver
@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-lldb

@llvm/pr-subscribers-libcxx

Author: cor3ntin (cor3ntin)

Changes

This is so that we are consistent with other sanitizers. Importantly, this makes the docs clearer.

Driver flags are left unchanged (We are not proposing to rename sancov either). The good thing is that flags were already consistent with other sanitizers so there would not be any motivation to change them, even if we were feeling disruptive.


Patch is 84.39 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/106505.diff

79 Files Affected:

  • (renamed) clang/docs/CoverageSanitizer.rst (+8-8)
  • (modified) clang/docs/SourceBasedCodeCoverage.rst (+1-1)
  • (modified) clang/docs/UsersManual.rst (+1-1)
  • (modified) clang/docs/index.rst (+1-1)
  • (modified) clang/docs/tools/clang-formatted-files.txt (+1-1)
  • (modified) clang/include/clang/Basic/AttrDocs.td (+2-2)
  • (modified) clang/include/clang/Basic/CodeGenOptions.def (+9-9)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+1-1)
  • (modified) clang/include/clang/Basic/DiagnosticDriverKinds.td (+4-4)
  • (modified) clang/include/clang/Driver/Options.td (+13-13)
  • (modified) clang/lib/CodeGen/BackendUtil.cpp (+5-5)
  • (modified) clang/lib/Driver/SanitizerArgs.cpp (+2-2)
  • (modified) clang/test/CodeGen/Inputs/memprof.exe ()
  • (modified) clang/test/CodeGen/sancov-new-pm.c (+1-1)
  • (modified) clang/test/Driver/sancov.c (+1-1)
  • (modified) compiler-rt/include/sanitizer/common_interface_defs.h (+1-1)
  • (modified) compiler-rt/include/sanitizer/coverage_interface.h (+1-1)
  • (modified) compiler-rt/lib/fuzzer/dataflow/DataFlow.cpp (+2-2)
  • (modified) compiler-rt/lib/sanitizer_common/CMakeLists.txt (+9-9)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp (+3-3)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_interface.inc (+2-2)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp (+4-4)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp (+3-3)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp (+4-4)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp (+2-2)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp (+3-3)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.cpp (+1-1)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.h (+1-1)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.inc (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp (+7-7)
  • (modified) compiler-rt/test/asan/TestCases/coverage-and-lsan.cpp (+1-1)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_allowlist_ignorelist.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter_default_impl.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline_bool_flag.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_no_prune.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_symbolize.cpp (+1-1)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_loads_stores.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp (+5-5)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard.cpp (+4-4)
  • (modified) libcxx/docs/VendorDocumentation.rst (+1-1)
  • (modified) lldb/docs/resources/fuzzing.rst (+2-2)
  • (modified) llvm/docs/FuzzingLLVM.rst (+1-1)
  • (modified) llvm/docs/LangRef.rst (+1-1)
  • (modified) llvm/docs/LibFuzzer.rst (+6-6)
  • (modified) llvm/docs/SymbolizerMarkupFormat.rst (+1-1)
  • (modified) llvm/include/llvm/Transforms/Instrumentation.h (+3-3)
  • (renamed) llvm/include/llvm/Transforms/Instrumentation/CoverageSanitizer.h (+7-7)
  • (modified) llvm/lib/Passes/PassBuilder.cpp (+1-1)
  • (modified) llvm/lib/Passes/PassRegistry.def (+1-1)
  • (modified) llvm/lib/Transforms/Instrumentation/CMakeLists.txt (+1-1)
  • (renamed) llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp (+41-41)
  • (modified) llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll (+2-2)
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof.nocolinfo.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_internal_linkage.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_loop_unroll.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_missing_leaf.exe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic_v3.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-badentrysizes.bin ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-example.bin ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-sample-o2.bin ()
  • (modified) llvm/test/tools/sancov/Inputs/test-linux_x86_64 ()
  • (modified) llvm/test/tools/sancov/Inputs/test-windows_x86_64 ()
  • (modified) llvm/tools/sancov/sancov.cpp (+2-2)
  • (modified) llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn (+8-8)
  • (modified) llvm/utils/gn/secondary/llvm/lib/Transforms/Instrumentation/BUILD.gn (+1-1)
diff --git a/clang/docs/SanitizerCoverage.rst b/clang/docs/CoverageSanitizer.rst
similarity index 97%
rename from clang/docs/SanitizerCoverage.rst
rename to clang/docs/CoverageSanitizer.rst
index 45ad03cb43774c..a5dba0ec093950 100644
--- a/clang/docs/SanitizerCoverage.rst
+++ b/clang/docs/CoverageSanitizer.rst
@@ -1,5 +1,5 @@
 =================
-SanitizerCoverage
+CoverageSanitizer
 =================
 
 .. contents::
@@ -8,7 +8,7 @@ SanitizerCoverage
 Introduction
 ============
 
-LLVM has a simple code coverage instrumentation built in (SanitizerCoverage).
+LLVM has a simple code coverage instrumentation built in (CoverageSanitizer).
 It inserts calls to user-defined functions on function-, basic-block-, and edge- levels.
 Default implementations of those callbacks are provided and implement
 simple coverage reporting and visualization,
@@ -208,7 +208,7 @@ This mechanism is used for fuzzing the Linux kernel
 
 Instrumentation points
 ======================
-Sanitizer Coverage offers different levels of instrumentation.
+Coverage Sanitizer offers different levels of instrumentation.
 
 * ``edge`` (default): edges are instrumented (see below).
 * ``bb``: basic blocks are instrumented.
@@ -397,13 +397,13 @@ together with ``__has_feature(coverage_sanitizer)``.
 Disabling instrumentation without source modification
 =====================================================
 
-It is sometimes useful to tell SanitizerCoverage to instrument only a subset of the
+It is sometimes useful to tell CoverageSanitizer to instrument only a subset of the
 functions in your target without modifying source files.
 With ``-fsanitize-coverage-allowlist=allowlist.txt``
 and ``-fsanitize-coverage-ignorelist=blocklist.txt``,
 you can specify such a subset through the combination of an allowlist and a blocklist.
 
-SanitizerCoverage will only instrument functions that satisfy two conditions.
+CoverageSanitizer will only instrument functions that satisfy two conditions.
 First, the function should belong to a source file with a path that is both allowlisted
 and not blocklisted.
 Second, the function should have a mangled name that is both allowlisted and not blocklisted.
@@ -471,16 +471,16 @@ Example:
     % clang++ -g cov.cc -fsanitize=address -fsanitize-coverage=trace-pc-guard
     % ASAN_OPTIONS=coverage=1 ./a.out; wc -c *.sancov
     main
-    SanitizerCoverage: ./a.out.7312.sancov 2 PCs written
+    CoverageSanitizer: ./a.out.7312.sancov 2 PCs written
     24 a.out.7312.sancov
     % ASAN_OPTIONS=coverage=1 ./a.out foo ; wc -c *.sancov
     foo
     main
-    SanitizerCoverage: ./a.out.7316.sancov 3 PCs written
+    CoverageSanitizer: ./a.out.7316.sancov 3 PCs written
     24 a.out.7312.sancov
     32 a.out.7316.sancov
 
-Every time you run an executable instrumented with SanitizerCoverage
+Every time you run an executable instrumented with CoverageSanitizer
 one ``*.sancov`` file is created during the process shutdown.
 If the executable is dynamically linked against instrumented DSOs,
 one ``*.sancov`` file will be also created for every DSO.
diff --git a/clang/docs/SourceBasedCodeCoverage.rst b/clang/docs/SourceBasedCodeCoverage.rst
index 73910e134a5891..313063b976547c 100644
--- a/clang/docs/SourceBasedCodeCoverage.rst
+++ b/clang/docs/SourceBasedCodeCoverage.rst
@@ -14,7 +14,7 @@ information directly. This allows it to generate very precise coverage data.
 
 Clang ships two other code coverage implementations:
 
-* :doc:`SanitizerCoverage` - A low-overhead tool meant for use alongside the
+* :doc:`CoverageSanitizer` - A low-overhead tool meant for use alongside the
   various sanitizers. It can provide up to edge-level coverage.
 
 * gcov - A GCC-compatible coverage implementation which operates on DebugInfo.
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index f27fa4ace917ea..738ba7fa4855a8 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2140,7 +2140,7 @@ are listed below.
 .. option:: -f[no-]sanitize-coverage=[type,features,...]
 
    Enable simple code coverage in addition to certain sanitizers.
-   See :doc:`SanitizerCoverage` for more details.
+   See :doc:`CoverageSanitizer` for more details.
 
 .. option:: -f[no-]sanitize-address-outline-instrumentation
 
diff --git a/clang/docs/index.rst b/clang/docs/index.rst
index 4a497f4d9bcc3c..8a1097cf3e19c7 100644
--- a/clang/docs/index.rst
+++ b/clang/docs/index.rst
@@ -33,7 +33,7 @@ Using Clang as a Compiler
    DataFlowSanitizer
    LeakSanitizer
    RealtimeSanitizer
-   SanitizerCoverage
+   CoverageSanitizer
    SanitizerStats
    SanitizerSpecialCaseList
    BoundsSafety
diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt
index fc07357986d989..d105f530b5106c 100644
--- a/clang/docs/tools/clang-formatted-files.txt
+++ b/clang/docs/tools/clang-formatted-files.txt
@@ -5560,7 +5560,7 @@ llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
 llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
 llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
 llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
-llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+llvm/include/llvm/Transforms/Instrumentation/CoverageSanitizer.h
 llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
 llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
 llvm/include/llvm/Transforms/IPO/Attributor.h
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index c2b9d7cb93c309..de4959277fa8e6 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -3142,12 +3142,12 @@ instrumentations should not be applied.
 The attribute takes a list of string literals with the following accepted
 values:
 * all values accepted by ``-fno-sanitize=``;
-* ``coverage``, to disable SanitizerCoverage instrumentation.
+* ``coverage``, to disable CoverageSanitizer instrumentation.
 
 For example, ``__attribute__((no_sanitize("address", "thread")))`` specifies
 that AddressSanitizer and ThreadSanitizer should not be applied to the function
 or variable. Using ``__attribute__((no_sanitize("coverage")))`` specifies that
-SanitizerCoverage should not be applied to the function.
+CoverageSanitizer should not be applied to the function.
 
 See :ref:`Controlling Code Generation <controlling-code-generation>` for a
 full list of supported sanitizer flags.
diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
index b600198998d85b..28c91bdeec5b73 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -271,24 +271,24 @@ CODEGENOPT(SanitizeCfiICallNormalizeIntegers, 1, 0) ///< Normalize integer types
                                                     ///< CFI icall function signatures
 CODEGENOPT(SanitizeCfiCanonicalJumpTables, 1, 0) ///< Make jump table symbols canonical
                                                  ///< instead of creating a local jump table.
-CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of sanitizer coverage
+CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of coverage sanitizer
                                        ///< instrumentation.
-CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable sanitizer coverage
+CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable coverage sanitizer
                                                 ///< for indirect calls.
 CODEGENOPT(SanitizeCoverageTraceBB, 1, 0) ///< Enable basic block tracing in
-                                          ///< in sanitizer coverage.
+                                          ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceCmp, 1, 0) ///< Enable cmp instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceDiv, 1, 0) ///< Enable div instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceGep, 1, 0) ///< Enable GEP instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverage8bitCounters, 1, 0) ///< Use 8-bit frequency counters
-                                               ///< in sanitizer coverage.
+                                               ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTracePC, 1, 0) ///< Enable PC tracing
-                                          ///< in sanitizer coverage.
+                                          ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard
-                                               ///< in sanitizer coverage.
+                                               ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageInline8bitCounters, 1, 0) ///< Use inline 8bit counters.
 CODEGENOPT(SanitizeCoverageInlineBoolFlag, 1, 0) ///< Use inline bool flag.
 CODEGENOPT(SanitizeCoveragePCTable, 1, 0) ///< Create a PC Table.
diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index f2a707a8ba8d76..44017a0c95d9a7 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -419,7 +419,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
 
   /// Path to allowlist file specifying which objects
   /// (files, functions) should exclusively be instrumented
-  /// by sanitizer coverage pass.
+  /// by coverage sanitizer pass.
   std::vector<std::string> SanitizeCoverageAllowlistFiles;
 
   /// The guard style used for stack protector to get a initial value, this
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index ba90742fbdaabc..94464844afcad8 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -247,10 +247,10 @@ def err_drv_missing_sanitizer_ignorelist : Error<
   "missing sanitizer ignorelist: '%0'">;
 def err_drv_malformed_sanitizer_ignorelist : Error<
   "malformed sanitizer ignorelist: '%0'">;
-def err_drv_malformed_sanitizer_coverage_allowlist : Error<
-  "malformed sanitizer coverage allowlist: '%0'">;
-def err_drv_malformed_sanitizer_coverage_ignorelist : Error<
-  "malformed sanitizer coverage ignorelist: '%0'">;
+def err_drv_malformed_coverage_sanitizer_allowlist : Error<
+  "malformed coverage sanitizer allowlist: '%0'">;
+def err_drv_malformed_coverage_sanitizer_ignorelist : Error<
+  "malformed coverage sanitizer ignorelist: '%0'">;
 def err_drv_malformed_sanitizer_metadata_ignorelist : Error<
   "malformed sanitizer metadata ignorelist: '%0'">;
 def err_drv_unsupported_static_sanitizer_darwin : Error<
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 83cf753e824845..4b8e907317d617 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2366,11 +2366,11 @@ def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
          "inline-bool-flag">;
 def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
     Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
-    HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
+    HelpText<"Restrict coverage sanitizer instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
 def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
     Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
-    HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
+    HelpText<"Disable coverage sanitizer instrumentation for modules and functions "
              "that match the provided special case list, even the allowed ones">,
     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
 def fexperimental_sanitize_metadata_EQ : CommaJoined<["-"], "fexperimental-sanitize-metadata=">,
@@ -7311,39 +7311,39 @@ def linker_option : Joined<["--"], "linker-option=">,
   HelpText<"Add linker option">,
   MarshallingInfoStringVector<CodeGenOpts<"LinkerOptions">>;
 def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
-                              HelpText<"Sanitizer coverage type">,
+                              HelpText<"Coverage sanitizer type">,
                               MarshallingInfoInt<CodeGenOpts<"SanitizeCoverageType">>;
 def fsanitize_coverage_indirect_calls
     : Flag<["-"], "fsanitize-coverage-indirect-calls">,
-      HelpText<"Enable sanitizer coverage for indirect calls">,
+      HelpText<"Enable coverage sanitizer for indirect calls">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageIndirectCalls">>;
 def fsanitize_coverage_trace_bb
     : Flag<["-"], "fsanitize-coverage-trace-bb">,
-      HelpText<"Enable basic block tracing in sanitizer coverage">,
+      HelpText<"Enable basic block tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceBB">>;
 def fsanitize_coverage_trace_cmp
     : Flag<["-"], "fsanitize-coverage-trace-cmp">,
-      HelpText<"Enable cmp instruction tracing in sanitizer coverage">,
+      HelpText<"Enable cmp instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceCmp">>;
 def fsanitize_coverage_trace_div
     : Flag<["-"], "fsanitize-coverage-trace-div">,
-      HelpText<"Enable div instruction tracing in sanitizer coverage">,
+      HelpText<"Enable div instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceDiv">>;
 def fsanitize_coverage_trace_gep
     : Flag<["-"], "fsanitize-coverage-trace-gep">,
-      HelpText<"Enable gep instruction tracing in sanitizer coverage">,
+      HelpText<"Enable gep instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceGep">>;
 def fsanitize_coverage_8bit_counters
     : Flag<["-"], "fsanitize-coverage-8bit-counters">,
-      HelpText<"Enable frequency counters in sanitizer coverage">,
+      HelpText<"Enable frequency counters in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverage8bitCounters">>;
 def fsanitize_coverage_inline_8bit_counters
     : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">,
-      HelpText<"Enable inline 8-bit counters in sanitizer coverage">,
+      HelpText<"Enable inline 8-bit counters in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInline8bitCounters">>;
 def fsanitize_coverage_inline_bool_flag
     : Flag<["-"], "fsanitize-coverage-inline-bool-flag">,
-      HelpText<"Enable inline bool flag in sanitizer coverage">,
+      HelpText<"Enable inline bool flag in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInlineBoolFlag">>;
 def fsanitize_coverage_pc_table
     : Flag<["-"], "fsanitize-coverage-pc-table">,
@@ -7355,11 +7355,11 @@ def fsanitize_coverage_control_flow
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageControlFlow">>;
 def fsanitize_coverage_trace_pc
     : Flag<["-"], "fsanitize-coverage-trace-pc">,
-      HelpText<"Enable PC tracing in sanitizer coverage">,
+      HelpText<"Enable PC tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePC">>;
 def fsanitize_coverage_trace_pc_guard
     : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
-      HelpText<"Enable PC tracing with guard in sanitizer coverage">,
+      HelpText<"Enable PC tracing with guard in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePCGuard">>;
 def fsanitize_coverage_no_prune
     : Flag<["-"], "fsanitize-coverage-no-prune">,
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 026f16484c0949..3301a0f9b5bdee 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -80,7 +80,7 @@
 #include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"
 #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"
-#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
+#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
 #include "llvm/Transforms/ObjCARC.h"
 #include "llvm/Transforms/Scalar/EarlyCSE.h"
@@ -231,11 +231,11 @@ class EmitAssemblyHelper {
 };
 } // namespace
 
-static SanitizerCoverageOptions
+static CoverageSanitizerOptions
 getSancovOptsFromCGOpts(const CodeGenOptions &CGOpts) {
-  SanitizerCoverageOptions Opts;
+  CoverageSanitizerOptions Opts;
   Opts.CoverageType =
-      static_cast<SanitizerCoverageOptions::Type>(CGOpts.SanitizeCoverageType);
+      static_cast<CoverageSanitizerOptions::Type>(CGOpts.SanitizeCoverageType);
   Opts.IndirectCalls = CGOpts.SanitizeCoverageIndirectCalls;
   Opts.TraceBB = CGOpts.SanitizeCoverageTraceBB;
   Opts.TraceCmp = CGOpts.SanitizeCoverageTraceCmp;
@@ -662,7 +662,7 @@ static void addSanitizers(const Triple &TargetTriple,
                                 OptimizationLevel Level) {
     if (CodeGenOpts.hasSanitizeCoverage()) {
       auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
-      MPM.addPass(SanitizerCoveragePass(
+      MPM.addPass(CoverageSanitizerPass(
           SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
           CodeGenOpts.SanitizeCoverageIgnorelistFiles));
     }
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 18bb35a563167e..7f77fec0376762 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -894,12 +894,12 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
     parseSpecialCaseListArg(
         D, Args, CoverageAllowlistFiles,
         options::OPT_fsanitize_coverage_allowlist, OptSpecifier(),
-        clang::diag::err_drv_malformed_sanitizer_coverage_allowlist,
+        clang::diag::err_drv_malformed_coverage_sanitizer_allowlist,
         DiagnoseErrors);
     parseSpecialCaseListArg(
         D, Args, CoverageIgnorelistFiles,
         options::OPT_fsanitize_coverage_ignorelist, OptSpecifier(),
-        clang::diag::err_drv_malformed_sanitizer_coverage_ignorelist,
+        clang::diag::err_drv_malformed_coverage_sanitizer_ignorelist,
         DiagnoseErrors);
   }
 
diff --git a/clang/test/CodeGen/Inputs/memprof.exe b/clang/test/CodeGen/Inputs/memprof.exe
index bde5f3e29a3c2f..ca0e9b3ef980fb 100755
Binary files a/clang/test/CodeGen/Inputs/memprof.exe and b/clang/test/CodeGen/Inputs/memprof.exe differ
diff --git a/clang/test/CodeGen/sancov-new-pm.c b/clang/test/CodeGen/sancov-new-pm.c
index 5ba82cc1cb22a6..a621f8a5a11a8e 100644
--- a/clang/test/CodeGen/sancov-new-pm.c
+++ b/clang/test/CodeGen/sancov-new-pm.c
@@ -1,4 +1,4 @@
-// Test that SanitizerCoverage works under the new pass manager.
+// Test that CoverageSanitizer works under the new pass manager.
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -O2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O2
 
diff --git a/clang/test/Driver/sancov.c b/clang/test/Driver/sancov.c
index 44acfd3d8f3aaf..8d02140a6ca931 100644
--- a/clang/test/Driver/sancov.c
+++ b/clang/test/Driver/sancov.c
@@ -7,7 +7,7 @@
 // RUN: %clang     -target x86_64-unknown-linux -fsanitize-coverage=trace-pc-guard %s -S -emit-llvm -flto -o - | FileCheck %s
 // RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize-coverage=trace-pc-guard %s -S -emit-llvm -flto -o - | FileCheck %s
 
-// Verify that -fsanitize-coverage invokes SanitizerCoveragePass instrumentation.
+// Verify that -fsanitize-coverage invo...
[truncated]

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2024

@llvm/pr-subscribers-clang-codegen

Author: cor3ntin (cor3ntin)

Changes

This is so that we are consistent with other sanitizers. Importantly, this makes the docs clearer.

Driver flags are left unchanged (We are not proposing to rename sancov either). The good thing is that flags were already consistent with other sanitizers so there would not be any motivation to change them, even if we were feeling disruptive.


Patch is 84.39 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/106505.diff

79 Files Affected:

  • (renamed) clang/docs/CoverageSanitizer.rst (+8-8)
  • (modified) clang/docs/SourceBasedCodeCoverage.rst (+1-1)
  • (modified) clang/docs/UsersManual.rst (+1-1)
  • (modified) clang/docs/index.rst (+1-1)
  • (modified) clang/docs/tools/clang-formatted-files.txt (+1-1)
  • (modified) clang/include/clang/Basic/AttrDocs.td (+2-2)
  • (modified) clang/include/clang/Basic/CodeGenOptions.def (+9-9)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+1-1)
  • (modified) clang/include/clang/Basic/DiagnosticDriverKinds.td (+4-4)
  • (modified) clang/include/clang/Driver/Options.td (+13-13)
  • (modified) clang/lib/CodeGen/BackendUtil.cpp (+5-5)
  • (modified) clang/lib/Driver/SanitizerArgs.cpp (+2-2)
  • (modified) clang/test/CodeGen/Inputs/memprof.exe ()
  • (modified) clang/test/CodeGen/sancov-new-pm.c (+1-1)
  • (modified) clang/test/Driver/sancov.c (+1-1)
  • (modified) compiler-rt/include/sanitizer/common_interface_defs.h (+1-1)
  • (modified) compiler-rt/include/sanitizer/coverage_interface.h (+1-1)
  • (modified) compiler-rt/lib/fuzzer/dataflow/DataFlow.cpp (+2-2)
  • (modified) compiler-rt/lib/sanitizer_common/CMakeLists.txt (+9-9)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp (+3-3)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_interface.inc (+2-2)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp (+4-4)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp (+3-3)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp (+4-4)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp (+2-2)
  • (renamed) compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp (+3-3)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.cpp (+1-1)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.h (+1-1)
  • (modified) compiler-rt/lib/sanitizer_common/sancov_flags.inc (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp (+1-1)
  • (modified) compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp (+7-7)
  • (modified) compiler-rt/test/asan/TestCases/coverage-and-lsan.cpp (+1-1)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_allowlist_ignorelist.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter_default_impl.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline_bool_flag.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_no_prune.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_symbolize.cpp (+1-1)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_loads_stores.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp (+5-5)
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp ()
  • (renamed) compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard.cpp (+4-4)
  • (modified) libcxx/docs/VendorDocumentation.rst (+1-1)
  • (modified) lldb/docs/resources/fuzzing.rst (+2-2)
  • (modified) llvm/docs/FuzzingLLVM.rst (+1-1)
  • (modified) llvm/docs/LangRef.rst (+1-1)
  • (modified) llvm/docs/LibFuzzer.rst (+6-6)
  • (modified) llvm/docs/SymbolizerMarkupFormat.rst (+1-1)
  • (modified) llvm/include/llvm/Transforms/Instrumentation.h (+3-3)
  • (renamed) llvm/include/llvm/Transforms/Instrumentation/CoverageSanitizer.h (+7-7)
  • (modified) llvm/lib/Passes/PassBuilder.cpp (+1-1)
  • (modified) llvm/lib/Passes/PassRegistry.def (+1-1)
  • (modified) llvm/lib/Transforms/Instrumentation/CMakeLists.txt (+1-1)
  • (renamed) llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp (+41-41)
  • (modified) llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll (+2-2)
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof.nocolinfo.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_internal_linkage.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_loop_unroll.exe ()
  • (modified) llvm/test/Transforms/PGOProfile/Inputs/memprof_missing_leaf.exe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic_v3.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-badentrysizes.bin ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-example.bin ()
  • (modified) llvm/test/tools/llvm-xray/X86/Inputs/elf64-sample-o2.bin ()
  • (modified) llvm/test/tools/sancov/Inputs/test-linux_x86_64 ()
  • (modified) llvm/test/tools/sancov/Inputs/test-windows_x86_64 ()
  • (modified) llvm/tools/sancov/sancov.cpp (+2-2)
  • (modified) llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn (+8-8)
  • (modified) llvm/utils/gn/secondary/llvm/lib/Transforms/Instrumentation/BUILD.gn (+1-1)
diff --git a/clang/docs/SanitizerCoverage.rst b/clang/docs/CoverageSanitizer.rst
similarity index 97%
rename from clang/docs/SanitizerCoverage.rst
rename to clang/docs/CoverageSanitizer.rst
index 45ad03cb43774c..a5dba0ec093950 100644
--- a/clang/docs/SanitizerCoverage.rst
+++ b/clang/docs/CoverageSanitizer.rst
@@ -1,5 +1,5 @@
 =================
-SanitizerCoverage
+CoverageSanitizer
 =================
 
 .. contents::
@@ -8,7 +8,7 @@ SanitizerCoverage
 Introduction
 ============
 
-LLVM has a simple code coverage instrumentation built in (SanitizerCoverage).
+LLVM has a simple code coverage instrumentation built in (CoverageSanitizer).
 It inserts calls to user-defined functions on function-, basic-block-, and edge- levels.
 Default implementations of those callbacks are provided and implement
 simple coverage reporting and visualization,
@@ -208,7 +208,7 @@ This mechanism is used for fuzzing the Linux kernel
 
 Instrumentation points
 ======================
-Sanitizer Coverage offers different levels of instrumentation.
+Coverage Sanitizer offers different levels of instrumentation.
 
 * ``edge`` (default): edges are instrumented (see below).
 * ``bb``: basic blocks are instrumented.
@@ -397,13 +397,13 @@ together with ``__has_feature(coverage_sanitizer)``.
 Disabling instrumentation without source modification
 =====================================================
 
-It is sometimes useful to tell SanitizerCoverage to instrument only a subset of the
+It is sometimes useful to tell CoverageSanitizer to instrument only a subset of the
 functions in your target without modifying source files.
 With ``-fsanitize-coverage-allowlist=allowlist.txt``
 and ``-fsanitize-coverage-ignorelist=blocklist.txt``,
 you can specify such a subset through the combination of an allowlist and a blocklist.
 
-SanitizerCoverage will only instrument functions that satisfy two conditions.
+CoverageSanitizer will only instrument functions that satisfy two conditions.
 First, the function should belong to a source file with a path that is both allowlisted
 and not blocklisted.
 Second, the function should have a mangled name that is both allowlisted and not blocklisted.
@@ -471,16 +471,16 @@ Example:
     % clang++ -g cov.cc -fsanitize=address -fsanitize-coverage=trace-pc-guard
     % ASAN_OPTIONS=coverage=1 ./a.out; wc -c *.sancov
     main
-    SanitizerCoverage: ./a.out.7312.sancov 2 PCs written
+    CoverageSanitizer: ./a.out.7312.sancov 2 PCs written
     24 a.out.7312.sancov
     % ASAN_OPTIONS=coverage=1 ./a.out foo ; wc -c *.sancov
     foo
     main
-    SanitizerCoverage: ./a.out.7316.sancov 3 PCs written
+    CoverageSanitizer: ./a.out.7316.sancov 3 PCs written
     24 a.out.7312.sancov
     32 a.out.7316.sancov
 
-Every time you run an executable instrumented with SanitizerCoverage
+Every time you run an executable instrumented with CoverageSanitizer
 one ``*.sancov`` file is created during the process shutdown.
 If the executable is dynamically linked against instrumented DSOs,
 one ``*.sancov`` file will be also created for every DSO.
diff --git a/clang/docs/SourceBasedCodeCoverage.rst b/clang/docs/SourceBasedCodeCoverage.rst
index 73910e134a5891..313063b976547c 100644
--- a/clang/docs/SourceBasedCodeCoverage.rst
+++ b/clang/docs/SourceBasedCodeCoverage.rst
@@ -14,7 +14,7 @@ information directly. This allows it to generate very precise coverage data.
 
 Clang ships two other code coverage implementations:
 
-* :doc:`SanitizerCoverage` - A low-overhead tool meant for use alongside the
+* :doc:`CoverageSanitizer` - A low-overhead tool meant for use alongside the
   various sanitizers. It can provide up to edge-level coverage.
 
 * gcov - A GCC-compatible coverage implementation which operates on DebugInfo.
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index f27fa4ace917ea..738ba7fa4855a8 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2140,7 +2140,7 @@ are listed below.
 .. option:: -f[no-]sanitize-coverage=[type,features,...]
 
    Enable simple code coverage in addition to certain sanitizers.
-   See :doc:`SanitizerCoverage` for more details.
+   See :doc:`CoverageSanitizer` for more details.
 
 .. option:: -f[no-]sanitize-address-outline-instrumentation
 
diff --git a/clang/docs/index.rst b/clang/docs/index.rst
index 4a497f4d9bcc3c..8a1097cf3e19c7 100644
--- a/clang/docs/index.rst
+++ b/clang/docs/index.rst
@@ -33,7 +33,7 @@ Using Clang as a Compiler
    DataFlowSanitizer
    LeakSanitizer
    RealtimeSanitizer
-   SanitizerCoverage
+   CoverageSanitizer
    SanitizerStats
    SanitizerSpecialCaseList
    BoundsSafety
diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt
index fc07357986d989..d105f530b5106c 100644
--- a/clang/docs/tools/clang-formatted-files.txt
+++ b/clang/docs/tools/clang-formatted-files.txt
@@ -5560,7 +5560,7 @@ llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
 llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
 llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
 llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
-llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+llvm/include/llvm/Transforms/Instrumentation/CoverageSanitizer.h
 llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
 llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
 llvm/include/llvm/Transforms/IPO/Attributor.h
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index c2b9d7cb93c309..de4959277fa8e6 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -3142,12 +3142,12 @@ instrumentations should not be applied.
 The attribute takes a list of string literals with the following accepted
 values:
 * all values accepted by ``-fno-sanitize=``;
-* ``coverage``, to disable SanitizerCoverage instrumentation.
+* ``coverage``, to disable CoverageSanitizer instrumentation.
 
 For example, ``__attribute__((no_sanitize("address", "thread")))`` specifies
 that AddressSanitizer and ThreadSanitizer should not be applied to the function
 or variable. Using ``__attribute__((no_sanitize("coverage")))`` specifies that
-SanitizerCoverage should not be applied to the function.
+CoverageSanitizer should not be applied to the function.
 
 See :ref:`Controlling Code Generation <controlling-code-generation>` for a
 full list of supported sanitizer flags.
diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
index b600198998d85b..28c91bdeec5b73 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -271,24 +271,24 @@ CODEGENOPT(SanitizeCfiICallNormalizeIntegers, 1, 0) ///< Normalize integer types
                                                     ///< CFI icall function signatures
 CODEGENOPT(SanitizeCfiCanonicalJumpTables, 1, 0) ///< Make jump table symbols canonical
                                                  ///< instead of creating a local jump table.
-CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of sanitizer coverage
+CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of coverage sanitizer
                                        ///< instrumentation.
-CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable sanitizer coverage
+CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable coverage sanitizer
                                                 ///< for indirect calls.
 CODEGENOPT(SanitizeCoverageTraceBB, 1, 0) ///< Enable basic block tracing in
-                                          ///< in sanitizer coverage.
+                                          ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceCmp, 1, 0) ///< Enable cmp instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceDiv, 1, 0) ///< Enable div instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTraceGep, 1, 0) ///< Enable GEP instruction tracing
-                                           ///< in sanitizer coverage.
+                                           ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverage8bitCounters, 1, 0) ///< Use 8-bit frequency counters
-                                               ///< in sanitizer coverage.
+                                               ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTracePC, 1, 0) ///< Enable PC tracing
-                                          ///< in sanitizer coverage.
+                                          ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard
-                                               ///< in sanitizer coverage.
+                                               ///< in coverage sanitizer.
 CODEGENOPT(SanitizeCoverageInline8bitCounters, 1, 0) ///< Use inline 8bit counters.
 CODEGENOPT(SanitizeCoverageInlineBoolFlag, 1, 0) ///< Use inline bool flag.
 CODEGENOPT(SanitizeCoveragePCTable, 1, 0) ///< Create a PC Table.
diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index f2a707a8ba8d76..44017a0c95d9a7 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -419,7 +419,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
 
   /// Path to allowlist file specifying which objects
   /// (files, functions) should exclusively be instrumented
-  /// by sanitizer coverage pass.
+  /// by coverage sanitizer pass.
   std::vector<std::string> SanitizeCoverageAllowlistFiles;
 
   /// The guard style used for stack protector to get a initial value, this
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index ba90742fbdaabc..94464844afcad8 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -247,10 +247,10 @@ def err_drv_missing_sanitizer_ignorelist : Error<
   "missing sanitizer ignorelist: '%0'">;
 def err_drv_malformed_sanitizer_ignorelist : Error<
   "malformed sanitizer ignorelist: '%0'">;
-def err_drv_malformed_sanitizer_coverage_allowlist : Error<
-  "malformed sanitizer coverage allowlist: '%0'">;
-def err_drv_malformed_sanitizer_coverage_ignorelist : Error<
-  "malformed sanitizer coverage ignorelist: '%0'">;
+def err_drv_malformed_coverage_sanitizer_allowlist : Error<
+  "malformed coverage sanitizer allowlist: '%0'">;
+def err_drv_malformed_coverage_sanitizer_ignorelist : Error<
+  "malformed coverage sanitizer ignorelist: '%0'">;
 def err_drv_malformed_sanitizer_metadata_ignorelist : Error<
   "malformed sanitizer metadata ignorelist: '%0'">;
 def err_drv_unsupported_static_sanitizer_darwin : Error<
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 83cf753e824845..4b8e907317d617 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2366,11 +2366,11 @@ def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
          "inline-bool-flag">;
 def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
     Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
-    HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
+    HelpText<"Restrict coverage sanitizer instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
 def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
     Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
-    HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
+    HelpText<"Disable coverage sanitizer instrumentation for modules and functions "
              "that match the provided special case list, even the allowed ones">,
     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
 def fexperimental_sanitize_metadata_EQ : CommaJoined<["-"], "fexperimental-sanitize-metadata=">,
@@ -7311,39 +7311,39 @@ def linker_option : Joined<["--"], "linker-option=">,
   HelpText<"Add linker option">,
   MarshallingInfoStringVector<CodeGenOpts<"LinkerOptions">>;
 def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
-                              HelpText<"Sanitizer coverage type">,
+                              HelpText<"Coverage sanitizer type">,
                               MarshallingInfoInt<CodeGenOpts<"SanitizeCoverageType">>;
 def fsanitize_coverage_indirect_calls
     : Flag<["-"], "fsanitize-coverage-indirect-calls">,
-      HelpText<"Enable sanitizer coverage for indirect calls">,
+      HelpText<"Enable coverage sanitizer for indirect calls">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageIndirectCalls">>;
 def fsanitize_coverage_trace_bb
     : Flag<["-"], "fsanitize-coverage-trace-bb">,
-      HelpText<"Enable basic block tracing in sanitizer coverage">,
+      HelpText<"Enable basic block tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceBB">>;
 def fsanitize_coverage_trace_cmp
     : Flag<["-"], "fsanitize-coverage-trace-cmp">,
-      HelpText<"Enable cmp instruction tracing in sanitizer coverage">,
+      HelpText<"Enable cmp instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceCmp">>;
 def fsanitize_coverage_trace_div
     : Flag<["-"], "fsanitize-coverage-trace-div">,
-      HelpText<"Enable div instruction tracing in sanitizer coverage">,
+      HelpText<"Enable div instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceDiv">>;
 def fsanitize_coverage_trace_gep
     : Flag<["-"], "fsanitize-coverage-trace-gep">,
-      HelpText<"Enable gep instruction tracing in sanitizer coverage">,
+      HelpText<"Enable gep instruction tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceGep">>;
 def fsanitize_coverage_8bit_counters
     : Flag<["-"], "fsanitize-coverage-8bit-counters">,
-      HelpText<"Enable frequency counters in sanitizer coverage">,
+      HelpText<"Enable frequency counters in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverage8bitCounters">>;
 def fsanitize_coverage_inline_8bit_counters
     : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">,
-      HelpText<"Enable inline 8-bit counters in sanitizer coverage">,
+      HelpText<"Enable inline 8-bit counters in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInline8bitCounters">>;
 def fsanitize_coverage_inline_bool_flag
     : Flag<["-"], "fsanitize-coverage-inline-bool-flag">,
-      HelpText<"Enable inline bool flag in sanitizer coverage">,
+      HelpText<"Enable inline bool flag in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInlineBoolFlag">>;
 def fsanitize_coverage_pc_table
     : Flag<["-"], "fsanitize-coverage-pc-table">,
@@ -7355,11 +7355,11 @@ def fsanitize_coverage_control_flow
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageControlFlow">>;
 def fsanitize_coverage_trace_pc
     : Flag<["-"], "fsanitize-coverage-trace-pc">,
-      HelpText<"Enable PC tracing in sanitizer coverage">,
+      HelpText<"Enable PC tracing in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePC">>;
 def fsanitize_coverage_trace_pc_guard
     : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
-      HelpText<"Enable PC tracing with guard in sanitizer coverage">,
+      HelpText<"Enable PC tracing with guard in coverage sanitizer">,
       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePCGuard">>;
 def fsanitize_coverage_no_prune
     : Flag<["-"], "fsanitize-coverage-no-prune">,
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 026f16484c0949..3301a0f9b5bdee 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -80,7 +80,7 @@
 #include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"
 #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"
-#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
+#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
 #include "llvm/Transforms/ObjCARC.h"
 #include "llvm/Transforms/Scalar/EarlyCSE.h"
@@ -231,11 +231,11 @@ class EmitAssemblyHelper {
 };
 } // namespace
 
-static SanitizerCoverageOptions
+static CoverageSanitizerOptions
 getSancovOptsFromCGOpts(const CodeGenOptions &CGOpts) {
-  SanitizerCoverageOptions Opts;
+  CoverageSanitizerOptions Opts;
   Opts.CoverageType =
-      static_cast<SanitizerCoverageOptions::Type>(CGOpts.SanitizeCoverageType);
+      static_cast<CoverageSanitizerOptions::Type>(CGOpts.SanitizeCoverageType);
   Opts.IndirectCalls = CGOpts.SanitizeCoverageIndirectCalls;
   Opts.TraceBB = CGOpts.SanitizeCoverageTraceBB;
   Opts.TraceCmp = CGOpts.SanitizeCoverageTraceCmp;
@@ -662,7 +662,7 @@ static void addSanitizers(const Triple &TargetTriple,
                                 OptimizationLevel Level) {
     if (CodeGenOpts.hasSanitizeCoverage()) {
       auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
-      MPM.addPass(SanitizerCoveragePass(
+      MPM.addPass(CoverageSanitizerPass(
           SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
           CodeGenOpts.SanitizeCoverageIgnorelistFiles));
     }
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 18bb35a563167e..7f77fec0376762 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -894,12 +894,12 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
     parseSpecialCaseListArg(
         D, Args, CoverageAllowlistFiles,
         options::OPT_fsanitize_coverage_allowlist, OptSpecifier(),
-        clang::diag::err_drv_malformed_sanitizer_coverage_allowlist,
+        clang::diag::err_drv_malformed_coverage_sanitizer_allowlist,
         DiagnoseErrors);
     parseSpecialCaseListArg(
         D, Args, CoverageIgnorelistFiles,
         options::OPT_fsanitize_coverage_ignorelist, OptSpecifier(),
-        clang::diag::err_drv_malformed_sanitizer_coverage_ignorelist,
+        clang::diag::err_drv_malformed_coverage_sanitizer_ignorelist,
         DiagnoseErrors);
   }
 
diff --git a/clang/test/CodeGen/Inputs/memprof.exe b/clang/test/CodeGen/Inputs/memprof.exe
index bde5f3e29a3c2f..ca0e9b3ef980fb 100755
Binary files a/clang/test/CodeGen/Inputs/memprof.exe and b/clang/test/CodeGen/Inputs/memprof.exe differ
diff --git a/clang/test/CodeGen/sancov-new-pm.c b/clang/test/CodeGen/sancov-new-pm.c
index 5ba82cc1cb22a6..a621f8a5a11a8e 100644
--- a/clang/test/CodeGen/sancov-new-pm.c
+++ b/clang/test/CodeGen/sancov-new-pm.c
@@ -1,4 +1,4 @@
-// Test that SanitizerCoverage works under the new pass manager.
+// Test that CoverageSanitizer works under the new pass manager.
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -O2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O2
 
diff --git a/clang/test/Driver/sancov.c b/clang/test/Driver/sancov.c
index 44acfd3d8f3aaf..8d02140a6ca931 100644
--- a/clang/test/Driver/sancov.c
+++ b/clang/test/Driver/sancov.c
@@ -7,7 +7,7 @@
 // RUN: %clang     -target x86_64-unknown-linux -fsanitize-coverage=trace-pc-guard %s -S -emit-llvm -flto -o - | FileCheck %s
 // RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize-coverage=trace-pc-guard %s -S -emit-llvm -flto -o - | FileCheck %s
 
-// Verify that -fsanitize-coverage invokes SanitizerCoveragePass instrumentation.
+// Verify that -fsanitize-coverage invo...
[truncated]

Copy link

github-actions bot commented Aug 29, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff ec9f36a624fa9f8fea6e40384ce513b6da8c08e4 f430da54abb6309756179585ad7cb7064596b86f --extensions cpp,c,h,inc -- clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/BackendUtil.cpp clang/lib/Driver/SanitizerArgs.cpp clang/test/CodeGen/sancov-new-pm.c clang/test/Driver/sancov.c compiler-rt/include/sanitizer/common_interface_defs.h compiler-rt/include/sanitizer/coverage_interface.h compiler-rt/lib/fuzzer/dataflow/DataFlow.cpp compiler-rt/lib/sanitizer_common/sancov_flags.cpp compiler-rt/lib/sanitizer_common/sancov_flags.h compiler-rt/lib/sanitizer_common/sancov_flags.inc compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp compiler-rt/test/asan/TestCases/coverage-and-lsan.cpp llvm/include/llvm/Transforms/Instrumentation.h llvm/lib/Passes/PassBuilder.cpp llvm/tools/sancov/sancov.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_interface.inc compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_allowlist_ignorelist.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter_default_impl.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline_bool_flag.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_no_prune.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_symbolize.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_loads_stores.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard.cpp llvm/include/llvm/Transforms/Instrumentation/CoverageSanitizer.h llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp
View the diff from clang-format here.
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 3301a0f9b5..382cee4527 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -68,6 +68,7 @@
 #include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
 #include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
 #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
+#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/DataFlowSanitizer.h"
 #include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/Instrumentation/HWAddressSanitizer.h"
@@ -80,7 +81,6 @@
 #include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"
 #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"
-#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
 #include "llvm/Transforms/ObjCARC.h"
 #include "llvm/Transforms/Scalar/EarlyCSE.h"
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp
index 9343079f78..026b669a1c 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_fuchsia.cpp
@@ -27,14 +27,14 @@
 
 #include "sanitizer_platform.h"
 #if SANITIZER_FUCHSIA
-#include <zircon/process.h>
-#include <zircon/sanitizer.h>
-#include <zircon/syscalls.h>
-
-#include "sanitizer_atomic.h"
-#include "sanitizer_common.h"
-#include "sanitizer_interface_internal.h"
-#include "sanitizer_internal_defs.h"
+#  include <zircon/process.h>
+#  include <zircon/sanitizer.h>
+#  include <zircon/syscalls.h>
+
+#  include "sanitizer_atomic.h"
+#  include "sanitizer_common.h"
+#  include "sanitizer_interface_internal.h"
+#  include "sanitizer_internal_defs.h"
 #  include "sanitizer_symbolizer_markup_constants.h"
 
 using namespace __sanitizer;
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp
index ab4d080538..95e0d0c48e 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_libcdep_new.cpp
@@ -57,7 +57,8 @@ static void WriteModuleCoverage(char* file_path, const char* module_name,
 }
 
 static void SanitizerDumpCoverage(const uptr* unsorted_pcs, uptr len) {
-  if (!len) return;
+  if (!len)
+    return;
 
   char* file_path = static_cast<char*>(InternalAlloc(kMaxPathLength));
   char* module_name = static_cast<char*>(InternalAlloc(kMaxPathLength));
@@ -72,7 +73,8 @@ static void SanitizerDumpCoverage(const uptr* unsorted_pcs, uptr len) {
 
   for (uptr i = 0; i < len; ++i) {
     const uptr pc = pcs[i];
-    if (!pc) continue;
+    if (!pc)
+      continue;
 
     if (!GetModuleAndOffsetForPc(pc, nullptr, 0, &pcs[i])) {
       Printf("ERROR: unknown pc %p (may happen if dlclose is used)\n",
@@ -118,7 +120,8 @@ class TracePcGuardController {
   }
 
   void InitTracePcGuard(u32* start, u32* end) {
-    if (!initialized) Initialize();
+    if (!initialized)
+      Initialize();
     CHECK(!*start);
     CHECK_NE(start, end);
 
@@ -129,7 +132,8 @@ class TracePcGuardController {
 
   void TracePcGuard(u32* guard, uptr pc) {
     u32 idx = *guard;
-    if (!idx) return;
+    if (!idx)
+      return;
     // we start indices from 1.
     atomic_uintptr_t* pc_ptr =
         reinterpret_cast<atomic_uintptr_t*>(&pc_vector[idx - 1]);
@@ -142,7 +146,8 @@ class TracePcGuardController {
   }
 
   void Dump() {
-    if (!initialized || !common_flags()->coverage) return;
+    if (!initialized || !common_flags()->coverage)
+      return;
     __sanitizer_dump_coverage(pc_vector.data(), pc_vector.size());
   }
 
@@ -206,7 +211,7 @@ static void CovPcsInit(const uptr* beg, const uptr* end) {
 }  // namespace __sancov
 
 namespace __sanitizer {
-void InitializeCoverage(bool enabled, const char *dir) {
+void InitializeCoverage(bool enabled, const char* dir) {
   static bool coverage_enabled = false;
   if (coverage_enabled)
     return;  // May happen if two sanitizer enable coverage in the same process.
@@ -214,7 +219,7 @@ void InitializeCoverage(bool enabled, const char *dir) {
   Atexit(__sanitizer_cov_dump);
   AddDieCallback(__sanitizer_cov_dump);
 }
-} // namespace __sanitizer
+}  // namespace __sanitizer
 
 extern "C" {
 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage(const uptr* pcs,
@@ -223,14 +228,16 @@ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage(const uptr* pcs,
 }
 
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_guard, u32* guard) {
-  if (!*guard) return;
+  if (!*guard)
+    return;
   __sancov::pc_guard_controller.TracePcGuard(
       guard, StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()));
 }
 
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_guard_init,
                              u32* start, u32* end) {
-  if (start == end || *start) return;
+  if (start == end || *start)
+    return;
   __sancov::pc_guard_controller.InitTracePcGuard(start, end);
 }
 
@@ -260,16 +267,16 @@ SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div4, void) {}
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div8, void) {}
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_gep, void) {}
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_indir, void) {}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load1, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load2, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load4, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load8, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load16, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store1, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store2, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store4, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store8, void){}
-SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store16, void){}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load1, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load2, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load4, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load8, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load16, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store1, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store2, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store4, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store8, void) {}
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store16, void) {}
 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_8bit_counters_init,
                              char* start, char* end) {
   __sancov::SingletonCounterCoverage::Cov8bitCountersInit(start, end);
@@ -288,9 +295,9 @@ SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_pcs_init, const uptr* beg,
 // FIXME: Figure out how this should work on Windows, exported thread_local
 // symbols are not supported:
 // "data with thread storage duration may not have dll interface"
-#if !SANITIZER_APPLE && !SANITIZER_WINDOWS
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-thread_local uptr __sancov_lowest_stack;
-#endif
+#  if !SANITIZER_APPLE && !SANITIZER_WINDOWS
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE thread_local uptr
+    __sancov_lowest_stack;
+#  endif
 
 #endif  // !SANITIZER_FUCHSIA
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp
index 7eb503da37..cd95191ec3 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dll_thunk.cpp
@@ -12,9 +12,9 @@
 // See https://github.com/google/sanitizers/issues/209 for the details.
 //===----------------------------------------------------------------------===//
 #ifdef SANITIZER_DLL_THUNK
-#include "sanitizer_win_dll_thunk.h"
+#  include "sanitizer_win_dll_thunk.h"
 // Coverage Sanitizer interface functions.
-#define INTERFACE_FUNCTION(Name) INTERCEPT_SANITIZER_FUNCTION(Name)
-#define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
-#include "coverage_sanitizer_interface.inc"
-#endif // SANITIZER_DLL_THUNK
+#  define INTERFACE_FUNCTION(Name) INTERCEPT_SANITIZER_FUNCTION(Name)
+#  define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
+#  include "coverage_sanitizer_interface.inc"
+#endif  // SANITIZER_DLL_THUNK
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp
index e7b024c7c4..b8786a7cc4 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_dynamic_runtime_thunk.cpp
@@ -11,16 +11,16 @@
 //
 //===----------------------------------------------------------------------===//
 #ifdef SANITIZER_DYNAMIC_RUNTIME_THUNK
-#define SANITIZER_IMPORT_INTERFACE 1
-#include "sanitizer_win_defs.h"
+#  define SANITIZER_IMPORT_INTERFACE 1
+#  include "sanitizer_win_defs.h"
 // Define weak alias for all weak functions imported from coverage sanitizer.
-#define INTERFACE_FUNCTION(Name)
-#define INTERFACE_WEAK_FUNCTION(Name) WIN_WEAK_IMPORT_DEF(Name)
-#include "coverage_sanitizer_interface.inc"
-#endif // SANITIZER_DYNAMIC_RUNTIME_THUNK
+#  define INTERFACE_FUNCTION(Name)
+#  define INTERFACE_WEAK_FUNCTION(Name) WIN_WEAK_IMPORT_DEF(Name)
+#  include "coverage_sanitizer_interface.inc"
+#endif  // SANITIZER_DYNAMIC_RUNTIME_THUNK
 
 namespace __sanitizer {
 // Add one, otherwise unused, external symbol to this object file so that the
 // Visual C++ linker includes it and reads the .drective section.
 void ForceWholeArchiveIncludeForSanCov() {}
-}
+}  // namespace __sanitizer
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp
index 5c4280341a..5c7871a1ff 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_sections.cpp
@@ -25,13 +25,13 @@
 
 #include "sanitizer_platform.h"
 #if SANITIZER_WINDOWS
-#include <stdint.h>
+#  include <stdint.h>
 
 extern "C" {
 // Use uint64_t so the linker won't need to add any padding if it tries to word
 // align the start of the 8-bit counters array. The array will always start 8
 // bytes after __start_sancov_cntrs.
-#pragma section(".SCOV$CA", read, write)
+#  pragma section(".SCOV$CA", read, write)
 __declspec(allocate(".SCOV$CA")) uint64_t __start___sancov_cntrs = 0;
 
 // Even though we said not to align __stop__sancov_cntrs (using the "align"
@@ -41,27 +41,27 @@ __declspec(allocate(".SCOV$CA")) uint64_t __start___sancov_cntrs = 0;
 // padding would be added to align .SCOVP$Z, However, if .SCOV$CZ section is 1
 // byte, the linker won't try to align it on an 8-byte boundary, so use a
 // uint8_t for __stop_sancov_cntrs.
-#pragma section(".SCOV$CZ", read, write)
-__declspec(allocate(".SCOV$CZ")) __declspec(align(1)) uint8_t
-    __stop___sancov_cntrs = 0;
+#  pragma section(".SCOV$CZ", read, write)
+__declspec(allocate(".SCOV$CZ"))
+__declspec(align(1)) uint8_t __stop___sancov_cntrs = 0;
 
-#pragma section(".SCOV$GA", read, write)
+#  pragma section(".SCOV$GA", read, write)
 __declspec(allocate(".SCOV$GA")) uint64_t __start___sancov_guards = 0;
-#pragma section(".SCOV$GZ", read, write)
-__declspec(allocate(".SCOV$GZ")) __declspec(align(1)) uint8_t
-    __stop___sancov_guards = 0;
+#  pragma section(".SCOV$GZ", read, write)
+__declspec(allocate(".SCOV$GZ"))
+__declspec(align(1)) uint8_t __stop___sancov_guards = 0;
 
 // The guard array and counter array should both be merged into the .data
 // section to reduce the number of PE sections. However, because PCTable is
 // constant it should be merged with the .rdata section.
-#pragma comment(linker, "/MERGE:.SCOV=.data")
+#  pragma comment(linker, "/MERGE:.SCOV=.data")
 
-#pragma section(".SCOVP$A", read)
+#  pragma section(".SCOVP$A", read)
 __declspec(allocate(".SCOVP$A")) uint64_t __start___sancov_pcs = 0;
-#pragma section(".SCOVP$Z", read)
-__declspec(allocate(".SCOVP$Z")) __declspec(align(1)) uint8_t
-    __stop___sancov_pcs = 0;
+#  pragma section(".SCOVP$Z", read)
+__declspec(allocate(".SCOVP$Z"))
+__declspec(align(1)) uint8_t __stop___sancov_pcs = 0;
 
-#pragma comment(linker, "/MERGE:.SCOVP=.rdata")
+#  pragma comment(linker, "/MERGE:.SCOVP=.rdata")
 }
 #endif  // SANITIZER_WINDOWS
diff --git a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp
index c30a310e91..bad60b074f 100644
--- a/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp
+++ b/compiler-rt/lib/sanitizer_common/coverage_sanitizer_win_weak_interception.cpp
@@ -11,13 +11,13 @@
 // definition is provided.
 //===----------------------------------------------------------------------===//
 #ifdef SANITIZER_DYNAMIC
-#include "sanitizer_win_weak_interception.h"
-#include "sanitizer_interface_internal.h"
-#include "sancov_flags.h"
+#  include "sancov_flags.h"
+#  include "sanitizer_interface_internal.h"
+#  include "sanitizer_win_weak_interception.h"
 // Check if strong definitions for weak functions are present in the main
 // executable. If that is the case, override dll functions to point to strong
 // implementations.
-#define INTERFACE_FUNCTION(Name)
-#define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
-#include "coverage_sanitizer_interface.inc"
-#endif // SANITIZER_DYNAMIC
+#  define INTERFACE_FUNCTION(Name)
+#  define INTERFACE_WEAK_FUNCTION(Name) INTERCEPT_SANITIZER_WEAK_FUNCTION(Name)
+#  include "coverage_sanitizer_interface.inc"
+#endif  // SANITIZER_DYNAMIC
diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp b/compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp
index 8c3fd73e56..1ee66711d3 100644
--- a/compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/coverage-reset.cpp
@@ -26,40 +26,40 @@ int main(int argc, char **argv) {
   bar1();
   bar2();
   __sanitizer_cov_dump();
-// CHECK: RESET
-// CHECK-DAG: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
-// CHECK-DAG: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
+  // CHECK: RESET
+  // CHECK-DAG: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
+  // CHECK-DAG: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
 
   fprintf(stderr, "RESET\n");
   __sanitizer_cov_reset();
   foo1();
   bar1();
   __sanitizer_cov_dump();
-// CHECK: RESET
-// CHECK-DAG: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 1 PCs written
-// CHECK-DAG: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
+  // CHECK: RESET
+  // CHECK-DAG: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 1 PCs written
+  // CHECK-DAG: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
 
   fprintf(stderr, "RESET\n");
   __sanitizer_cov_reset();
   foo1();
   foo2();
   __sanitizer_cov_dump();
-// CHECK: RESET
-// CHECK: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
+  // CHECK: RESET
+  // CHECK: CoverageSanitizer: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
 
   fprintf(stderr, "RESET\n");
   __sanitizer_cov_reset();
   bar1();
   bar2();
   __sanitizer_cov_dump();
-// CHECK: RESET
-// CHECK: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
+  // CHECK: RESET
+  // CHECK: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
 
   fprintf(stderr, "RESET\n");
   __sanitizer_cov_reset();
 // CHECK: RESET
 
   bar2();
-// CHECK: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
+  // CHECK: CoverageSanitizer: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
 }
 #endif
diff --git a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp
index 5223af07f1..89622931c1 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_control_flow.cpp
@@ -9,9 +9,9 @@
 #include <cstdint>
 #include <cstdio>
 #if __has_feature(ptrauth_calls)
-  #include <ptrauth.h>
+#  include <ptrauth.h>
 #else
-  #define ptrauth_strip(__value, __key) (__value)
+#  define ptrauth_strip(__value, __key) (__value)
 #endif
 
 uintptr_t *CFS_BEG, *CFS_END;
@@ -22,8 +22,7 @@ extern "C" void __sanitizer_cov_cfs_init(const uintptr_t *cfs_beg,
   CFS_END = (uintptr_t *)cfs_end;
 }
 
-__attribute__((noinline)) void foo(int x) { /* empty body */
-}
+__attribute__((noinline)) void foo(int x) { /* empty body */ }
 
 void check_cfs_section(uintptr_t main_ptr, uintptr_t foo_ptr) {
   printf("Control Flow section boundaries: [%p %p)\n", CFS_BEG, CFS_END);
diff --git a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp
index 68eca85eb4..16c2d44514 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_inline8bit_counter.cpp
@@ -6,14 +6,14 @@
 // RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters,pc-table -o %t
 // RUN: %run %t 2>&1 | FileCheck %s
 
-#include <stdio.h>
-#include <stdint.h>
 #include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
 
 const char *first_counter;
 
-extern "C"
-void __sanitizer_cov_8bit_counters_init(const char *start, const char *end) {
+extern "C" void __sanitizer_cov_8bit_counters_init(const char *start,
+                                                   const char *end) {
   printf("INIT: %p %p\n", start, end);
   assert(end - start > 1);
   first_counter = start;
@@ -31,7 +31,6 @@ extern "C" void __sanitizer_cov_pcs_init(const uintptr_t *pcs_beg,
   FirstPCFlag = B[1];
 }
 
-
 int main() {
   assert(first_counter);
   assert(*first_counter == 1);
diff --git a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp
index 29a63c0a92..770c7d3497 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_stack_depth.cpp
@@ -6,9 +6,9 @@
 // RUN:     %s -o %t
 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not Assertion{{.*}}failed
 
+#include <cassert>
 #include <cstdint>
 #include <cstdio>
-#include <cassert>
 
 thread_local uintptr_t __sancov_lowest_stack;
 uintptr_t last_stack;
@@ -16,7 +16,8 @@ uintptr_t last_stack;
 void foo(int recurse) {
   assert(__sancov_lowest_stack < last_stack);
   last_stack = __sancov_lowest_stack;
-  if (recurse <= 0) return;
+  if (recurse <= 0)
+    return;
   foo(recurse - 1);
 }
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp
index a3911c099c..0bcfa9f96e 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-dso.cpp
@@ -20,8 +20,8 @@
 #include <stdio.h>
 
 extern "C" {
-  int bar();
-  int baz();
+int bar();
+int baz();
 }
 
 #ifdef MAIN
diff --git a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp
index cd5ea30713..8a9d24d285 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/coverage_sanitizer_trace_pc_guard-init.cpp
@@ -11,23 +11,23 @@
 // RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s
 // RUN: rm -rf %t_workdir
 
-#include <stdio.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 extern "C" {
-  int bar();
-  int baz();
+int bar();
+int baz();
 }
 
 #ifdef MAIN
 
-extern "C" void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
+extern "C" void __sanitizer_cov_trace_pc_guard_init(uint32_t *start,
+                                                    uint32_t *stop) {
   fprintf(stderr, "__sanitizer_cov_trace_pc_guard_init\n");
 }
 
-extern "C" void __sanitizer_cov_trace_pc_guard(uint32_t *guard) { }
-
+extern "C" void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {}
 
 int foo() {
   fprintf(stderr, "foo\n");
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 46afb5c72b..c0b8274000 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -187,6 +187,7 @@
 #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
 #include "llvm/Transforms/Instrumentation/CGProfile.h"
 #include "llvm/Transforms/Instrumentation/ControlHeightReduction.h"
+#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/DataFlowSanitizer.h"
 #include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/Instrumentation/HWAddressSanitizer.h"
@@ -203,7 +204,6 @@
 #include "llvm/Transforms/Instrumentation/PoisonChecking.h"
 #include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"
 #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"
-#include "llvm/Transforms/Instrumentation/CoverageSanitizer.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
 #include "llvm/Transforms/ObjCARC.h"
 #include "llvm/Transforms/Scalar/ADCE.h"
diff --git a/llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp
index ff9157b806..648b9ee072 100644
--- a/llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/CoverageSanitizer.cpp
@@ -272,11 +272,11 @@ private:
   LLVMContext *C;
   const DataLayout *DL;
 
-  GlobalVariable *FunctionGuardArray;  // for trace-pc-guard.
-  GlobalVariable *Function8bitCounterArray;  // for inline-8bit-counters.
-  GlobalVariable *FunctionBoolArray;         // for inline-bool-flag.
-  GlobalVariable *FunctionPCsArray;  // for pc-table.
-  GlobalVariable *FunctionCFsArray;  // for control flow table
+  GlobalVariable *FunctionGuardArray;       // for trace-pc-guard.
+  GlobalVariable *Function8bitCounterArray; // for inline-8bit-counters.
+  GlobalVariable *FunctionBoolArray;        // for inline-bool-flag.
+  GlobalVariable *FunctionPCsArray;         // for pc-table.
+  GlobalVariable *FunctionCFsArray;         // for control flow table
   SmallVector<GlobalValue *, 20> GlobalsToAppendToUsed;
   SmallVector<GlobalValue *, 20> GlobalsToAppendToCompilerUsed;
 
@@ -320,13 +320,11 @@ ModuleCoverageSanitizer::CreateSecStartEnd(Module &M, const char *Section,
   GlobalValue::LinkageTypes Linkage = TargetTriple.isOSBinFormatCOFF()
                                           ? GlobalVariable::ExternalLinkage
                                           : GlobalVariable::ExternalWeakLinkage;
-  GlobalVariable *SecStart =
-      new GlobalVariable(M, Ty, false, Linkage, nullptr,
-                         getSectionStart(Section));
+  GlobalVariable *SecStart = new GlobalVariable(M, Ty, false, Linkage, nullptr,
+                                                getSectionStart(Section));
   SecStart->setVisibility(GlobalValue::HiddenVisibility);
-  GlobalVariable *SecEnd =
-      new GlobalVariable(M, Ty, false, Linkage, nullptr,
-                         getSectionEnd(Section));
+  GlobalVariable *SecEnd = new GlobalVariable(M, Ty, false, Linkage, nullptr,
+                                              getSectionEnd(Section));
   SecEnd->setVisibility(GlobalValue::HiddenVisibility);
   IRBuilder<> IRB(M.getContext());
   if (!TargetTriple.isOSBinFormatCOFF())
@@ -432,25 +430,16 @@ bool ModuleCoverageSanitizer::instrumentModule() {
 
   // Loads.
   SanCovLoadFunction[0] = M.getOrInsertFunction(SanCovLoad1, VoidTy, PtrTy);
-  SanCovLoadFunction[1] =
-      M.getOrInsertFunction(SanCovLoad2, VoidTy, PtrTy);
-  SanCovLoadFunction[2] =
-      M.getOrInsertFunction(SanCovLoad4, VoidTy, PtrTy);
-  SanCovLoadFunction[3] =
-      M.getOrInsertFunction(SanCovLoad8, VoidTy, PtrTy);
-  SanCovLoadFunction[4] =
-      M.getOrInsertFunction(SanCovLoad16, VoidTy, PtrTy);
+  SanCovLoadFunction[1] = M.getOrInsertFunction(SanCovLoad2, VoidTy, PtrTy);
+  SanCovLoadFunction[2] = M.getOrInsertFunction(SanCovLoad4, VoidTy, PtrTy);
+  SanCovLoadFunction[3] = M.getOrInsertFunction(SanCovLoad8, VoidTy, PtrTy);
+  SanCovLoadFunction[4] = M.getOrInsertFunction(SanCovLoad16, VoidTy, PtrTy);
   // Stores.
-  SanCovStoreFunction[0] =
-      M.getOrInsertFunction(SanCovStore1, VoidTy, PtrTy);
-  SanCovStoreFunction[1] =
-      M.getOrInsertFunction(SanCovStore2, VoidTy, PtrTy);
-  SanCovStoreFunction[2] =
-      M.getOrInsertFunction(SanCovStore4, VoidTy, PtrTy);
-  SanCovStoreFunction[3] =
-      M.getOrInsertFunction(SanCovStore8, VoidTy, PtrTy);
-  SanCovStoreFunction[4] =
-      M.getOrInsertFunction(SanCovStore16, VoidTy, PtrTy);
+  SanCovStoreFunction[0] = M.getOrInsertFunction(SanCovStore1, VoidTy, PtrTy);
+  SanCovStoreFunction[1] = M.getOrInsertFunction(SanCovStore2, VoidTy, PtrTy);
+  SanCovStoreFunction[2] = M.getOrInsertFunction(SanCovStore4, VoidTy, PtrTy);
+  SanCovStoreFunction[3] = M.getOrInsertFunction(SanCovStore8, VoidTy, PtrTy);
+  SanCovStoreFunction[4] = M.getOrInsertFunction(SanCovStore16, VoidTy, PtrTy);
 
   {
     AttributeList AL;
@@ -502,16 +491,16 @@ bool ModuleCoverageSanitizer::instrumentModule() {
   }
   if (Ctor && Options.PCTable) {
     auto SecStartEnd = CreateSecStartEnd(M, SanCovPCsSectionName, IntptrTy);
-    FunctionCallee InitFunction = declareSanitizerInitFunction(
-        M, SanCovPCsInitName, {PtrTy, PtrTy});
+    FunctionCallee InitFunction =
+        declareSanitizerInitFunction(M, SanCovPCsInitName, {PtrTy, PtrTy});
     IRBuilder<> IRBCtor(Ctor->getEntryBlock().getTerminator());
     IRBCtor.CreateCall(InitFunction, {SecStartEnd.first, SecStartEnd.second});
   }
 
   if (Ctor && Options.CollectControlFlow) {
     auto SecStartEnd = CreateSecStartEnd(M, SanCovCFsSectionName, IntptrTy);
-    FunctionCallee InitFunction = declareSanitizerInitFunction(
-        M, SanCovCFsInitName, {PtrTy, PtrTy});
+    FunctionCallee InitFunction =
+        declareSanitizerInitFunction(M, SanCovCFsInitName, {PtrTy, PtrTy});
     IRBuilder<> IRBCtor(Ctor->getEntryBlock().getTerminator());
     IRBCtor.CreateCall(InitFunction, {SecStartEnd.first, SecStartEnd.second});
   }
@@ -568,8 +557,8 @@ static bool shouldInstrumentBlock(const Function &F, const BasicBlock *BB,
 
   // Do not instrument full dominators, or full post-dominators with multiple
   // predecessors.
-  return !isFullDominator(BB, DT)
-    && !(isFullPostDominator(BB, PDT) && !BB->getSinglePredecessor());
+  return !isFullDominator(BB, DT) &&
+         !(isFullPostDominator(BB, PDT) && !BB->getSinglePredecessor());
 }
 
 // Returns true iff From->To is a backedge.
@@ -740,16 +729,16 @@ ModuleCoverageSanitizer::CreatePCArray(Function &F,
   for (size_t i = 0; i < N; i++) {
     if (&F.getEntryBlock() == AllBlocks[i]) {
       PCs.push_back((Constant *)IRB.CreatePointerCast(&F, PtrTy));
-      PCs.push_back((Constant *)IRB.CreateIntToPtr(
-          ConstantInt::get(IntptrTy, 1), PtrTy));
+      PCs.push_back(
+          (Constant *)IRB.CreateIntToPtr(ConstantInt::get(IntptrTy, 1), PtrTy));
     } else {
       PCs.push_back((Constant *)IRB.CreatePointerCast(
           BlockAddress::get(AllBlocks[i]), PtrTy));
       PCs.push_back(Constant::getNullValue(PtrTy));
     }
   }
-  auto *PCArray = CreateFunctionLocalArrayInSection(N * 2, F, PtrTy,
-                                                    SanCovPCsSectionName);
+  auto *PCArray =
+      CreateFunctionLocalArrayInSection(N * 2, F, PtrTy, SanCovPCsSectionName);
   PCArray->setInitializer(
       ConstantArray::get(ArrayType::get(PtrTy, N * 2), PCs));
   PCArray->setConstant(true);
@@ -777,7 +766,8 @@ void ModuleCoverageSanitizer::CreateFunctionLocalArrays(
 bool ModuleCoverageSanitizer::InjectCoverage(Function &F,
                                              ArrayRef<BasicBlock *> AllBlocks,
                                              bool IsLeafFunc) {
-  if (AllBlocks.empty()) return false;
+  if (AllBlocks.empty())
+    return false;
   CreateFunctionLocalArrays(F, AllBlocks);
   for (size_t i = 0, N = AllBlocks.size(); i < N; i++)
     InjectCoverageAtBlock(F, *AllBlocks[i], i, IsLeafFunc);
@@ -853,13 +843,14 @@ void ModuleCoverageSanitizer::InjectTraceForDiv(
   for (auto *BO : DivTraceTargets) {
     InstrumentationIRBuilder IRB(BO);
     Value *A1 = BO->getOperand(1);
-    if (isa<ConstantInt>(A1)) continue;
+    if (isa<ConstantInt>(A1))
+      continue;
     if (!A1->getType()->isIntegerTy())
       continue;
     uint64_t TypeSize = DL->getTypeStoreSizeInBits(A1->getType());
-    int CallbackIdx = TypeSize == 32 ? 0 :
-        TypeSize == 64 ? 1 : -1;
-    if (CallbackIdx < 0) continue;
+    int CallbackIdx = TypeSize == 32 ? 0 : TypeSize == 64 ? 1 : -1;
+    if (CallbackIdx < 0)
+      continue;
     auto Ty = Type::getIntNTy(*C, TypeSize);
     IRB.CreateCall(SanCovTraceDivFunction[CallbackIdx],
                    {IRB.CreateIntCast(A1, Ty, true)});
@@ -916,17 +907,20 @@ void ModuleCoverageSanitizer::InjectTraceForCmp(
       if (!A0->getType()->isIntegerTy())
         continue;
       uint64_t TypeSize = DL->getTypeStoreSizeInBits(A0->getType());
-      int CallbackIdx = TypeSize == 8 ? 0 :
-                        TypeSize == 16 ? 1 :
-                        TypeSize == 32 ? 2 :
-                        TypeSize == 64 ? 3 : -1;
-      if (CallbackIdx < 0) continue;
+      int CallbackIdx = TypeSize == 8    ? 0
+                        : TypeSize == 16 ? 1
+                        : TypeSize == 32 ? 2
+                        : TypeSize == 64 ? 3
+                                         : -1;
+      if (CallbackIdx < 0)
+        continue;
       // __sanitizer_cov_trace_cmp((type_size << 32) | predicate, A0, A1);
       auto CallbackFunc = SanCovTraceCmpFunction[CallbackIdx];
       bool FirstIsConst = isa<ConstantInt>(A0);
       bool SecondIsConst = isa<ConstantInt>(A1);
       // If both are const, then we don't need such a comparison.
-      if (FirstIsConst && SecondIsConst) continue;
+      if (FirstIsConst && SecondIsConst)
+        continue;
       // If only one is const, then make it the first callback argument.
       if (FirstIsConst || SecondIsConst) {
         CallbackFunc = SanCovTraceConstCmpFunction[CallbackIdx];
@@ -936,7 +930,7 @@ void ModuleCoverageSanitizer::InjectTraceForCmp(
 
       auto Ty = Type::getIntNTy(*C, TypeSize);
       IRB.CreateCall(CallbackFunc, {IRB.CreateIntCast(A0, Ty, true),
-              IRB.CreateIntCast(A1, Ty, true)});
+                                    IRB.CreateIntCast(A1, Ty, true)});
     }
   }
 }
@@ -1053,13 +1047,13 @@ void ModuleCoverageSanitizer::createFunctionControlFlow(Function &F) {
     if (&BB == &F.getEntryBlock())
       CFs.push_back((Constant *)IRB.CreatePointerCast(&F, PtrTy));
     else
-      CFs.push_back((Constant *)IRB.CreatePointerCast(BlockAddress::get(&BB),
-                                                      PtrTy));
+      CFs.push_back(
+          (Constant *)IRB.CreatePointerCast(BlockAddress::get(&BB), PtrTy));
 
     for (auto SuccBB : successors(&BB)) {
       assert(SuccBB != &F.getEntryBlock());
-      CFs.push_back((Constant *)IRB.CreatePointerCast(BlockAddress::get(SuccBB),
-                                                      PtrTy));
+      CFs.push_back(
+          (Constant *)IRB.CreatePointerCast(BlockAddress::get(SuccBB), PtrTy));
     }
 
     CFs.push_back((Constant *)Constant::getNullValue(PtrTy));
@@ -1073,8 +1067,7 @@ void ModuleCoverageSanitizer::createFunctionControlFlow(Function &F) {
         } else {
           auto CalledF = CB->getCalledFunction();
           if (CalledF && !CalledF->isIntrinsic())
-            CFs.push_back(
-                (Constant *)IRB.CreatePointerCast(CalledF, PtrTy));
+            CFs.push_back((Constant *)IRB.CreatePointerCast(CalledF, PtrTy));
         }
       }
     }
@@ -1082,8 +1075,8 @@ void ModuleCoverageSanitizer::createFunctionControlFlow(Function &F) {
     CFs.push_back((Constant *)Constant::getNullValue(PtrTy));
   }
 
-  FunctionCFsArray = CreateFunctionLocalArrayInSection(
-      CFs.size(), F, PtrTy, SanCovCFsSectionName);
+  FunctionCFsArray = CreateFunctionLocalArrayInSection(CFs.size(), F, PtrTy,
+                                                       SanCovCFsSectionName);
   FunctionCFsArray->setInitializer(
       ConstantArray::get(ArrayType::get(PtrTy, CFs.size()), CFs));
   FunctionCFsArray->setConstant(true);

@@ -257,7 +257,7 @@ General purpose options

A semicolon list of arguments to pass when running the libc++ benchmarks using the
``check-cxx-benchmarks`` rule. By default we run the benchmarks for a very short amount of time,
since the primary use of ``check-cxx-benchmarks`` is to get test and sanitizer coverage, not to
since the primary use of ``check-cxx-benchmarks`` is to get test and coverage sanitizer, not to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is wrong. This documentation relates to "coverage for sanitizers", not a specific kind of "sanitizer for coverage".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I did another pass on the PR to make sure there wasn't other such instances

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this; it's a minor inconsistency, but a needless one as best I can tell. The changes mostly look good, but there are a bunch of binary files (.exe) that seem to have changed; do you know why?

@cor3ntin
Copy link
Contributor Author

Thank you for working on this; it's a minor inconsistency, but a needless one as best I can tell. The changes mostly look good, but there are a bunch of binary files (.exe) that seem to have changed; do you know why?

Global find of replace in the binaries.
Sadly I'm not sure how you can review that beside by inspecting the diff locally (using git diff -- text in an ascii terminal)

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang bits LGTM

@ldionne ldionne removed the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 3, 2024
Copy link
Member

@medismailben medismailben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for lldb's part

@AaronBallman
Copy link
Collaborator

Precommit CI test failures look related:

�_bk;t=1725284334938�******************** TEST 'LLVM :: tools/sancov/symbolize.test' FAILED ********************

�_bk;t=1725284334938�Exit Code: 1

�_bk;t=1725284334938�

�_bk;t=1725284334938�Command Output (stderr):

�_bk;t=1725284334938�--

�_bk;t=1725284334938�RUN: at line 2: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/sancov -symbolize -strip_path_prefix="llvm/" /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64 /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64.0.sancov | /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/FileCheck /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize.test --check-prefixes=CHECK,STRIP

�_bk;t=1725284334938�+ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/sancov -symbolize -strip_path_prefix=llvm/ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64 /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64.0.sancov

�_bk;t=1725284334938�+ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/FileCheck /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize.test --check-prefixes=CHECK,STRIP

�_bk;t=1725284334938�/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize.test:13:13: error: CHECK-NEXT: expected string not found in input

�_bk;t=1725284334938�CHECK-NEXT: "binary-hash": "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",

�_bk;t=1725284334938�            ^

�_bk;t=1725284334938�<stdin>:8:4: note: scanning from here

�_bk;t=1725284334938� ],

�_bk;t=1725284334938�   ^

�_bk;t=1725284334938�<stdin>:9:2: note: possible intended match here

�_bk;t=1725284334938� "binary-hash": "A13A863C18DD4DA9E926DB113A369DA45AE33134",

�_bk;t=1725284334938� ^

�_bk;t=1725284334938�

�_bk;t=1725284334938�Input file: <stdin>

�_bk;t=1725284334938�Check file: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize.test

�_bk;t=1725284334938�

�_bk;t=1725284334938�-dump-input=help explains the following input dump.

�_bk;t=1725284334938�

�_bk;t=1725284334938�Input was:

�_bk;t=1725284334938�<<<<<<

�_bk;t=1725284334938�           1: { 

�_bk;t=1725284334938�           2:  "covered-points": [ 

�_bk;t=1725284334938�           3:  "4e132b", 

�_bk;t=1725284334938�           4:  "4e1472", 

�_bk;t=1725284334938�           5:  "4e1520", 

�_bk;t=1725284334938�           6:  "4e1553", 

�_bk;t=1725284334938�           7:  "4e1586" 

�_bk;t=1725284334938�           8:  ], 

�_bk;t=1725284334938�next:13'0        X error: no match found

�_bk;t=1725284334938�           9:  "binary-hash": "A13A863C18DD4DA9E926DB113A369DA45AE33134", 

�_bk;t=1725284334938�next:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334938�next:13'1      ?                                                           possible intended match

�_bk;t=1725284334938�          10:  "point-symbol-info": { 

�_bk;t=1725284334938�next:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334938�          11:  "test/tools/sancov/Inputs/test.cpp": { 

�_bk;t=1725284334938�next:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334938�          12:  "bar(std::string)": { 

�_bk;t=1725284334938�next:13'0     ~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334938�          13:  "4e132b": "12:0" 

�_bk;t=1725284334938�next:13'0     ~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334938�          14:  }, 

�_bk;t=1725284334938�next:13'0     ~~~~

�_bk;t=1725284334938�           .

�_bk;t=1725284334938�           .

�_bk;t=1725284334938�           .

�_bk;t=1725284334938�>>>>>>

�_bk;t=1725284334938�

�_bk;t=1725284334938�--

�_bk;t=1725284334938�

�_bk;t=1725284334938�********************

�_bk;t=1725284334939�FAIL: LLVM :: tools/sancov/symbolize_noskip_dead_files.test (86063 of 96817)

�_bk;t=1725284334939�******************** TEST 'LLVM :: tools/sancov/symbolize_noskip_dead_files.test' FAILED ********************

�_bk;t=1725284334939�Exit Code: 1

�_bk;t=1725284334939�

�_bk;t=1725284334939�Command Output (stderr):

�_bk;t=1725284334939�--

�_bk;t=1725284334939�RUN: at line 2: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/sancov -symbolize -skip-dead-files=0 -strip_path_prefix="llvm/" /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64 /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64.0.sancov | /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/FileCheck /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize_noskip_dead_files.test

�_bk;t=1725284334939�+ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/sancov -symbolize -skip-dead-files=0 -strip_path_prefix=llvm/ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64 /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/Inputs/test-linux_x86_64.0.sancov

�_bk;t=1725284334939�+ /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/build/bin/FileCheck /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize_noskip_dead_files.test

�_bk;t=1725284334939�/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize_noskip_dead_files.test:12:13: error: CHECK-NEXT: expected string not found in input

�_bk;t=1725284334939�CHECK-NEXT: "binary-hash": "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",

�_bk;t=1725284334939�            ^

�_bk;t=1725284334939�<stdin>:8:4: note: scanning from here

�_bk;t=1725284334939� ],

�_bk;t=1725284334939�   ^

�_bk;t=1725284334939�<stdin>:9:2: note: possible intended match here

�_bk;t=1725284334939� "binary-hash": "A13A863C18DD4DA9E926DB113A369DA45AE33134",

�_bk;t=1725284334939� ^

�_bk;t=1725284334939�

�_bk;t=1725284334939�Input file: <stdin>

�_bk;t=1725284334939�Check file: /var/lib/buildkite-agent/builds/linux-56-59b8f5d88-c4bpt-1/llvm-project/github-pull-requests/llvm/test/tools/sancov/symbolize_noskip_dead_files.test

�_bk;t=1725284334939�

�_bk;t=1725284334939�-dump-input=help explains the following input dump.

�_bk;t=1725284334939�

�_bk;t=1725284334939�Input was:

�_bk;t=1725284334939�<<<<<<

�_bk;t=1725284334939�           1: { 

�_bk;t=1725284334939�           2:  "covered-points": [ 

�_bk;t=1725284334939�           3:  "4e132b", 

�_bk;t=1725284334939�           4:  "4e1472", 

�_bk;t=1725284334939�           5:  "4e1520", 

�_bk;t=1725284334939�           6:  "4e1553", 

�_bk;t=1725284334939�           7:  "4e1586" 

�_bk;t=1725284334939�           8:  ], 

�_bk;t=1725284334939�next:12'0        X error: no match found

�_bk;t=1725284334939�           9:  "binary-hash": "A13A863C18DD4DA9E926DB113A369DA45AE33134", 

�_bk;t=1725284334939�next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334939�next:12'1      ?                                                           possible intended match

�_bk;t=1725284334939�          10:  "point-symbol-info": { 

�_bk;t=1725284334939�next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334939�          11:  "test/tools/sancov/Inputs/foo.cpp": { 

�_bk;t=1725284334939�next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

�_bk;t=1725284334939�          12:  "foo()": { 

�_bk;t=1725284334939�next:12'0     ~~~~~~~~~~~~

�_bk;t=1725284334939�          13:  "4e178c": "5:0" 

�_bk;t=1725284334939�next:12'0     ~~~~~~~~~~~~~~~~~

�_bk;t=1725284334939�          14:  } 

�_bk;t=1725284334939�next:12'0     ~~~

�_bk;t=1725284334939�           .

�_bk;t=1725284334939�           .

�_bk;t=1725284334939�           .

�_bk;t=1725284334939�>>>>>>

�_bk;t=1725284334939�

�_bk;t=1725284334939�--

�_bk;t=1725284334939�

�_bk;t=1725284334939�********************

it looks like some hashes may need to be updated in those tests due to the renaming.

@vitalybuka -- are you comfortable with the rename as the sanitizer owner?

@cor3ntin
Copy link
Contributor Author

ping!

Copy link
Collaborator

@vitalybuka vitalybuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it change the meaning completely.
I read "Coverage Sanitizer" as a tool which finds bugs in Coverage.
When "Sanitizer Coverage" as a coverage used by sanitizers.

This component is not sanitizer at all, and the current name is more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category compiler-rt:asan Address sanitizer compiler-rt:fuzzer compiler-rt:sanitizer compiler-rt lldb llvm:ir llvm:transforms PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants