mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 01:31:26 +00:00
c3228714cc
Rename preprocessor definitions that control tuning of llvm libc. Differential Revision: https://reviews.llvm.org/D143913
15 lines
927 B
CMake
15 lines
927 B
CMake
# ------------------------------------------------------------------------------
|
|
# Common tuning option definitions.
|
|
# ------------------------------------------------------------------------------
|
|
|
|
set(LIBC_COMMON_TUNE_OPTIONS "")
|
|
|
|
option(LIBC_UNSAFE_STRING_WIDE_READ "Functions searching for the first character in a string such as strlen will read the string as int sized blocks instead of bytes. This relies on undefined behavior and may fail on some systems, but improves performance on long strings." OFF)
|
|
if(LIBC_UNSAFE_STRING_WIDE_READ)
|
|
if(LLVM_USE_SANITIZER)
|
|
message(FATAL_ERROR "LIBC_UNSAFE_STRING_WIDE_READ is set at the same time as a sanitizer. LIBC_UNSAFE_STRING_WIDE_READ causes strlen and memchr to read beyond the end of their target strings, which is undefined behavior caught by sanitizers.")
|
|
else()
|
|
list(APPEND LIBC_COMMON_TUNE_OPTIONS "-DLIBC_COPT_UNSAFE_STRING_WIDE_READ")
|
|
endif()
|
|
endif()
|