[llvm] r305839 - [cmake] Add support for using the standalone leaks sanitizer with LLVM.

Michael Gottesman via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 13:28:07 PDT 2017


Author: mgottesman
Date: Tue Jun 20 15:28:07 2017
New Revision: 305839

URL: http://llvm.org/viewvc/llvm-project?rev=305839&view=rev
Log:
[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.

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=305839&r1=305838&r2=305839&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Tue Jun 20 15:28:07 2017
@@ -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()




More information about the llvm-commits mailing list