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
/// 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,
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")
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);
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)