Skip to content

Commit

Permalink
[NFC][msan] Rename ModuleMemorySanitizerPass
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Sep 7, 2022
1 parent ac66d87 commit 5e38b2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
ModuleMemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}
struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}

PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
void printPipeline(raw_ostream &OS,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Passes/PassRegistry.def
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<StringRef(StringRef)> MapClassName2PassName) {
static_cast<PassInfoMixin<ModuleMemorySanitizerPass> *>(this)->printPipeline(
static_cast<PassInfoMixin<MemorySanitizerPass> *>(this)->printPipeline(
OS, MapClassName2PassName);
OS << "<";
if (Options.Recover)
Expand Down

0 comments on commit 5e38b2a

Please sign in to comment.