llvm.org GIT mirror llvm / 92e82c5
cmake: Only sanitize use-after-scope if the host compiler supports it In r292256, we started adding -fsanitize-use-after-scope when using the address sanitizer, but that flag wasn't always available. This fixes the config to only add the flag if the host compiler supports it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292423 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 3 years ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
588588 message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.")
589589 endif()
590590 if (LLVM_USE_SANITIZER MATCHES "(Undefined;)?Address(;Undefined)?")
591 append("-fsanitize-address-use-after-scope" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
591 add_flag_if_supported("-fsanitize-address-use-after-scope"
592593 endif()
594595 append("-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)