Commit 1a8935a4 by Nicolas Capens Committed by Nicolas Capens

Fix conditionally enabling Reactor MSan instrumentation

The LLVM MemorySanitizer pass was added for -fsanitizer=memory builds when REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION is defined, but LLVMJIT.cpp includes LLVMReactor.hpp, which in turn includes Reactor.hpp which defines REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION to 0 if not previously defined, which will always enable it. Use #if instead of #ifdef to conditionally enable instrumentation based on REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION's value. Bug: b/155148722 Change-Id: I337832d942fcc576afac4d0c1d89c9fa42974cbe Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50288 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 4804ac87
......@@ -724,7 +724,7 @@ void JITBuilder::optimize(const rr::Config &cfg)
llvm::legacy::PassManager passManager;
#ifdef REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION
#if REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION
if(__has_feature(memory_sanitizer))
{
passManager.add(llvm::createMemorySanitizerLegacyPassPass());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment