]> granicus.if.org Git - llvm/commitdiff
[cmake] Add support for using the standalone leaks sanitizer with LLVM.
authorMichael Gottesman <mgottesman@apple.com>
Tue, 20 Jun 2017 20:28:07 +0000 (20:28 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Tue, 20 Jun 2017 20:28:07 +0000 (20:28 +0000)
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

cmake/modules/HandleLLVMOptions.cmake

index c3325db117882d64457fab640b96542c6cd21fd8..98f58d7b197d9ff814076b9ad98b5123f8812d2c 100644 (file)
@@ -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()