[llvm] r189747 - [CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
Alexey Samsonov
samsonov at google.com
Mon Sep 2 02:15:01 PDT 2013
Author: samsonov
Date: Mon Sep 2 04:15:01 2013
New Revision: 189747
URL: http://llvm.org/viewvc/llvm-project?rev=189747&view=rev
Log:
[CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
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=189747&r1=189746&r2=189747&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon Sep 2 04:15:01 2013
@@ -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.
More information about the llvm-commits
mailing list