mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
llvm-wrapper: adapt for LLVM API changes
No functional changes intended. Adapts PassWrapper for two recent LLVM API changes: *e7bac3b9fa
*93600eb50c
*5e38b2a456
This commit is contained in:
parent
0568b0a3de
commit
a3b60f1769
@ -936,12 +936,14 @@ LLVMRustOptimizeWithNewPassManager(
|
||||
/*CompileKernel=*/false);
|
||||
OptimizerLastEPCallbacks.push_back(
|
||||
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
|
||||
#if LLVM_VERSION_GE(14, 0)
|
||||
#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)
|
||||
MPM.addPass(ModuleMemorySanitizerPass(Options));
|
||||
#else
|
||||
MPM.addPass(MemorySanitizerPass(Options));
|
||||
#endif
|
||||
#if LLVM_VERSION_LT(16, 0)
|
||||
MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options)));
|
||||
#endif
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -972,7 +974,11 @@ LLVMRustOptimizeWithNewPassManager(
|
||||
/*UseAfterScope=*/true,
|
||||
AsanDetectStackUseAfterReturnMode::Runtime,
|
||||
};
|
||||
#if LLVM_VERSION_LT(16, 0)
|
||||
MPM.addPass(ModuleAddressSanitizerPass(opts));
|
||||
#else
|
||||
MPM.addPass(AddressSanitizerPass(opts));
|
||||
#endif
|
||||
#else
|
||||
MPM.addPass(ModuleAddressSanitizerPass(
|
||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
||||
|
Loading…
Reference in New Issue
Block a user