[NFC][sancov] Rename ModuleSanitizerCoveragePass

This commit is contained in:
Vitaly Buka 2022-09-06 20:55:39 -07:00
parent 5e38b2a456
commit 4c18670776
6 changed files with 9 additions and 10 deletions

View File

@ -627,7 +627,7 @@ static void addSanitizers(const Triple &TargetTriple,
OptimizationLevel Level) { OptimizationLevel Level) {
if (CodeGenOpts.hasSanitizeCoverage()) { if (CodeGenOpts.hasSanitizeCoverage()) {
auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts); auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
MPM.addPass(ModuleSanitizerCoveragePass( MPM.addPass(SanitizerCoveragePass(
SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles, SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
CodeGenOpts.SanitizeCoverageIgnorelistFiles)); CodeGenOpts.SanitizeCoverageIgnorelistFiles));
} }

View File

@ -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 -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 // 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 ModuleSanitizerCoveragePass instrumentation. // Verify that -fsanitize-coverage invokes SanitizerCoveragePass instrumentation.
int foo(int *a) { return *a; } int foo(int *a) { return *a; }
// CHECK: _sancov_ // CHECK: _sancov_

View File

@ -27,10 +27,9 @@ class Module;
/// pass instruments functions for coverage, adds initialization calls to the /// pass instruments functions for coverage, adds initialization calls to the
/// module for trace PC guards and 8bit counters if they are requested, and /// module for trace PC guards and 8bit counters if they are requested, and
/// appends globals to llvm.compiler.used. /// appends globals to llvm.compiler.used.
class ModuleSanitizerCoveragePass class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
: public PassInfoMixin<ModuleSanitizerCoveragePass> {
public: public:
explicit ModuleSanitizerCoveragePass( explicit SanitizerCoveragePass(
SanitizerCoverageOptions Options = SanitizerCoverageOptions(), SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
const std::vector<std::string> &AllowlistFiles = const std::vector<std::string> &AllowlistFiles =
std::vector<std::string>(), std::vector<std::string>(),

View File

@ -121,7 +121,7 @@ MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
MODULE_PASS("dfsan", DataFlowSanitizerPass()) MODULE_PASS("dfsan", DataFlowSanitizerPass())
MODULE_PASS("module-inline", ModuleInlinerPass()) MODULE_PASS("module-inline", ModuleInlinerPass())
MODULE_PASS("tsan-module", ModuleThreadSanitizerPass()) MODULE_PASS("tsan-module", ModuleThreadSanitizerPass())
MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass()) MODULE_PASS("sancov-module", SanitizerCoveragePass())
MODULE_PASS("memprof-module", ModuleMemProfilerPass()) MODULE_PASS("memprof-module", ModuleMemProfilerPass())
MODULE_PASS("poison-checking", PoisonCheckingPass()) MODULE_PASS("poison-checking", PoisonCheckingPass())
MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass()) MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass())

View File

@ -280,7 +280,7 @@ private:
}; };
} // namespace } // namespace
PreservedAnalyses ModuleSanitizerCoveragePass::run(Module &M, PreservedAnalyses SanitizerCoveragePass::run(Module &M,
ModuleAnalysisManager &MAM) { ModuleAnalysisManager &MAM) {
ModuleSanitizerCoverage ModuleSancov(Options, Allowlist.get(), ModuleSanitizerCoverage ModuleSancov(Options, Allowlist.get(),
Blocklist.get()); Blocklist.get());

View File

@ -2,8 +2,8 @@
; RUN: -sanitizer-coverage-level=3 %s -S -o - | FileCheck %s ; RUN: -sanitizer-coverage-level=3 %s -S -o - | FileCheck %s
; The edge between %entry and %for.inc.i is a critical edge. ; The edge between %entry and %for.inc.i is a critical edge.
; ModuleSanitizerCoveragePass must split this critical edge in order to track ; SanitizerCoveragePass must split this critical edge in order to track
; coverage of this edge. ModuleSanitizerCoveragePass will also insert calls to ; coverage of this edge. SanitizerCoveragePass will also insert calls to
; @__sanitizer_cov_trace_pc using the debug location from the predecessor's ; @__sanitizer_cov_trace_pc using the debug location from the predecessor's
; branch. but, if the branch itself is missing debug info (say, by accident ; branch. but, if the branch itself is missing debug info (say, by accident
; due to a bug in an earlier transform), we would fail a verifier check that ; due to a bug in an earlier transform), we would fail a verifier check that