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
1 changed files with 7 additions and 1 deletions
|
@ -936,12 +936,14 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
/*CompileKernel=*/false);
|
/*CompileKernel=*/false);
|
||||||
OptimizerLastEPCallbacks.push_back(
|
OptimizerLastEPCallbacks.push_back(
|
||||||
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
|
[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));
|
MPM.addPass(ModuleMemorySanitizerPass(Options));
|
||||||
#else
|
#else
|
||||||
MPM.addPass(MemorySanitizerPass(Options));
|
MPM.addPass(MemorySanitizerPass(Options));
|
||||||
#endif
|
#endif
|
||||||
|
#if LLVM_VERSION_LT(16, 0)
|
||||||
MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options)));
|
MPM.addPass(createModuleToFunctionPassAdaptor(MemorySanitizerPass(Options)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -972,7 +974,11 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
/*UseAfterScope=*/true,
|
/*UseAfterScope=*/true,
|
||||||
AsanDetectStackUseAfterReturnMode::Runtime,
|
AsanDetectStackUseAfterReturnMode::Runtime,
|
||||||
};
|
};
|
||||||
|
#if LLVM_VERSION_LT(16, 0)
|
||||||
MPM.addPass(ModuleAddressSanitizerPass(opts));
|
MPM.addPass(ModuleAddressSanitizerPass(opts));
|
||||||
|
#else
|
||||||
|
MPM.addPass(AddressSanitizerPass(opts));
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
MPM.addPass(ModuleAddressSanitizerPass(
|
MPM.addPass(ModuleAddressSanitizerPass(
|
||||||
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
/*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue