diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-06-19 19:42:55 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-19 19:42:55 -0700 | 
| commit | 17b80d947dccb7d73efbffd8fe6e8ae28af759ee (patch) | |
| tree | 652ff7e09b1e54ce928ee1911a658b6bbd3247cd /src/rustllvm/PassWrapper.cpp | |
| parent | 2d1bd57e60a141fc2a460539b69e228cc1d7010e (diff) | |
| parent | 0a65f280c8eac844a74b758822ca52e8763a1d5d (diff) | |
| download | rust-17b80d947dccb7d73efbffd8fe6e8ae28af759ee.tar.gz rust-17b80d947dccb7d73efbffd8fe6e8ae28af759ee.zip | |
Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikic
Diagnose use of incompatible sanitizers Emit an error when incompatible sanitizer are configured through command line options. Previously the last one configured prevailed and others were silently ignored. Additionally use a set to represent configured sanitizers, making it possible to enable multiple sanitizers at once. At least in principle, since currently all of them are considered to be incompatible with others.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 323bd26c698..9bc111c26ba 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -717,11 +717,12 @@ enum class LLVMRustOptStage { }; struct LLVMRustSanitizerOptions { + bool SanitizeAddress; + bool SanitizeAddressRecover; bool SanitizeMemory; + bool SanitizeMemoryRecover; + int SanitizeMemoryTrackOrigins; bool SanitizeThread; - bool SanitizeAddress; - bool SanitizeRecover; - int SanitizeMemoryTrackOrigins; }; extern "C" void @@ -808,7 +809,7 @@ LLVMRustOptimizeWithNewPassManager( if (SanitizerOptions->SanitizeMemory) { MemorySanitizerOptions Options( SanitizerOptions->SanitizeMemoryTrackOrigins, - SanitizerOptions->SanitizeRecover, + SanitizerOptions->SanitizeMemoryRecover, /*CompileKernel=*/false); #if LLVM_VERSION_GE(10, 0) PipelineStartEPCallbacks.push_back([Options](ModulePassManager &MPM) { @@ -842,14 +843,14 @@ LLVMRustOptimizeWithNewPassManager( OptimizerLastEPCallbacks.push_back( [SanitizerOptions](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) { FPM.addPass(AddressSanitizerPass( - /*CompileKernel=*/false, SanitizerOptions->SanitizeRecover, + /*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover, /*UseAfterScope=*/true)); } ); PipelineStartEPCallbacks.push_back( [SanitizerOptions](ModulePassManager &MPM) { MPM.addPass(ModuleAddressSanitizerPass( - /*CompileKernel=*/false, SanitizerOptions->SanitizeRecover)); + /*CompileKernel=*/false, SanitizerOptions->SanitizeAddressRecover)); } ); } | 
