<commit_before>find_package(UUID REQUIRED)

add_swift_library(swiftBasic
  Cache.cpp
  ClusteredBitVector.cpp
  Demangle.cpp
  DemangleWrappers.cpp
  DiagnosticConsumer.cpp
  DiverseStack.cpp
  JSONSerialization.cpp
  LangOptions.cpp
  Platform.cpp
  PrettyStackTrace.cpp
  PrimitiveParsing.cpp
  Program.cpp
  Punycode.cpp
  PunycodeUTF8.cpp
  QuotedString.cpp
  Remangle.cpp
  SourceLoc.cpp
  StringExtras.cpp
  TaskQueue.cpp
  ThreadSafeRefCounted.cpp
  Unicode.cpp
  UUID.cpp
  Version.cpp

  # Platform-specific TaskQueue implementations
  Unix/TaskQueue.inc

  # Platform-agnostic fallback TaskQueue implementation
  Default/TaskQueue.inc

  UnicodeExtendedGraphemeClusters.cpp.gyb

  C_COMPILE_FLAGS "-I${UUID_INCLUDE_DIRS}"
  LINK_LIBRARIES ${UUID_LIBRARIES}
  COMPONENT_DEPENDS support)

set(SWIFT_VERSION "99.99" CACHE STRING
    "The user-visible version of the Swift compiler")
set(SWIFT_VENDOR "" CACHE STRING
    "The vendor name of the Swift compiler")

message(STATUS "Swift version: ${SWIFT_VERSION}")
message(STATUS "Swift vendor: ${SWIFT_VENDOR}")

string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" SWIFT_VERSION_MAJOR
  ${SWIFT_VERSION})
string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" SWIFT_VERSION_MINOR
  ${SWIFT_VERSION})

set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
  " -DSWIFT_VERSION=${SWIFT_VERSION} -DSWIFT_VERSION_MAJOR=${SWIFT_VERSION_MAJOR} -DSWIFT_VERSION_MINOR=${SWIFT_VERSION_MINOR}")

if ("${SWIFT_VERSION}" MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" SWIFT_VERSION_PATCHLEVEL
    ${SWIFT_VERSION})
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
    " -DSWIFT_HAS_VERSION_PATCHLEVEL=1 -DSWIFT_VERSION_PATCHLEVEL=${SWIFT_VERSION_PATCHLEVEL}")
else()
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
    " -DSWIFT_HAS_VERSION_PATCHLEVEL=0")
endif()

if(NOT "${SWIFT_VENDOR}" STREQUAL "")
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
      " -DSWIFT_VENDOR=\"\\\"${SWIFT_VENDOR}\\\"\"")
endif()

option(SWIFT_REPOSITORY_STRING
    "The string that identifies the SCM commit(s) for this build"
    "")

if(NOT "${CLANG_REPOSITORY_STRING}" STREQUAL "")
  set(SWIFT_REPOSITORY_STRING
      "${SWIFT_REPOSITORY_STRING} ${CLANG_REPOSITORY_STRING}")<commit_msg>CMake: change SWIFT_REPOSITORY_STRING to STRING type, as originally intended<commit_after>find_package(UUID REQUIRED)

add_swift_library(swiftBasic
  Cache.cpp
  ClusteredBitVector.cpp
  Demangle.cpp
  DemangleWrappers.cpp
  DiagnosticConsumer.cpp
  DiverseStack.cpp
  JSONSerialization.cpp
  LangOptions.cpp
  Platform.cpp
  PrettyStackTrace.cpp
  PrimitiveParsing.cpp
  Program.cpp
  Punycode.cpp
  PunycodeUTF8.cpp
  QuotedString.cpp
  Remangle.cpp
  SourceLoc.cpp
  StringExtras.cpp
  TaskQueue.cpp
  ThreadSafeRefCounted.cpp
  Unicode.cpp
  UUID.cpp
  Version.cpp

  # Platform-specific TaskQueue implementations
  Unix/TaskQueue.inc

  # Platform-agnostic fallback TaskQueue implementation
  Default/TaskQueue.inc

  UnicodeExtendedGraphemeClusters.cpp.gyb

  C_COMPILE_FLAGS "-I${UUID_INCLUDE_DIRS}"
  LINK_LIBRARIES ${UUID_LIBRARIES}
  COMPONENT_DEPENDS support)

set(SWIFT_VERSION "99.99" CACHE STRING
    "The user-visible version of the Swift compiler")
set(SWIFT_VENDOR "" CACHE STRING
    "The vendor name of the Swift compiler")

message(STATUS "Swift version: ${SWIFT_VERSION}")
message(STATUS "Swift vendor: ${SWIFT_VENDOR}")

string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" SWIFT_VERSION_MAJOR
  ${SWIFT_VERSION})
string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" SWIFT_VERSION_MINOR
  ${SWIFT_VERSION})

set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
  " -DSWIFT_VERSION=${SWIFT_VERSION} -DSWIFT_VERSION_MAJOR=${SWIFT_VERSION_MAJOR} -DSWIFT_VERSION_MINOR=${SWIFT_VERSION_MINOR}")

if ("${SWIFT_VERSION}" MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" SWIFT_VERSION_PATCHLEVEL
    ${SWIFT_VERSION})
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
    " -DSWIFT_HAS_VERSION_PATCHLEVEL=1 -DSWIFT_VERSION_PATCHLEVEL=${SWIFT_VERSION_PATCHLEVEL}")
else()
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
    " -DSWIFT_HAS_VERSION_PATCHLEVEL=0")
endif()

if(NOT "${SWIFT_VENDOR}" STREQUAL "")
  set_property(SOURCE Version.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
      " -DSWIFT_VENDOR=\"\\\"${SWIFT_VENDOR}\\\"\"")
endif()

set(SWIFT_REPOSITORY_STRING "" CACHE STRING
    "The string that identifies the SCM commit(s) for this build")

if(NOT "${CLANG_REPOSITORY_STRING}" STREQUAL "")
  set(SWIFT_REPOSITORY_STRING
      "${SWIFT_REPOSITORY_STRING} ${CLANG_REPOSITORY_STRING}")
{'fraction_non_alphanumeric': 0.1293157564344005, 'fraction_numerical': 0.014228918183720443, 'mean_word_length': 5.264744429882045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7357312', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1801, 'n_words': 295}