Index: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake @@ -588,6 +588,9 @@ else() message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.") endif() + if (LLVM_USE_SANITIZER MATCHES "(Undefined;)?Address(;Undefined)?") + append("-fsanitize-address-use-after-scope" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + endif() if (LLVM_USE_SANITIZE_COVERAGE) append("-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif()