From 5e38b2a456df6e263a509af60a731cec57310498 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 5 Sep 2022 22:30:23 -0700 Subject: [PATCH] [NFC][msan] Rename ModuleMemorySanitizerPass --- clang/lib/CodeGen/BackendUtil.cpp | 2 +- llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h | 4 ++-- llvm/lib/Passes/PassRegistry.def | 4 ++-- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 5b379dc..2de7e6d 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -639,7 +639,7 @@ static void addSanitizers(const Triple &TargetTriple, MemorySanitizerOptions options(TrackOrigins, Recover, CompileKernel, CodeGenOpts.SanitizeMemoryParamRetval); - MPM.addPass(ModuleMemorySanitizerPass(options)); + MPM.addPass(MemorySanitizerPass(options)); if (Level != OptimizationLevel::O0) { // MemorySanitizer inserts complex instrumentation that mostly // follows the logic of the original code, but operates on diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h index 5883f81..dc162d5 100644 --- a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h @@ -40,8 +40,8 @@ struct MemorySanitizerOptions { /// inserts calls to runtime library functions. If the functions aren't declared /// yet, the pass inserts the declarations. Otherwise the existing globals are /// used. -struct ModuleMemorySanitizerPass : public PassInfoMixin { - ModuleMemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {} +struct MemorySanitizerPass : public PassInfoMixin { + MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); void printPipeline(raw_ostream &OS, diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def index c8c09f6..4a14fc7 100644 --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -154,9 +154,9 @@ MODULE_PASS_WITH_PARAMS("asan", parseASanPassOptions, "kernel") MODULE_PASS_WITH_PARAMS("msan", - "ModuleMemorySanitizerPass", + "MemorySanitizerPass", [](MemorySanitizerOptions Opts) { - return ModuleMemorySanitizerPass(Opts); + return MemorySanitizerPass(Opts); }, parseMSanPassOptions, "recover;kernel;eager-checks;track-origins=N") diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index f12524b..3dc7317 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -669,8 +669,8 @@ MemorySanitizerOptions::MemorySanitizerOptions(int TO, bool R, bool K, Recover(getOptOrDefault(ClKeepGoing, Kernel || R)), EagerChecks(getOptOrDefault(ClEagerChecks, EagerChecks)) {} -PreservedAnalyses ModuleMemorySanitizerPass::run(Module &M, - ModuleAnalysisManager &AM) { +PreservedAnalyses MemorySanitizerPass::run(Module &M, + ModuleAnalysisManager &AM) { bool Modified = false; if (!Options.Kernel) { insertModuleCtor(M); @@ -688,9 +688,9 @@ PreservedAnalyses ModuleMemorySanitizerPass::run(Module &M, return Modified ? PreservedAnalyses::none() : PreservedAnalyses::all(); } -void ModuleMemorySanitizerPass::printPipeline( +void MemorySanitizerPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { - static_cast *>(this)->printPipeline( + static_cast *>(this)->printPipeline( OS, MapClassName2PassName); OS << "<"; if (Options.Recover) -- 2.7.4