[clang] [compiler-rt] [libcxx] [lldb] [llvm] Rename Sanitizer Coverage => Coverage Sanitizer (PR #106505)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 29 00:52:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-codegen
Author: cor3ntin (cor3ntin)
<details>
<summary>Changes</summary>
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
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]
``````````
</details>
https://github.com/llvm/llvm-project/pull/106505
More information about the cfe-commits
mailing list