From: Michael Gottesman Date: Tue, 20 Jun 2017 20:28:07 +0000 (+0000) Subject: [cmake] Add support for using the standalone leaks sanitizer with LLVM. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=864e349715f5e32049bef560a23777b465f6c8ca;p=llvm [cmake] Add support for using the standalone leaks sanitizer with LLVM. This commit causes LLVM_USE_SANITIZER to now accept the "Leaks" option. This will cause cmake to pass in -fsanitize=leak in all of the appropriate places. I am making this change so that I can setup a linux bot that only detects leaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305839 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index c3325db1178..98f58d7b197 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -642,6 +642,9 @@ if(LLVM_USE_SANITIZER) append_common_sanitizer_flags() append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + elseif (LLVM_USE_SANITIZER STREQUAL "Leaks") + append_common_sanitizer_flags() + append("-fsanitize=leak" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) else() message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}") endif()