[clang] 4c18670 - [NFC][sancov] Rename ModuleSanitizerCoveragePass
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 6 20:58:15 PDT 2022
Author: Vitaly Buka
Date: 2022-09-06T20:55:39-07:00
New Revision: 4c18670776cd6ac31099a455b2b22b38b0408006
URL: https://github.com/llvm/llvm-project/commit/4c18670776cd6ac31099a455b2b22b38b0408006
DIFF: https://github.com/llvm/llvm-project/commit/4c18670776cd6ac31099a455b2b22b38b0408006.diff
LOG: [NFC][sancov] Rename ModuleSanitizerCoveragePass
Added:
Modified:
clang/lib/CodeGen/BackendUtil.cpp
clang/test/Driver/sancov.c
llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 2de7e6d1d0fdc..1bb734863c7df 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -627,7 +627,7 @@ static void addSanitizers(const Triple &TargetTriple,
OptimizationLevel Level) {
if (CodeGenOpts.hasSanitizeCoverage()) {
auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
- MPM.addPass(ModuleSanitizerCoveragePass(
+ MPM.addPass(SanitizerCoveragePass(
SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
CodeGenOpts.SanitizeCoverageIgnorelistFiles));
}
diff --git a/clang/test/Driver/sancov.c b/clang/test/Driver/sancov.c
index 64181ccf59a96..44acfd3d8f3aa 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 ModuleSanitizerCoveragePass instrumentation.
+// Verify that -fsanitize-coverage invokes SanitizerCoveragePass instrumentation.
int foo(int *a) { return *a; }
// CHECK: _sancov_
diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
index dfa85fde28e65..89ab4fd114fcc 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
@@ -27,10 +27,9 @@ class Module;
/// pass instruments functions for coverage, adds initialization calls to the
/// module for trace PC guards and 8bit counters if they are requested, and
/// appends globals to llvm.compiler.used.
-class ModuleSanitizerCoveragePass
- : public PassInfoMixin<ModuleSanitizerCoveragePass> {
+class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
public:
- explicit ModuleSanitizerCoveragePass(
+ explicit SanitizerCoveragePass(
SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
const std::vector<std::string> &AllowlistFiles =
std::vector<std::string>(),
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 4a14fc785ba56..97b9f07529058 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -121,7 +121,7 @@ MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
MODULE_PASS("dfsan", DataFlowSanitizerPass())
MODULE_PASS("module-inline", ModuleInlinerPass())
MODULE_PASS("tsan-module", ModuleThreadSanitizerPass())
-MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass())
+MODULE_PASS("sancov-module", SanitizerCoveragePass())
MODULE_PASS("memprof-module", ModuleMemProfilerPass())
MODULE_PASS("poison-checking", PoisonCheckingPass())
MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass())
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 095e3191ced17..7d717459387a6 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -280,8 +280,8 @@ class ModuleSanitizerCoverage {
};
} // namespace
-PreservedAnalyses ModuleSanitizerCoveragePass::run(Module &M,
- ModuleAnalysisManager &MAM) {
+PreservedAnalyses SanitizerCoveragePass::run(Module &M,
+ ModuleAnalysisManager &MAM) {
ModuleSanitizerCoverage ModuleSancov(Options, Allowlist.get(),
Blocklist.get());
auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
diff --git a/llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll b/llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll
index 3f5542facb0d8..f42fa7139fd58 100644
--- a/llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll
+++ b/llvm/test/Instrumentation/SanitizerCoverage/crit-edge-sancov.ll
@@ -2,8 +2,8 @@
; RUN: -sanitizer-coverage-level=3 %s -S -o - | FileCheck %s
; The edge between %entry and %for.inc.i is a critical edge.
-; ModuleSanitizerCoveragePass must split this critical edge in order to track
-; coverage of this edge. ModuleSanitizerCoveragePass will also insert calls to
+; SanitizerCoveragePass must split this critical edge in order to track
+; coverage of this edge. SanitizerCoveragePass will also insert calls to
; @__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
; due to a bug in an earlier transform), we would fail a verifier check that
More information about the cfe-commits
mailing list