mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Merge ec763f1110
into 682eb4c92f
This commit is contained in:
commit
dbc9bc0649
@ -356,6 +356,23 @@ endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-vtable-pointers")
|
||||
|
||||
if (NOT (SANITIZE OR SANITIZE_COVERAGE OR WITH_COVERAGE)
|
||||
AND (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO"))
|
||||
# Applied only for Release builds because we've seen memory exceptions with sanitizer builds.
|
||||
#
|
||||
# The point is to increase the chances of a code explicitly marked as supposed
|
||||
# to be inlined by the programmer to be actually inlined without increasing the
|
||||
# global threshold for inlining. It also makes sense to note that even
|
||||
# `always_inline` is still just a hint from clang's perspective. It works for
|
||||
# `inline` keyword and `always_inline` attribute, but e.g. class methods that
|
||||
# are implicitly `inline` are not considered as having an inline hint.
|
||||
#
|
||||
# The choice of the threshold is rather intuitive. Searching across the github
|
||||
# shows different choices from few thousands to million.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mllvm -inlinehint-threshold=1234")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -inlinehint-threshold=1234")
|
||||
endif()
|
||||
|
||||
# We cannot afford to use LTO when compiling unit tests, and it's not enough
|
||||
# to only supply -fno-lto at the final linking stage. So we disable it
|
||||
# completely.
|
||||
|
Loading…
Reference in New Issue
Block a user