<commit_before>################################################################################
#
# T:N.U.N. Clang toolchain file.
#
# Copyright (c) 2016. <NAME>. All rights reserved.
#
################################################################################
# http://stackoverflow.com/questions/15548023/clang-optimization-levels
################################################################################

include( "${CMAKE_CURRENT_LIST_DIR}/gcc_compatibles.cmake" )

list( APPEND TNUN_compiler_optimize_for_speed -fvectorize -fslp-vectorize -fslp-vectorize-aggressive )
list( APPEND TNUN_compiler_report_optimization -Rpass=loop-.* )
if( NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" ) # Tested with XCode 8
    list( APPEND TNUN_compiler_LTO -fwhole-program-vtables )
endif()

# http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
# http://clang.llvm.org/docs/AddressSanitizer.html
# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
if ( NOT iOS )
  set( TNUN_linker_runtime_sanity_checks -fsanitize=undefined -fsanitize=address ) # AppleClang lag:  -fsanitize=safe-stack -fsanitize=thread -fsanitize=memory -fsanitize=dataflow -fsanitize=cfi
endif()
set( TNUN_compiler_runtime_sanity_checks ${TNUN_linker_runtime_sanity_checks} -fno-omit-frame-pointer )
set( TNUN_linker_runtime_integer_checks -fsanitize=integer )
set( TNUN_compiler_runtime_integer_checks ${TNUN_compiler_runtime_integer_checks} )

# Leak sanitizer is available only on Clang on Linux x64.
# http://clang.llvm.org/docs/LeakSanitizer.html
# Currently it is very very slow (two orders of magnitude slower than Valgrind).
#if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND TNUN_ABI STREQUAL "x64" )
#    list( APPEND TNUN_compiler_runtime_sanity_checks -fsanitize=leak )<commit_msg>disable sanitizers on AppleClang becuase runtime libraries are missing (both iOS and macOS)<commit_after>################################################################################
#
# T:N.U.N. Clang toolchain file.
#
# Copyright (c) 2016. <NAME>. All rights reserved.
#
################################################################################
# http://stackoverflow.com/questions/15548023/clang-optimization-levels
################################################################################

include( "${CMAKE_CURRENT_LIST_DIR}/gcc_compatibles.cmake" )

list( APPEND TNUN_compiler_optimize_for_speed -fvectorize -fslp-vectorize -fslp-vectorize-aggressive )
list( APPEND TNUN_compiler_report_optimization -Rpass=loop-.* )
if( NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" ) # Tested with XCode 8
    list( APPEND TNUN_compiler_LTO -fwhole-program-vtables )

# http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
# http://clang.llvm.org/docs/AddressSanitizer.html
# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
    set( TNUN_linker_runtime_sanity_checks -fsanitize=undefined -fsanitize=address -fsanitize=safe-stack -fsanitize=thread -fsanitize=memory -fsanitize=dataflow -fsanitize=cfi )
    set( TNUN_compiler_runtime_sanity_checks ${TNUN_linker_runtime_sanity_checks} -fno-omit-frame-pointer )
endif()
set( TNUN_linker_runtime_integer_checks -fsanitize=integer )
set( TNUN_compiler_runtime_integer_checks ${TNUN_compiler_runtime_integer_checks} )

# Leak sanitizer is available only on Clang on Linux x64.
# http://clang.llvm.org/docs/LeakSanitizer.html
# Currently it is very very slow (two orders of magnitude slower than Valgrind).
#if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND TNUN_ABI STREQUAL "x64" )
#    list( APPEND TNUN_compiler_runtime_sanity_checks -fsanitize=leak )
{'fraction_non_alphanumeric': 0.22466960352422907, 'fraction_numerical': 0.009361233480176211, 'mean_word_length': 7.0554323725055434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3182743', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1152, 'n_words': 212}