summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorChris Bieneman <chris.bieneman@me.com>2018-05-17 16:55:29 +0000
committerChris Bieneman <chris.bieneman@me.com>2018-05-17 16:55:29 +0000
commitc2e8e20f9776cb874b19a2d0000955586f9752af (patch)
tree263375148743f71bb8ac3d07acbe087c9217ce50 /llvm/cmake/modules
parentd8d940a872e13f962c33ad9516d676be98202425 (diff)
downloadbcm5719-llvm-c2e8e20f9776cb874b19a2d0000955586f9752af.tar.gz
bcm5719-llvm-c2e8e20f9776cb874b19a2d0000955586f9752af.zip
[CMake] Make optimizing sanitizer builds optional
This behavior has been the default for a long time, so the default value is On, however this can make it difficult to debug sanitizer failures, so we should have an option to turn it off. llvm-svn: 332628
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 66ccebddbdc..7687a4663e4 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -639,7 +639,7 @@ macro(append_common_sanitizer_flags)
add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
endif()
# Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
- if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND LLVM_OPTIMIZE_SANITIZED_BUILDS)
add_flag_if_supported("-O1" O1)
endif()
elseif (CLANG_CL)
OpenPOWER on IntegriCloud