提交 6234a569 编写于 作者: A Augie Fackler

rustc_llvm: update PassWrapper for recent LLVM

Now AddressSanitizerOptions is a struct, but at least the change was
tiny.

r? nikic
上级 eee8b9c7
......@@ -889,15 +889,18 @@ LLVMRustOptimizeWithNewPassManager(
OptimizerLastEPCallbacks.push_back(
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
MPM.addPass(ModuleAddressSanitizerPass(
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
#if LLVM_VERSION_GE(14, 0)
AddressSanitizerOptions opts(/*CompileKernel=*/false,
SanitizerOptions->SanitizeAddressRecover,
/*UseAfterScope=*/true,
AsanDetectStackUseAfterReturnMode::Runtime);
AddressSanitizerOptions opts = AddressSanitizerOptions{
/*CompileKernel=*/false,
SanitizerOptions->SanitizeAddressRecover,
/*UseAfterScope=*/false,
AsanDetectStackUseAfterReturnMode::Runtime,
};
MPM.addPass(ModuleAddressSanitizerPass(opts));
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(opts)));
#else
MPM.addPass(ModuleAddressSanitizerPass(
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
MPM.addPass(createModuleToFunctionPassAdaptor(AddressSanitizerPass(
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover,
/*UseAfterScope=*/true)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册