diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-09-09 07:02:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-09 07:02:30 +0200 |
| commit | 6d2033512b37a7e6f1b659404e471c2352b2f83f (patch) | |
| tree | d2d8198e91f260ced19116f49abe156b930060d6 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 7200da0217f99e929e58d0b40483097db37270ac (diff) | |
| parent | 16525cc4c34649c564e9544ec1d9c45c4c4f4e52 (diff) | |
| download | rust-6d2033512b37a7e6f1b659404e471c2352b2f83f.tar.gz rust-6d2033512b37a7e6f1b659404e471c2352b2f83f.zip | |
Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726
Enable eager checks for memory sanitizer Fixes #99179
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index bc49dfe7eae..24e18826048 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -134,7 +134,12 @@ extern "C" LLVMPassRef LLVMRustCreateMemorySanitizerPass(int TrackOrigins, bool const bool CompileKernel = false; return wrap(createMemorySanitizerLegacyPassPass( - MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel})); +#if LLVM_VERSION_GE(14, 0) + MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel, /*EagerChecks=*/true} +#else + MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel} +#endif + )); #else report_fatal_error("Legacy PM not supported with LLVM 15"); #endif @@ -930,10 +935,18 @@ LLVMRustOptimizeWithNewPassManager( if (SanitizerOptions) { if (SanitizerOptions->SanitizeMemory) { +#if LLVM_VERSION_GE(14, 0) + MemorySanitizerOptions Options( + SanitizerOptions->SanitizeMemoryTrackOrigins, + SanitizerOptions->SanitizeMemoryRecover, + /*CompileKernel=*/false, + /*EagerChecks=*/true); +#else MemorySanitizerOptions Options( SanitizerOptions->SanitizeMemoryTrackOrigins, SanitizerOptions->SanitizeMemoryRecover, /*CompileKernel=*/false); +#endif OptimizerLastEPCallbacks.push_back( [Options](ModulePassManager &MPM, OptimizationLevel Level) { #if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0) |
