summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-09-02 09:15:01 +0000
committerAlexey Samsonov <samsonov@google.com>2013-09-02 09:15:01 +0000
commitb775f2f39c428d6a8a06e81c51b0b7cf51330f50 (patch)
treee47db8c9d71837b887d5978710fce08dfe2045fe /cmake
parent69c474ffa8a4b0186067e39d338a165d4165af2b (diff)
downloadexternal_llvm-b775f2f39c428d6a8a06e81c51b0b7cf51330f50.zip
external_llvm-b775f2f39c428d6a8a06e81c51b0b7cf51330f50.tar.gz
external_llvm-b775f2f39c428d6a8a06e81c51b0b7cf51330f50.tar.bz2
[CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index b49d649..4d56438 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -240,6 +240,10 @@ macro(append_common_sanitizer_flags)
NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
add_flag_if_supported("-gline-tables-only")
endif()
+ # Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
+ if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ add_flag_if_supported("-O1")
+ endif()
endmacro()
# Turn on sanitizers if necessary.