summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
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
commitf9ab351b8a9f80a8d9e7001bdde39507f5b1ba04 (patch)
tree6a67f107bd54f69b8662db3e13561948f0158661 /llvm/cmake/modules
parentd527cf89e66af87e2fdf31fe51236b1375783f10 (diff)
downloadbcm5719-llvm-f9ab351b8a9f80a8d9e7001bdde39507f5b1ba04.tar.gz
bcm5719-llvm-f9ab351b8a9f80a8d9e7001bdde39507f5b1ba04.zip
[CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
llvm-svn: 189747
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index b49d6496125..4d56438f18d 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/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.
OpenPOWER on IntegriCloud