aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/llvm
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/llvm
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/llvm')
-rw-r--r--vcpkg/ports/llvm/0001-fix-install-package-dir.patch13
-rw-r--r--vcpkg/ports/llvm/0002-fix-tools-install-dir.patch201
-rw-r--r--vcpkg/ports/llvm/0003-fix-llvm-config.patch16
-rw-r--r--vcpkg/ports/llvm/0004-disable-libomp-aliases.patch32
-rw-r--r--vcpkg/ports/llvm/0005-remove-numpy.patch16
-rw-r--r--vcpkg/ports/llvm/0006-create-destination-mlir-directory.patch16
-rw-r--r--vcpkg/ports/llvm/75711.patch1350
-rw-r--r--vcpkg/ports/llvm/79694.patch217
-rw-r--r--vcpkg/ports/llvm/82407.patch112
-rw-r--r--vcpkg/ports/llvm/add-include-chrono.patch12
-rw-r--r--vcpkg/ports/llvm/clang_usage5
-rw-r--r--vcpkg/ports/llvm/cmake4.patch117
-rw-r--r--vcpkg/ports/llvm/flang_usage5
-rw-r--r--vcpkg/ports/llvm/lld_usage5
-rw-r--r--vcpkg/ports/llvm/llvm_usage15
-rw-r--r--vcpkg/ports/llvm/mlir_usage5
-rw-r--r--vcpkg/ports/llvm/portfile.cmake407
-rw-r--r--vcpkg/ports/llvm/vcpkg.json471
18 files changed, 3015 insertions, 0 deletions
diff --git a/vcpkg/ports/llvm/0001-fix-install-package-dir.patch b/vcpkg/ports/llvm/0001-fix-install-package-dir.patch
new file mode 100644
index 0000000..6bbe1af
--- /dev/null
+++ b/vcpkg/ports/llvm/0001-fix-install-package-dir.patch
@@ -0,0 +1,13 @@
+ openmp/tools/Modules/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/openmp/tools/Modules/CMakeLists.txt b/openmp/tools/Modules/CMakeLists.txt
+index 22d818eea72d..75aacc4468d4 100644
+--- a/openmp/tools/Modules/CMakeLists.txt
++++ b/openmp/tools/Modules/CMakeLists.txt
+@@ -12,4 +12,4 @@
+
+
+ install(FILES "FindOpenMPTarget.cmake"
+- DESTINATION "${OPENMP_INSTALL_LIBDIR}/cmake/openmp")
++ DESTINATION "share/openmp")
diff --git a/vcpkg/ports/llvm/0002-fix-tools-install-dir.patch b/vcpkg/ports/llvm/0002-fix-tools-install-dir.patch
new file mode 100644
index 0000000..93d4bb3
--- /dev/null
+++ b/vcpkg/ports/llvm/0002-fix-tools-install-dir.patch
@@ -0,0 +1,201 @@
+ bolt/cmake/modules/AddBOLT.cmake | 2 +-
+ clang-tools-extra/clang-tidy/tool/CMakeLists.txt | 2 +-
+ clang-tools-extra/modularize/CMakeLists.txt | 2 +-
+ clang/cmake/modules/AddClang.cmake | 2 +-
+ clang/tools/c-index-test/CMakeLists.txt | 2 +-
+ clang/tools/clang-format/CMakeLists.txt | 2 +-
+ clang/tools/scan-build-py/CMakeLists.txt | 4 ++--
+ clang/tools/scan-build/CMakeLists.txt | 2 +-
+ clang/tools/scan-view/CMakeLists.txt | 2 +-
+ flang/cmake/modules/AddFlang.cmake | 2 +-
+ flang/tools/f18/CMakeLists.txt | 2 +-
+ flang/tools/flang-driver/CMakeLists.txt | 2 +-
+ lld/cmake/modules/AddLLD.cmake | 2 +-
+ lldb/cmake/modules/AddLLDB.cmake | 2 +-
+ 14 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/bolt/cmake/modules/AddBOLT.cmake b/bolt/cmake/modules/AddBOLT.cmake
+index 1f69b9046320..b0de5186dde4 100644
+--- a/bolt/cmake/modules/AddBOLT.cmake
++++ b/bolt/cmake/modules/AddBOLT.cmake
+@@ -17,7 +17,7 @@ macro(add_bolt_tool name)
+ get_target_export_arg(${name} BOLT export_to_bolttargets)
+ install(TARGETS ${name}
+ ${export_to_bolttargets}
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ RUNTIME DESTINATION "${BOLT_TOOLS_INSTALL_DIR}"
+ COMPONENT bolt)
+
+ if(NOT LLVM_ENABLE_IDE)
+diff --git a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
+index b220cbea80f1..b94501ec82ab 100644
+--- a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
++++ b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
+@@ -65,6 +65,6 @@ install(PROGRAMS clang-tidy-diff.py
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
+ COMPONENT clang-tidy)
+ install(PROGRAMS run-clang-tidy.py
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT clang-tidy
+ RENAME run-clang-tidy)
+diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt
+index eb5383c3ad44..39a34dfe8c71 100644
+--- a/clang-tools-extra/modularize/CMakeLists.txt
++++ b/clang-tools-extra/modularize/CMakeLists.txt
+@@ -27,5 +27,5 @@ clang_target_link_libraries(modularize
+ )
+
+ install(TARGETS modularize
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ RUNTIME DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT clang-extras)
+diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
+index 75b0080f6715..46e32ddbe0cd 100644
+--- a/clang/cmake/modules/AddClang.cmake
++++ b/clang/cmake/modules/AddClang.cmake
+@@ -169,7 +169,7 @@ macro(add_clang_tool name)
+ get_target_export_arg(${name} Clang export_to_clangtargets)
+ install(TARGETS ${name}
+ ${export_to_clangtargets}
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ RUNTIME DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT ${name})
+
+ if(NOT LLVM_ENABLE_IDE)
+diff --git a/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt
+index 0ae1b4e55244..7774cd27afcd 100644
+--- a/clang/tools/c-index-test/CMakeLists.txt
++++ b/clang/tools/c-index-test/CMakeLists.txt
+@@ -49,7 +49,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH
+ "@executable_path/../../lib")
+ else()
+- set(INSTALL_DESTINATION "${CMAKE_INSTALL_BINDIR}")
++ set(INSTALL_DESTINATION "${CLANG_TOOLS_INSTALL_DIR}")
+ endif()
+
+ install(TARGETS c-index-test
+diff --git a/clang/tools/clang-format/CMakeLists.txt b/clang/tools/clang-format/CMakeLists.txt
+index 1c61a3c8fb80..4220d90274bd 100644
+--- a/clang/tools/clang-format/CMakeLists.txt
++++ b/clang/tools/clang-format/CMakeLists.txt
+@@ -36,7 +36,7 @@ install(FILES clang-format.py
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
+ COMPONENT clang-format)
+ install(PROGRAMS git-clang-format
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT clang-format)
+
+ if (WIN32 AND NOT CYGWIN)
+diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt
+index 3aca22c0b0a8..a8283219c99f 100644
+--- a/clang/tools/scan-build-py/CMakeLists.txt
++++ b/clang/tools/scan-build-py/CMakeLists.txt
+@@ -43,7 +43,7 @@ foreach(BinFile ${BinFiles})
+ ${CMAKE_BINARY_DIR}/bin/scan-build-py
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/scan-build)
+ install (PROGRAMS "bin/scan-build"
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ RENAME scan-build-py
+ COMPONENT scan-build-py)
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/scan-build-py)
+@@ -56,7 +56,7 @@ foreach(BinFile ${BinFiles})
+ ${CMAKE_BINARY_DIR}/bin/
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
+ install(PROGRAMS bin/${BinFile}
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT scan-build-py)
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
+ endif()
+diff --git a/clang/tools/scan-build/CMakeLists.txt b/clang/tools/scan-build/CMakeLists.txt
+index ef687b0e90a1..47f31efc9174 100644
+--- a/clang/tools/scan-build/CMakeLists.txt
++++ b/clang/tools/scan-build/CMakeLists.txt
+@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD)
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
+ install(PROGRAMS bin/${BinFile}
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT scan-build)
+ endforeach()
+
+diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt
+index 07aec76ee66f..55a945bb278d 100644
+--- a/clang/tools/scan-view/CMakeLists.txt
++++ b/clang/tools/scan-view/CMakeLists.txt
+@@ -20,7 +20,7 @@ if(CLANG_INSTALL_SCANVIEW)
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
+ install(PROGRAMS bin/${BinFile}
+- DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT scan-view)
+ endforeach()
+
+diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
+index 41ce8738e7bf..d9659c4cf53a 100644
+--- a/flang/cmake/modules/AddFlang.cmake
++++ b/flang/cmake/modules/AddFlang.cmake
+@@ -115,7 +115,7 @@ macro(add_flang_tool name)
+ get_target_export_arg(${name} Flang export_to_flangtargets)
+ install(TARGETS ${name}
+ ${export_to_flangtargets}
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ RUNTIME DESTINATION "${FLANG_TOOLS_INSTALL_DIR}"
+ COMPONENT ${name})
+
+ if(NOT LLVM_ENABLE_IDE)
+diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
+index ba6c6642c0b6..ab2802aeeaaa 100644
+--- a/flang/tools/f18/CMakeLists.txt
++++ b/flang/tools/f18/CMakeLists.txt
+@@ -83,7 +83,7 @@ if (NOT WIN32)
+ @ONLY
+ )
+ add_custom_target(flang-to-external-fc ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc)
+- install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc DESTINATION "${CMAKE_INSTALL_BINDIR}")
++ install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc DESTINATION "${FLANG_TOOLS_INSTALL_DIR}")
+ endif()
+
+ # TODO Move this to a more suitable location
+diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt
+index 3ce8b407450d..6b2e2b0dc33a 100644
+--- a/flang/tools/flang-driver/CMakeLists.txt
++++ b/flang/tools/flang-driver/CMakeLists.txt
+@@ -43,4 +43,4 @@ if(FLANG_PLUGIN_SUPPORT)
+ export_executable_symbols_for_plugins(flang-new)
+ endif()
+
+-install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}")
++install(TARGETS flang-new DESTINATION "${FLANG_TOOLS_INSTALL_DIR}")
+diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
+index 2ee066b41535..c6a4740ab9eb 100644
+--- a/lld/cmake/modules/AddLLD.cmake
++++ b/lld/cmake/modules/AddLLD.cmake
+@@ -56,7 +56,7 @@ macro(add_lld_tool name)
+ get_target_export_arg(${name} LLD export_to_lldtargets)
+ install(TARGETS ${name}
+ ${export_to_lldtargets}
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ RUNTIME DESTINATION "${LLD_TOOLS_INSTALL_DIR}"
+ COMPONENT ${name})
+
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
+index 328e883ddbe5..86eebba45e01 100644
+--- a/lldb/cmake/modules/AddLLDB.cmake
++++ b/lldb/cmake/modules/AddLLDB.cmake
+@@ -221,7 +221,7 @@ function(add_lldb_executable name)
+ endif()
+
+ if(ARG_GENERATE_INSTALL)
+- set(install_dest bin)
++ set(install_dest "${LLVM_TOOLS_INSTALL_DIR}")
+ if(ARG_INSTALL_PREFIX)
+ set(install_dest ${ARG_INSTALL_PREFIX})
+ endif()
diff --git a/vcpkg/ports/llvm/0003-fix-llvm-config.patch b/vcpkg/ports/llvm/0003-fix-llvm-config.patch
new file mode 100644
index 0000000..568cb17
--- /dev/null
+++ b/vcpkg/ports/llvm/0003-fix-llvm-config.patch
@@ -0,0 +1,16 @@
+ llvm/tools/llvm-config/llvm-config.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
+index d5b76b1bb6c1..9fedcb2ab75f 100644
+--- a/llvm/tools/llvm-config/llvm-config.cpp
++++ b/llvm/tools/llvm-config/llvm-config.cpp
+@@ -304,7 +304,7 @@ int main(int argc, char **argv) {
+ // bin dir).
+ sys::fs::make_absolute(CurrentPath);
+ CurrentExecPrefix =
+- sys::path::parent_path(sys::path::parent_path(CurrentPath)).str();
++ sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str();
+
+ // Check to see if we are inside a development tree by comparing to possible
+ // locations (prefix style or CMake style).
diff --git a/vcpkg/ports/llvm/0004-disable-libomp-aliases.patch b/vcpkg/ports/llvm/0004-disable-libomp-aliases.patch
new file mode 100644
index 0000000..6736f2a
--- /dev/null
+++ b/vcpkg/ports/llvm/0004-disable-libomp-aliases.patch
@@ -0,0 +1,32 @@
+ openmp/runtime/src/CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index bb5822264514..340cef14df89 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -215,7 +215,7 @@ endif()
+ set(LIBOMP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
+
+ # Add symbolic links to libomp
+-if(NOT WIN32)
++if(0)
+ add_custom_command(TARGET omp POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${LIBOMP_LIB_FILE}
+ libgomp${LIBOMP_LIBRARY_SUFFIX}
+@@ -367,6 +367,7 @@ if(WIN32)
+ install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+ # Create aliases (regular copies) of the library for backwards compatibility
++ if(0)
+ set(LIBOMP_ALIASES "libiomp5md")
+ foreach(alias IN LISTS LIBOMP_ALIASES)
+ install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
+@@ -375,6 +376,7 @@ if(WIN32)
+ install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
+ \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")")
+ endforeach()
++ endif()
+ else()
+
+ install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
diff --git a/vcpkg/ports/llvm/0005-remove-numpy.patch b/vcpkg/ports/llvm/0005-remove-numpy.patch
new file mode 100644
index 0000000..966af9c
--- /dev/null
+++ b/vcpkg/ports/llvm/0005-remove-numpy.patch
@@ -0,0 +1,16 @@
+ mlir/cmake/modules/MLIRDetectPythonEnv.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
+index 0a486c1bbb54..c07c55b1e17a 100644
+--- a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
++++ b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
+@@ -19,7 +19,7 @@ macro(mlir_configure_python_dev_packages)
+ set(_python_development_component Development.Module)
+
+ find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION}
+- COMPONENTS Interpreter ${_python_development_component} NumPy REQUIRED)
++ COMPONENTS Interpreter ${_python_development_component} REQUIRED)
+ unset(_python_development_component)
+ message(STATUS "Found python include dirs: ${Python3_INCLUDE_DIRS}")
+ message(STATUS "Found python libraries: ${Python3_LIBRARIES}")
diff --git a/vcpkg/ports/llvm/0006-create-destination-mlir-directory.patch b/vcpkg/ports/llvm/0006-create-destination-mlir-directory.patch
new file mode 100644
index 0000000..4950a48
--- /dev/null
+++ b/vcpkg/ports/llvm/0006-create-destination-mlir-directory.patch
@@ -0,0 +1,16 @@
+ mlir/python/CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt
+index 50fbca38a08f..957a6722c21c 100644
+--- a/mlir/python/CMakeLists.txt
++++ b/mlir/python/CMakeLists.txt
+@@ -527,6 +527,8 @@ add_mlir_python_common_capi_library(MLIRPythonCAPI
+ ${_ADDL_TEST_SOURCES}
+ )
+
++file(MAKE_DIRECTORY "${MLIR_BINARY_DIR}/python_packages/mlir_core/mlir/_mlir_libs")
++
+ ################################################################################
+ # Custom targets.
+ ################################################################################
diff --git a/vcpkg/ports/llvm/75711.patch b/vcpkg/ports/llvm/75711.patch
new file mode 100644
index 0000000..15287ef
--- /dev/null
+++ b/vcpkg/ports/llvm/75711.patch
@@ -0,0 +1,1350 @@
+From afec08ef9f1015ea3fe8d67b92acfbb7837c6e9f Mon Sep 17 00:00:00 2001
+From: Max Winkler <max.enrico.winkler@gmail.com>
+Date: Tue, 19 Mar 2024 08:30:54 -0400
+Subject: [PATCH] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by
+ MSVC STL for clang-cl (#75711)
+
+Fixes https://github.com/llvm/llvm-project/issues/53520.
+
+#### Description ####
+
+Provide `intrin0.h` to be the minimal set of intrinsics that the MSVC
+STL requires.
+The `intrin0.h` header matches the latest header provided by MSVC 1939
+which does include some extra intrinsics that the MSVC STL does not use.
+
+Inside `BuiltinHeaders.def` I kept the header description as `intrin.h`.
+If you want me to change those to `intrin0.h` for the moved intrinsics
+let me know.
+
+This should now allow `immintrin.h` to be used with function targets for
+runtime cpu detection of simd instruction sets without worrying about
+the compile-time overhead from MSVC STL including `intrin.h` on clang.
+
+I still need to figure out how to best update MSVC STL to detect for the
+presence of `intrin0.h` from clang and to use this header over
+`intrin.h`.
+
+#### Testing ####
+
+Built clang locally and ran the test suite. I still need to do a pass
+over the existing unit tests for the ms intrinsics to make sure there
+aren't any gaps. Wanted to get this PR up for discussion first.
+
+Modified latest MSVC STL from github to point to `intrin0.h` for clang.
+
+Wrote some test files that included MSVC STL headers that rely on
+intrinsics such as `atomic`, `bit` and `vector`. Built the unit tests
+against x86, arm, aarch64, and x64.
+
+#### Benchmarks ####
+
+The following include times are based on the x64 target with the
+modified headers in this PR.
+These timings were done by using `clang-cl.exe -ftime-trace` and taking
+the wall time for parsing `intrin.h` and `intrin0.h`.
+
+`intrin.h` takes ~897ms to parse.
+`intrin0.h` takes ~1ms to parse.
+
+If there is anything required or a different approach is preferred let
+me know. I would very much like to move this over the finish line so we
+can use function targets with clang-cl.
+---
+ clang/lib/Headers/CMakeLists.txt | 2 +
+ clang/lib/Headers/bmiintrin.h | 6 +-
+ clang/lib/Headers/immintrin.h | 240 ++++++++++-----------------
+ clang/lib/Headers/intrin.h | 217 +-----------------------
+ clang/lib/Headers/intrin0.h | 247 ++++++++++++++++++++++++++++
+ clang/lib/Headers/keylockerintrin.h | 13 +-
+ clang/lib/Headers/x86gprintrin.h | 21 +--
+ clang/lib/Headers/x86intrin.h | 30 ++--
+ clang/lib/Headers/yvals_core.h | 25 +++
+ 10 files changed, 408 insertions(+), 413 deletions(-)
+ create mode 100644 clang/lib/Headers/intrin0.h
+ create mode 100644 clang/lib/Headers/yvals_core.h
+
+diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
+index 902e33bb95897c..97104ccd8db59c 100644
+--- a/clang/lib/Headers/CMakeLists.txt
++++ b/clang/lib/Headers/CMakeLists.txt
+@@ -254,8 +254,10 @@ set(x86_files
+ )
+
+ set(windows_only_files
++ intrin0.h
+ intrin.h
+ vadefs.h
++ yvals_core.h
+ )
+
+ set(utility_files
+diff --git a/clang/lib/Headers/bmiintrin.h b/clang/lib/Headers/bmiintrin.h
+index d8e57c0cb49404..78bffe68e221a9 100644
+--- a/clang/lib/Headers/bmiintrin.h
++++ b/clang/lib/Headers/bmiintrin.h
+@@ -161,8 +161,7 @@ _mm_tzcnt_64(unsigned long long __X)
+
+ #undef __RELAXED_FN_ATTRS
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__BMI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__BMI__)
+
+ /* Define the default attributes for the functions in this file. */
+ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
+@@ -610,7 +609,6 @@ __blsr_u64(unsigned long long __X)
+
+ #undef __DEFAULT_FN_ATTRS
+
+-#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \
+- || defined(__BMI__) */
++#endif /* !defined(__SCE__) || __has_feature(modules) || defined(__BMI__) */
+
+ #endif /* __BMIINTRIN_H */
+diff --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h
+index 27800f7a8202c1..508696d3725b9a 100644
+--- a/clang/lib/Headers/immintrin.h
++++ b/clang/lib/Headers/immintrin.h
+@@ -16,281 +16,239 @@
+
+ #include <x86gprintrin.h>
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__MMX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__MMX__)
+ #include <mmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SSE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SSE__)
+ #include <xmmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SSE2__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SSE2__)
+ #include <emmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SSE3__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SSE3__)
+ #include <pmmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SSSE3__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SSSE3__)
+ #include <tmmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__SSE4_2__) || defined(__SSE4_1__))
+ #include <smmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AES__) || defined(__PCLMUL__))
+ #include <wmmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CLFLUSHOPT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CLFLUSHOPT__)
+ #include <clflushoptintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CLWB__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CLWB__)
+ #include <clwbintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX__)
+ #include <avxintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX2__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX2__)
+ #include <avx2intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__F16C__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__F16C__)
+ #include <f16cintrin.h>
+ #endif
+
+ /* No feature check desired due to internal checks */
+ #include <bmiintrin.h>
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__BMI2__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__BMI2__)
+ #include <bmi2intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__LZCNT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__LZCNT__)
+ #include <lzcntintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__POPCNT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__POPCNT__)
+ #include <popcntintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__FMA__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__FMA__)
+ #include <fmaintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512F__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512F__)
+ #include <avx512fintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512VL__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512VL__)
+ #include <avx512vlintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512BW__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512BW__)
+ #include <avx512bwintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512BITALG__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512BITALG__)
+ #include <avx512bitalgintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512CD__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512CD__)
+ #include <avx512cdintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512VPOPCNTDQ__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512VPOPCNTDQ__)
+ #include <avx512vpopcntdqintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512VPOPCNTDQ__))
+ #include <avx512vpopcntdqvlintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512VNNI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512VNNI__)
+ #include <avx512vnniintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512VNNI__))
+ #include <avx512vlvnniintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVXVNNI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVXVNNI__)
+ #include <avxvnniintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512DQ__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512DQ__)
+ #include <avx512dqintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512BITALG__))
+ #include <avx512vlbitalgintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512BW__))
+ #include <avx512vlbwintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512CD__))
+ #include <avx512vlcdintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512DQ__))
+ #include <avx512vldqintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512ER__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512ER__)
+ #include <avx512erintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512IFMA__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512IFMA__)
+ #include <avx512ifmaintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512IFMA__) && defined(__AVX512VL__))
+ #include <avx512ifmavlintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVXIFMA__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVXIFMA__)
+ #include <avxifmaintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512VBMI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512VBMI__)
+ #include <avx512vbmiintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VBMI__) && defined(__AVX512VL__))
+ #include <avx512vbmivlintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512VBMI2__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512VBMI2__)
+ #include <avx512vbmi2intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VBMI2__) && defined(__AVX512VL__))
+ #include <avx512vlvbmi2intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512PF__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512PF__)
+ #include <avx512pfintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512FP16__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512FP16__)
+ #include <avx512fp16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512FP16__))
+ #include <avx512vlfp16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVX512BF16__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVX512BF16__)
+ #include <avx512bf16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512BF16__))
+ #include <avx512vlbf16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__PKU__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__PKU__)
+ #include <pkuintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__VPCLMULQDQ__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__VPCLMULQDQ__)
+ #include <vpclmulqdqintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__VAES__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__VAES__)
+ #include <vaesintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__GFNI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__GFNI__)
+ #include <gfniintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVXVNNIINT8__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVXVNNIINT8__)
+ #include <avxvnniint8intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVXNECONVERT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVXNECONVERT__)
+ #include <avxneconvertintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SHA512__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SHA512__)
+ #include <sha512intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SM3__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SM3__)
+ #include <sm3intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SM4__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SM4__)
+ #include <sm4intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AVXVNNIINT16__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AVXVNNIINT16__)
+ #include <avxvnniint16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RDPID__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RDPID__)
+ /// Reads the value of the IA32_TSC_AUX MSR (0xc0000103).
+ ///
+ /// \headerfile <immintrin.h>
+@@ -304,8 +262,7 @@ _rdpid_u32(void) {
+ }
+ #endif // __RDPID__
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RDRND__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RDRND__)
+ /// Returns a 16-bit hardware-generated random value.
+ ///
+ /// \headerfile <immintrin.h>
+@@ -367,8 +324,7 @@ _rdrand64_step(unsigned long long *__p)
+ }
+ #endif /* __RDRND__ */
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__FSGSBASE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__FSGSBASE__)
+ #ifdef __x86_64__
+ /// Reads the FS base register.
+ ///
+@@ -481,8 +437,7 @@ _writegsbase_u64(unsigned long long __V)
+ #endif
+ #endif /* __FSGSBASE__ */
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__MOVBE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__MOVBE__)
+
+ /* The structs used below are to force the load/store to be unaligned. This
+ * is accomplished with the __packed__ attribute. The __may_alias__ prevents
+@@ -598,139 +553,118 @@ _storebe_i64(void * __P, long long __D) {
+ #endif
+ #endif /* __MOVBE */
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RTM__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RTM__)
+ #include <rtmintrin.h>
+ #include <xtestintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SHA__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SHA__)
+ #include <shaintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__FXSR__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__FXSR__)
+ #include <fxsrintrin.h>
+ #endif
+
+ /* No feature check desired due to internal MSC_VER checks */
+ #include <xsaveintrin.h>
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__XSAVEOPT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__XSAVEOPT__)
+ #include <xsaveoptintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__XSAVEC__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__XSAVEC__)
+ #include <xsavecintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__XSAVES__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__XSAVES__)
+ #include <xsavesintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SHSTK__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SHSTK__)
+ #include <cetintrin.h>
+ #endif
+
+ /* Intrinsics inside adcintrin.h are available at all times. */
+ #include <adcintrin.h>
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__ADX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__ADX__)
+ #include <adxintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RDSEED__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RDSEED__)
+ #include <rdseedintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__WBNOINVD__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__WBNOINVD__)
+ #include <wbnoinvdintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CLDEMOTE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CLDEMOTE__)
+ #include <cldemoteintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__WAITPKG__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__WAITPKG__)
+ #include <waitpkgintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__MOVDIRI__) || defined(__MOVDIR64B__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__MOVDIRI__) || \
++ defined(__MOVDIR64B__)
+ #include <movdirintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__PCONFIG__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__PCONFIG__)
+ #include <pconfigintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SGX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SGX__)
+ #include <sgxintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__PTWRITE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__PTWRITE__)
+ #include <ptwriteintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__INVPCID__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__INVPCID__)
+ #include <invpcidintrin.h>
+ #endif
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AMX_FP16__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AMX_FP16__)
+ #include <amxfp16intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__KL__) || defined(__WIDEKL__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__KL__) || \
++ defined(__WIDEKL__)
+ #include <keylockerintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AMX_TILE__) || defined(__AMX_INT8__) || defined(__AMX_BF16__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AMX_TILE__) || \
++ defined(__AMX_INT8__) || defined(__AMX_BF16__)
+ #include <amxintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__AMX_COMPLEX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__AMX_COMPLEX__)
+ #include <amxcomplexintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ defined(__AVX512VP2INTERSECT__)
+ #include <avx512vp2intersectintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
++#if !defined(__SCE__) || __has_feature(modules) || \
+ (defined(__AVX512VL__) && defined(__AVX512VP2INTERSECT__))
+ #include <avx512vlvp2intersectintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__ENQCMD__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__ENQCMD__)
+ #include <enqcmdintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SERIALIZE__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SERIALIZE__)
+ #include <serializeintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__TSXLDTRK__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__TSXLDTRK__)
+ #include <tsxldtrkintrin.h>
+ #endif
+
+diff --git a/clang/lib/Headers/intrin.h b/clang/lib/Headers/intrin.h
+index a6395143db54c2..fd27955fbe002d 100644
+--- a/clang/lib/Headers/intrin.h
++++ b/clang/lib/Headers/intrin.h
+@@ -15,6 +15,8 @@
+ #ifndef __INTRIN_H
+ #define __INTRIN_H
+
++#include <intrin0.h>
++
+ /* First include the standard intrinsics. */
+ #if defined(__i386__) || defined(__x86_64__)
+ #include <x86intrin.h>
+@@ -131,8 +133,6 @@ void __writefsqword(unsigned long, unsigned __int64);
+ void __writefsword(unsigned long, unsigned short);
+ void __writemsr(unsigned long, unsigned __int64);
+ void *_AddressOfReturnAddress(void);
+-unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
+-unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);
+ unsigned char _bittest(long const *, long);
+ unsigned char _bittestandcomplement(long *, long);
+ unsigned char _bittestandreset(long *, long);
+@@ -151,7 +151,6 @@ long _InterlockedExchangeAdd_HLERelease(long volatile *, long);
+ __int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64);
+ __int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64);
+ void _ReadBarrier(void);
+-void _ReadWriteBarrier(void);
+ unsigned int _rorx_u32(unsigned int, const unsigned int);
+ int _sarx_i32(int, unsigned int);
+ #if __STDC_HOSTED__
+@@ -182,12 +181,6 @@ unsigned char __readgsbyte(unsigned long);
+ unsigned long __readgsdword(unsigned long);
+ unsigned __int64 __readgsqword(unsigned long);
+ unsigned short __readgsword(unsigned long);
+-unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
+- unsigned __int64 _HighPart,
+- unsigned char _Shift);
+-unsigned __int64 __shiftright128(unsigned __int64 _LowPart,
+- unsigned __int64 _HighPart,
+- unsigned char _Shift);
+ void __stosq(unsigned __int64 *, unsigned __int64, size_t);
+ unsigned char __vmx_on(unsigned __int64 *);
+ unsigned char __vmx_vmclear(unsigned __int64 *);
+@@ -236,212 +229,10 @@ unsigned __int64 _shlx_u64(unsigned __int64, unsigned int);
+ unsigned __int64 _shrx_u64(unsigned __int64, unsigned int);
+ __int64 __mulh(__int64, __int64);
+ unsigned __int64 __umulh(unsigned __int64, unsigned __int64);
+-__int64 _mul128(__int64, __int64, __int64*);
+-unsigned __int64 _umul128(unsigned __int64,
+- unsigned __int64,
+- unsigned __int64*);
++__int64 _mul128(__int64, __int64, __int64 *);
+
+ #endif /* __x86_64__ */
+
+-#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
+-
+-unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
+-unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);
+-
+-#endif
+-
+-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
+-__int64 _InterlockedDecrement64(__int64 volatile *_Addend);
+-__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
+-__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
+-__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);
+-__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
+-__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);
+-
+-#endif
+-
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Exchange Add
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedExchangeAdd8_acq(char volatile *_Addend, char _Value);
+-char _InterlockedExchangeAdd8_nf(char volatile *_Addend, char _Value);
+-char _InterlockedExchangeAdd8_rel(char volatile *_Addend, char _Value);
+-short _InterlockedExchangeAdd16_acq(short volatile *_Addend, short _Value);
+-short _InterlockedExchangeAdd16_nf(short volatile *_Addend, short _Value);
+-short _InterlockedExchangeAdd16_rel(short volatile *_Addend, short _Value);
+-long _InterlockedExchangeAdd_acq(long volatile *_Addend, long _Value);
+-long _InterlockedExchangeAdd_nf(long volatile *_Addend, long _Value);
+-long _InterlockedExchangeAdd_rel(long volatile *_Addend, long _Value);
+-__int64 _InterlockedExchangeAdd64_acq(__int64 volatile *_Addend, __int64 _Value);
+-__int64 _InterlockedExchangeAdd64_nf(__int64 volatile *_Addend, __int64 _Value);
+-__int64 _InterlockedExchangeAdd64_rel(__int64 volatile *_Addend, __int64 _Value);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Increment
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-short _InterlockedIncrement16_acq(short volatile *_Value);
+-short _InterlockedIncrement16_nf(short volatile *_Value);
+-short _InterlockedIncrement16_rel(short volatile *_Value);
+-long _InterlockedIncrement_acq(long volatile *_Value);
+-long _InterlockedIncrement_nf(long volatile *_Value);
+-long _InterlockedIncrement_rel(long volatile *_Value);
+-__int64 _InterlockedIncrement64_acq(__int64 volatile *_Value);
+-__int64 _InterlockedIncrement64_nf(__int64 volatile *_Value);
+-__int64 _InterlockedIncrement64_rel(__int64 volatile *_Value);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Decrement
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-short _InterlockedDecrement16_acq(short volatile *_Value);
+-short _InterlockedDecrement16_nf(short volatile *_Value);
+-short _InterlockedDecrement16_rel(short volatile *_Value);
+-long _InterlockedDecrement_acq(long volatile *_Value);
+-long _InterlockedDecrement_nf(long volatile *_Value);
+-long _InterlockedDecrement_rel(long volatile *_Value);
+-__int64 _InterlockedDecrement64_acq(__int64 volatile *_Value);
+-__int64 _InterlockedDecrement64_nf(__int64 volatile *_Value);
+-__int64 _InterlockedDecrement64_rel(__int64 volatile *_Value);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked And
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedAnd8_acq(char volatile *_Value, char _Mask);
+-char _InterlockedAnd8_nf(char volatile *_Value, char _Mask);
+-char _InterlockedAnd8_rel(char volatile *_Value, char _Mask);
+-short _InterlockedAnd16_acq(short volatile *_Value, short _Mask);
+-short _InterlockedAnd16_nf(short volatile *_Value, short _Mask);
+-short _InterlockedAnd16_rel(short volatile *_Value, short _Mask);
+-long _InterlockedAnd_acq(long volatile *_Value, long _Mask);
+-long _InterlockedAnd_nf(long volatile *_Value, long _Mask);
+-long _InterlockedAnd_rel(long volatile *_Value, long _Mask);
+-__int64 _InterlockedAnd64_acq(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedAnd64_nf(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedAnd64_rel(__int64 volatile *_Value, __int64 _Mask);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Bit Counting and Testing
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-unsigned char _interlockedbittestandset_acq(long volatile *_BitBase,
+- long _BitPos);
+-unsigned char _interlockedbittestandset_nf(long volatile *_BitBase,
+- long _BitPos);
+-unsigned char _interlockedbittestandset_rel(long volatile *_BitBase,
+- long _BitPos);
+-unsigned char _interlockedbittestandreset_acq(long volatile *_BitBase,
+- long _BitPos);
+-unsigned char _interlockedbittestandreset_nf(long volatile *_BitBase,
+- long _BitPos);
+-unsigned char _interlockedbittestandreset_rel(long volatile *_BitBase,
+- long _BitPos);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Or
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedOr8_acq(char volatile *_Value, char _Mask);
+-char _InterlockedOr8_nf(char volatile *_Value, char _Mask);
+-char _InterlockedOr8_rel(char volatile *_Value, char _Mask);
+-short _InterlockedOr16_acq(short volatile *_Value, short _Mask);
+-short _InterlockedOr16_nf(short volatile *_Value, short _Mask);
+-short _InterlockedOr16_rel(short volatile *_Value, short _Mask);
+-long _InterlockedOr_acq(long volatile *_Value, long _Mask);
+-long _InterlockedOr_nf(long volatile *_Value, long _Mask);
+-long _InterlockedOr_rel(long volatile *_Value, long _Mask);
+-__int64 _InterlockedOr64_acq(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedOr64_nf(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedOr64_rel(__int64 volatile *_Value, __int64 _Mask);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Xor
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedXor8_acq(char volatile *_Value, char _Mask);
+-char _InterlockedXor8_nf(char volatile *_Value, char _Mask);
+-char _InterlockedXor8_rel(char volatile *_Value, char _Mask);
+-short _InterlockedXor16_acq(short volatile *_Value, short _Mask);
+-short _InterlockedXor16_nf(short volatile *_Value, short _Mask);
+-short _InterlockedXor16_rel(short volatile *_Value, short _Mask);
+-long _InterlockedXor_acq(long volatile *_Value, long _Mask);
+-long _InterlockedXor_nf(long volatile *_Value, long _Mask);
+-long _InterlockedXor_rel(long volatile *_Value, long _Mask);
+-__int64 _InterlockedXor64_acq(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedXor64_nf(__int64 volatile *_Value, __int64 _Mask);
+-__int64 _InterlockedXor64_rel(__int64 volatile *_Value, __int64 _Mask);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Exchange
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedExchange8_acq(char volatile *_Target, char _Value);
+-char _InterlockedExchange8_nf(char volatile *_Target, char _Value);
+-char _InterlockedExchange8_rel(char volatile *_Target, char _Value);
+-short _InterlockedExchange16_acq(short volatile *_Target, short _Value);
+-short _InterlockedExchange16_nf(short volatile *_Target, short _Value);
+-short _InterlockedExchange16_rel(short volatile *_Target, short _Value);
+-long _InterlockedExchange_acq(long volatile *_Target, long _Value);
+-long _InterlockedExchange_nf(long volatile *_Target, long _Value);
+-long _InterlockedExchange_rel(long volatile *_Target, long _Value);
+-__int64 _InterlockedExchange64_acq(__int64 volatile *_Target, __int64 _Value);
+-__int64 _InterlockedExchange64_nf(__int64 volatile *_Target, __int64 _Value);
+-__int64 _InterlockedExchange64_rel(__int64 volatile *_Target, __int64 _Value);
+-#endif
+-/*----------------------------------------------------------------------------*\
+-|* Interlocked Compare Exchange
+-\*----------------------------------------------------------------------------*/
+-#if defined(__arm__) || defined(__aarch64__)
+-char _InterlockedCompareExchange8_acq(char volatile *_Destination,
+- char _Exchange, char _Comparand);
+-char _InterlockedCompareExchange8_nf(char volatile *_Destination,
+- char _Exchange, char _Comparand);
+-char _InterlockedCompareExchange8_rel(char volatile *_Destination,
+- char _Exchange, char _Comparand);
+-short _InterlockedCompareExchange16_acq(short volatile *_Destination,
+- short _Exchange, short _Comparand);
+-short _InterlockedCompareExchange16_nf(short volatile *_Destination,
+- short _Exchange, short _Comparand);
+-short _InterlockedCompareExchange16_rel(short volatile *_Destination,
+- short _Exchange, short _Comparand);
+-long _InterlockedCompareExchange_acq(long volatile *_Destination,
+- long _Exchange, long _Comparand);
+-long _InterlockedCompareExchange_nf(long volatile *_Destination,
+- long _Exchange, long _Comparand);
+-long _InterlockedCompareExchange_rel(long volatile *_Destination,
+- long _Exchange, long _Comparand);
+-__int64 _InterlockedCompareExchange64_acq(__int64 volatile *_Destination,
+- __int64 _Exchange, __int64 _Comparand);
+-__int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,
+- __int64 _Exchange, __int64 _Comparand);
+-__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
+- __int64 _Exchange, __int64 _Comparand);
+-#endif
+-#if defined(__x86_64__) || defined(__aarch64__)
+-unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
+- __int64 _ExchangeHigh,
+- __int64 _ExchangeLow,
+- __int64 *_ComparandResult);
+-#endif
+-#if defined(__aarch64__)
+-unsigned char _InterlockedCompareExchange128_acq(__int64 volatile *_Destination,
+- __int64 _ExchangeHigh,
+- __int64 _ExchangeLow,
+- __int64 *_ComparandResult);
+-unsigned char _InterlockedCompareExchange128_nf(__int64 volatile *_Destination,
+- __int64 _ExchangeHigh,
+- __int64 _ExchangeLow,
+- __int64 *_ComparandResult);
+-unsigned char _InterlockedCompareExchange128_rel(__int64 volatile *_Destination,
+- __int64 _ExchangeHigh,
+- __int64 _ExchangeLow,
+- __int64 *_ComparandResult);
+-#endif
+-
+ /*----------------------------------------------------------------------------*\
+ |* movs, stos
+ \*----------------------------------------------------------------------------*/
+@@ -583,8 +374,6 @@ unsigned int _CountLeadingOnes(unsigned long);
+ unsigned int _CountLeadingOnes64(unsigned __int64);
+ unsigned int _CountLeadingSigns(long);
+ unsigned int _CountLeadingSigns64(__int64);
+-unsigned int _CountLeadingZeros(unsigned long);
+-unsigned int _CountLeadingZeros64(unsigned _int64);
+ unsigned int _CountOneBits(unsigned long);
+ unsigned int _CountOneBits64(unsigned __int64);
+
+diff --git a/clang/lib/Headers/intrin0.h b/clang/lib/Headers/intrin0.h
+new file mode 100644
+index 00000000000000..31f362ec84d5c5
+--- /dev/null
++++ b/clang/lib/Headers/intrin0.h
+@@ -0,0 +1,247 @@
++/* ===-------- intrin.h ---------------------------------------------------===
++ *
++ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
++ * See https://llvm.org/LICENSE.txt for license information.
++ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
++ *
++ *===-----------------------------------------------------------------------===
++ */
++
++/* Only include this if we're compiling for the windows platform. */
++#ifndef _MSC_VER
++#include_next <intrin0.h>
++#else
++
++#ifndef __INTRIN0_H
++#define __INTRIN0_H
++
++#ifdef __x86_64__
++#include <adcintrin.h>
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
++unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);
++void _ReadWriteBarrier(void);
++
++#if defined(__aarch64__)
++unsigned int _CountLeadingZeros(unsigned long);
++unsigned int _CountLeadingZeros64(unsigned _int64);
++unsigned char _InterlockedCompareExchange128_acq(__int64 volatile *_Destination,
++ __int64 _ExchangeHigh,
++ __int64 _ExchangeLow,
++ __int64 *_ComparandResult);
++unsigned char _InterlockedCompareExchange128_nf(__int64 volatile *_Destination,
++ __int64 _ExchangeHigh,
++ __int64 _ExchangeLow,
++ __int64 *_ComparandResult);
++unsigned char _InterlockedCompareExchange128_rel(__int64 volatile *_Destination,
++ __int64 _ExchangeHigh,
++ __int64 _ExchangeLow,
++ __int64 *_ComparandResult);
++#endif
++
++#ifdef __x86_64__
++unsigned __int64 _umul128(unsigned __int64, unsigned __int64,
++ unsigned __int64 *);
++unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
++ unsigned __int64 _HighPart,
++ unsigned char _Shift);
++unsigned __int64 __shiftright128(unsigned __int64 _LowPart,
++ unsigned __int64 _HighPart,
++ unsigned char _Shift);
++#endif
++
++#if defined(__x86_64__) || defined(__i386__)
++void _mm_pause(void);
++#endif
++
++#if defined(__x86_64__) || defined(__aarch64__)
++unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
++ __int64 _ExchangeHigh,
++ __int64 _ExchangeLow,
++ __int64 *_ComparandResult);
++#endif
++
++#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
++unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
++unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);
++#endif
++
++#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
++ defined(__aarch64__)
++__int64 _InterlockedDecrement64(__int64 volatile *_Addend);
++__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
++__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
++__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);
++__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
++__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);
++#endif
++
++#if defined(__arm__) || defined(__aarch64__)
++/*----------------------------------------------------------------------------*\
++|* Interlocked Exchange Add
++\*----------------------------------------------------------------------------*/
++char _InterlockedExchangeAdd8_acq(char volatile *_Addend, char _Value);
++char _InterlockedExchangeAdd8_nf(char volatile *_Addend, char _Value);
++char _InterlockedExchangeAdd8_rel(char volatile *_Addend, char _Value);
++short _InterlockedExchangeAdd16_acq(short volatile *_Addend, short _Value);
++short _InterlockedExchangeAdd16_nf(short volatile *_Addend, short _Value);
++short _InterlockedExchangeAdd16_rel(short volatile *_Addend, short _Value);
++long _InterlockedExchangeAdd_acq(long volatile *_Addend, long _Value);
++long _InterlockedExchangeAdd_nf(long volatile *_Addend, long _Value);
++long _InterlockedExchangeAdd_rel(long volatile *_Addend, long _Value);
++__int64 _InterlockedExchangeAdd64_acq(__int64 volatile *_Addend,
++ __int64 _Value);
++__int64 _InterlockedExchangeAdd64_nf(__int64 volatile *_Addend, __int64 _Value);
++__int64 _InterlockedExchangeAdd64_rel(__int64 volatile *_Addend,
++ __int64 _Value);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Increment
++\*----------------------------------------------------------------------------*/
++short _InterlockedIncrement16_acq(short volatile *_Value);
++short _InterlockedIncrement16_nf(short volatile *_Value);
++short _InterlockedIncrement16_rel(short volatile *_Value);
++long _InterlockedIncrement_acq(long volatile *_Value);
++long _InterlockedIncrement_nf(long volatile *_Value);
++long _InterlockedIncrement_rel(long volatile *_Value);
++__int64 _InterlockedIncrement64_acq(__int64 volatile *_Value);
++__int64 _InterlockedIncrement64_nf(__int64 volatile *_Value);
++__int64 _InterlockedIncrement64_rel(__int64 volatile *_Value);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Decrement
++\*----------------------------------------------------------------------------*/
++short _InterlockedDecrement16_acq(short volatile *_Value);
++short _InterlockedDecrement16_nf(short volatile *_Value);
++short _InterlockedDecrement16_rel(short volatile *_Value);
++long _InterlockedDecrement_acq(long volatile *_Value);
++long _InterlockedDecrement_nf(long volatile *_Value);
++long _InterlockedDecrement_rel(long volatile *_Value);
++__int64 _InterlockedDecrement64_acq(__int64 volatile *_Value);
++__int64 _InterlockedDecrement64_nf(__int64 volatile *_Value);
++__int64 _InterlockedDecrement64_rel(__int64 volatile *_Value);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked And
++\*----------------------------------------------------------------------------*/
++char _InterlockedAnd8_acq(char volatile *_Value, char _Mask);
++char _InterlockedAnd8_nf(char volatile *_Value, char _Mask);
++char _InterlockedAnd8_rel(char volatile *_Value, char _Mask);
++short _InterlockedAnd16_acq(short volatile *_Value, short _Mask);
++short _InterlockedAnd16_nf(short volatile *_Value, short _Mask);
++short _InterlockedAnd16_rel(short volatile *_Value, short _Mask);
++long _InterlockedAnd_acq(long volatile *_Value, long _Mask);
++long _InterlockedAnd_nf(long volatile *_Value, long _Mask);
++long _InterlockedAnd_rel(long volatile *_Value, long _Mask);
++__int64 _InterlockedAnd64_acq(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedAnd64_nf(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedAnd64_rel(__int64 volatile *_Value, __int64 _Mask);
++
++/*----------------------------------------------------------------------------*\
++|* Bit Counting and Testing
++\*----------------------------------------------------------------------------*/
++unsigned char _interlockedbittestandset_acq(long volatile *_BitBase,
++ long _BitPos);
++unsigned char _interlockedbittestandset_nf(long volatile *_BitBase,
++ long _BitPos);
++unsigned char _interlockedbittestandset_rel(long volatile *_BitBase,
++ long _BitPos);
++unsigned char _interlockedbittestandreset_acq(long volatile *_BitBase,
++ long _BitPos);
++unsigned char _interlockedbittestandreset_nf(long volatile *_BitBase,
++ long _BitPos);
++unsigned char _interlockedbittestandreset_rel(long volatile *_BitBase,
++ long _BitPos);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Or
++\*----------------------------------------------------------------------------*/
++char _InterlockedOr8_acq(char volatile *_Value, char _Mask);
++char _InterlockedOr8_nf(char volatile *_Value, char _Mask);
++char _InterlockedOr8_rel(char volatile *_Value, char _Mask);
++short _InterlockedOr16_acq(short volatile *_Value, short _Mask);
++short _InterlockedOr16_nf(short volatile *_Value, short _Mask);
++short _InterlockedOr16_rel(short volatile *_Value, short _Mask);
++long _InterlockedOr_acq(long volatile *_Value, long _Mask);
++long _InterlockedOr_nf(long volatile *_Value, long _Mask);
++long _InterlockedOr_rel(long volatile *_Value, long _Mask);
++__int64 _InterlockedOr64_acq(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedOr64_nf(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedOr64_rel(__int64 volatile *_Value, __int64 _Mask);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Xor
++\*----------------------------------------------------------------------------*/
++char _InterlockedXor8_acq(char volatile *_Value, char _Mask);
++char _InterlockedXor8_nf(char volatile *_Value, char _Mask);
++char _InterlockedXor8_rel(char volatile *_Value, char _Mask);
++short _InterlockedXor16_acq(short volatile *_Value, short _Mask);
++short _InterlockedXor16_nf(short volatile *_Value, short _Mask);
++short _InterlockedXor16_rel(short volatile *_Value, short _Mask);
++long _InterlockedXor_acq(long volatile *_Value, long _Mask);
++long _InterlockedXor_nf(long volatile *_Value, long _Mask);
++long _InterlockedXor_rel(long volatile *_Value, long _Mask);
++__int64 _InterlockedXor64_acq(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedXor64_nf(__int64 volatile *_Value, __int64 _Mask);
++__int64 _InterlockedXor64_rel(__int64 volatile *_Value, __int64 _Mask);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Exchange
++\*----------------------------------------------------------------------------*/
++char _InterlockedExchange8_acq(char volatile *_Target, char _Value);
++char _InterlockedExchange8_nf(char volatile *_Target, char _Value);
++char _InterlockedExchange8_rel(char volatile *_Target, char _Value);
++short _InterlockedExchange16_acq(short volatile *_Target, short _Value);
++short _InterlockedExchange16_nf(short volatile *_Target, short _Value);
++short _InterlockedExchange16_rel(short volatile *_Target, short _Value);
++long _InterlockedExchange_acq(long volatile *_Target, long _Value);
++long _InterlockedExchange_nf(long volatile *_Target, long _Value);
++long _InterlockedExchange_rel(long volatile *_Target, long _Value);
++__int64 _InterlockedExchange64_acq(__int64 volatile *_Target, __int64 _Value);
++__int64 _InterlockedExchange64_nf(__int64 volatile *_Target, __int64 _Value);
++__int64 _InterlockedExchange64_rel(__int64 volatile *_Target, __int64 _Value);
++
++/*----------------------------------------------------------------------------*\
++|* Interlocked Compare Exchange
++\*----------------------------------------------------------------------------*/
++char _InterlockedCompareExchange8_acq(char volatile *_Destination,
++ char _Exchange, char _Comparand);
++char _InterlockedCompareExchange8_nf(char volatile *_Destination,
++ char _Exchange, char _Comparand);
++char _InterlockedCompareExchange8_rel(char volatile *_Destination,
++ char _Exchange, char _Comparand);
++short _InterlockedCompareExchange16_acq(short volatile *_Destination,
++ short _Exchange, short _Comparand);
++short _InterlockedCompareExchange16_nf(short volatile *_Destination,
++ short _Exchange, short _Comparand);
++short _InterlockedCompareExchange16_rel(short volatile *_Destination,
++ short _Exchange, short _Comparand);
++long _InterlockedCompareExchange_acq(long volatile *_Destination,
++ long _Exchange, long _Comparand);
++long _InterlockedCompareExchange_nf(long volatile *_Destination, long _Exchange,
++ long _Comparand);
++long _InterlockedCompareExchange_rel(long volatile *_Destination,
++ long _Exchange, long _Comparand);
++__int64 _InterlockedCompareExchange64_acq(__int64 volatile *_Destination,
++ __int64 _Exchange,
++ __int64 _Comparand);
++__int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,
++ __int64 _Exchange, __int64 _Comparand);
++__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
++ __int64 _Exchange,
++ __int64 _Comparand);
++#endif
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* __INTRIN0_H */
++#endif /* _MSC_VER */
+diff --git a/clang/lib/Headers/keylockerintrin.h b/clang/lib/Headers/keylockerintrin.h
+index 1994ac42070ad3..f76e91b4d4b306 100644
+--- a/clang/lib/Headers/keylockerintrin.h
++++ b/clang/lib/Headers/keylockerintrin.h
+@@ -28,8 +28,7 @@
+ #ifndef _KEYLOCKERINTRIN_H
+ #define _KEYLOCKERINTRIN_H
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__KL__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__KL__)
+
+ /* Define the default attributes for the functions in this file. */
+ #define __DEFAULT_FN_ATTRS \
+@@ -327,11 +326,9 @@ _mm_aesdec256kl_u8(__m128i* __odata, __m128i __idata, const void *__h) {
+
+ #undef __DEFAULT_FN_ATTRS
+
+-#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \
+- || defined(__KL__) */
++#endif /* !defined(__SCE__ || __has_feature(modules) || defined(__KL__) */
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__WIDEKL__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__WIDEKL__)
+
+ /* Define the default attributes for the functions in this file. */
+ #define __DEFAULT_FN_ATTRS \
+@@ -524,7 +521,7 @@ _mm_aesdecwide256kl_u8(__m128i __odata[8], const __m128i __idata[8], const void*
+
+ #undef __DEFAULT_FN_ATTRS
+
+-#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \
+- || defined(__WIDEKL__) */
++#endif /* !defined(__SCE__) || __has_feature(modules) || defined(__WIDEKL__) \
++ */
+
+ #endif /* _KEYLOCKERINTRIN_H */
+diff --git a/clang/lib/Headers/x86gprintrin.h b/clang/lib/Headers/x86gprintrin.h
+index ed141879fbc744..3d5cc606d7e63d 100644
+--- a/clang/lib/Headers/x86gprintrin.h
++++ b/clang/lib/Headers/x86gprintrin.h
+@@ -10,38 +10,31 @@
+ #ifndef __X86GPRINTRIN_H
+ #define __X86GPRINTRIN_H
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__HRESET__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__HRESET__)
+ #include <hresetintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__UINTR__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__UINTR__)
+ #include <uintrintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__USERMSR__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__USERMSR__)
+ #include <usermsrintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CRC32__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CRC32__)
+ #include <crc32intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__PRFCHI__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__PRFCHI__)
+ #include <prfchiintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RAOINT__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RAOINT__)
+ #include <raointintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CMPCCXADD__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CMPCCXADD__)
+ #include <cmpccxaddintrin.h>
+ #endif
+
+diff --git a/clang/lib/Headers/x86intrin.h b/clang/lib/Headers/x86intrin.h
+index 450fd008dab95b..c20bfbb8fe46e2 100644
+--- a/clang/lib/Headers/x86intrin.h
++++ b/clang/lib/Headers/x86intrin.h
+@@ -14,53 +14,43 @@
+
+ #include <immintrin.h>
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__3dNOW__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__3dNOW__)
+ #include <mm3dnow.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__PRFCHW__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__PRFCHW__)
+ #include <prfchwintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__SSE4A__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__SSE4A__)
+ #include <ammintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__FMA4__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__FMA4__)
+ #include <fma4intrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__XOP__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__XOP__)
+ #include <xopintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__TBM__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__TBM__)
+ #include <tbmintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__LWP__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__LWP__)
+ #include <lwpintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__MWAITX__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__MWAITX__)
+ #include <mwaitxintrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__CLZERO__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__CLZERO__)
+ #include <clzerointrin.h>
+ #endif
+
+-#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
+- defined(__RDPRU__)
++#if !defined(__SCE__) || __has_feature(modules) || defined(__RDPRU__)
+ #include <rdpruintrin.h>
+ #endif
+
+diff --git a/clang/lib/Headers/yvals_core.h b/clang/lib/Headers/yvals_core.h
+new file mode 100644
+index 00000000000000..5ee194a3e5f5f6
+--- /dev/null
++++ b/clang/lib/Headers/yvals_core.h
+@@ -0,0 +1,25 @@
++//===----- yvals_core.h - Internal MSVC STL core header -------------------===//
++//
++// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
++// See https://llvm.org/LICENSE.txt for license information.
++// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
++//
++//===----------------------------------------------------------------------===//
++
++// Only include this if we are aiming for MSVC compatibility.
++#ifndef _MSC_VER
++#include_next <yvals_core.h>
++#else
++
++#ifndef __clang_yvals_core_h
++#define __clang_yvals_core_h
++
++#include_next <yvals_core.h>
++
++#ifdef _STL_INTRIN_HEADER
++#undef _STL_INTRIN_HEADER
++#define _STL_INTRIN_HEADER <intrin0.h>
++#endif
++
++#endif
++#endif
diff --git a/vcpkg/ports/llvm/79694.patch b/vcpkg/ports/llvm/79694.patch
new file mode 100644
index 0000000..702b89a
--- /dev/null
+++ b/vcpkg/ports/llvm/79694.patch
@@ -0,0 +1,217 @@
+From 48908fb6d5387082018fb1d8b2f0ddb65e2e2baa Mon Sep 17 00:00:00 2001
+From: Phoebe Wang <phoebe.wang@intel.com>
+Date: Sat, 27 Jan 2024 22:03:06 +0800
+Subject: [PATCH 1/2] [SEH] Ignore EH pad check for internal intrinsics
+
+Intrinsics like @llvm.seh.scope.begin and @llvm.seh.scope.end which do not throw do not need funclets in catchpads or cleanuppads.
+
+Fixes #69428
+
+Co-authored-by: Robert Cox <robert.cox@intel.com>
+---
+ llvm/lib/IR/Verifier.cpp | 5 +++
+ llvm/test/Verifier/pr69428.ll | 80 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 85 insertions(+)
+ create mode 100644 llvm/test/Verifier/pr69428.ll
+
+diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
+index 91cf91fbc788bd..0f1e9fa40c9b03 100644
+--- a/llvm/lib/IR/Verifier.cpp
++++ b/llvm/lib/IR/Verifier.cpp
+@@ -4280,6 +4280,11 @@ void Verifier::visitEHPadPredecessors(Instruction &I) {
+ if (auto *II = dyn_cast<InvokeInst>(TI)) {
+ Check(II->getUnwindDest() == BB && II->getNormalDest() != BB,
+ "EH pad must be jumped to via an unwind edge", ToPad, II);
++ auto *CalledFn =
++ dyn_cast<Function>(II->getCalledOperand()->stripPointerCasts());
++ if (CalledFn && CalledFn->isIntrinsic() && II->doesNotThrow() &&
++ !IntrinsicInst::mayLowerToFunctionCall(CalledFn->getIntrinsicID()))
++ continue;
+ if (auto Bundle = II->getOperandBundle(LLVMContext::OB_funclet))
+ FromPad = Bundle->Inputs[0];
+ else
+diff --git a/llvm/test/Verifier/pr69428.ll b/llvm/test/Verifier/pr69428.ll
+new file mode 100644
+index 00000000000000..22d732076e3af7
+--- /dev/null
++++ b/llvm/test/Verifier/pr69428.ll
+@@ -0,0 +1,80 @@
++; RUN: llvm-as -disable-output %s
++
++%struct._List_node_emplace_op2 = type { i8 }
++
++$"??1?$_List_node_emplace_op2@H@@QEAA@XZ" = comdat any
++
++@"?_List@@3HA" = dso_local local_unnamed_addr global i32 0, align 4
++
++; Function Attrs: mustprogress noreturn
++define dso_local void @"?ExecutionEngineaddExecutableDependency@@YAXXZ"() local_unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
++entry:
++ %agg.tmp.ensured.i = alloca %struct._List_node_emplace_op2, align 1
++ call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %agg.tmp.ensured.i)
++ %0 = load i32, ptr @"?_List@@3HA", align 4
++ %call.i = call noundef ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i, i32 noundef %0)
++ invoke void @llvm.seh.scope.begin()
++ to label %invoke.cont.i unwind label %ehcleanup.i
++
++invoke.cont.i: ; preds = %entry
++ invoke void @llvm.seh.scope.end()
++ to label %invoke.cont2.i unwind label %ehcleanup.i
++
++invoke.cont2.i: ; preds = %invoke.cont.i
++ call void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6
++ unreachable
++
++ehcleanup.i: ; preds = %invoke.cont.i, %entry
++ %1 = cleanuppad within none []
++ invoke void @llvm.seh.scope.begin()
++ to label %invoke.cont.i.i unwind label %ehcleanup.i.i
++
++invoke.cont.i.i: ; preds = %ehcleanup.i
++ invoke void @llvm.seh.scope.end()
++ to label %"??1?$_List_node_emplace_op2@H@@QEAA@XZ.exit.i" unwind label %ehcleanup.i.i
++
++ehcleanup.i.i: ; preds = %invoke.cont.i.i, %ehcleanup.i
++ %2 = cleanuppad within %1 []
++ call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6 [ "funclet"(token %2) ]
++ cleanupret from %2 unwind to caller
++
++"??1?$_List_node_emplace_op2@H@@QEAA@XZ.exit.i": ; preds = %invoke.cont.i.i
++ call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6 [ "funclet"(token %1) ]
++ cleanupret from %1 unwind to caller
++}
++
++declare dso_local noundef ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr noundef nonnull returned align 1 dereferenceable(1), i32 noundef) unnamed_addr #1
++
++declare dso_local i32 @__CxxFrameHandler3(...)
++
++; Function Attrs: nofree nosync nounwind memory(none)
++declare dso_local void @llvm.seh.scope.begin() #2
++
++; Function Attrs: nofree nosync nounwind memory(none)
++declare dso_local void @llvm.seh.scope.end() #2
++
++; Function Attrs: mustprogress nounwind
++define linkonce_odr dso_local void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 personality ptr @__CxxFrameHandler3 {
++entry:
++ invoke void @llvm.seh.scope.begin()
++ to label %invoke.cont unwind label %ehcleanup
++
++invoke.cont: ; preds = %entry
++ invoke void @llvm.seh.scope.end()
++ to label %invoke.cont2 unwind label %ehcleanup
++
++invoke.cont2: ; preds = %invoke.cont
++ tail call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) #6
++ ret void
++
++ehcleanup: ; preds = %invoke.cont, %entry
++ %0 = cleanuppad within none []
++ call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) #6 [ "funclet"(token %0) ]
++ cleanupret from %0 unwind to caller
++}
++
++; Function Attrs: nounwind
++declare dso_local void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
++
++; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
++declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #5
+
+From a9ea5c30d2fe81ed8774812bf13700c6a81e4900 Mon Sep 17 00:00:00 2001
+From: Phoebe Wang <phoebe.wang@intel.com>
+Date: Fri, 2 Feb 2024 20:19:50 +0800
+Subject: [PATCH 2/2] Simplify test case
+
+---
+ llvm/test/Verifier/pr69428.ll | 56 ++++++++---------------------------
+ 1 file changed, 12 insertions(+), 44 deletions(-)
+
+diff --git a/llvm/test/Verifier/pr69428.ll b/llvm/test/Verifier/pr69428.ll
+index 22d732076e3af7..be8733bea1ab39 100644
+--- a/llvm/test/Verifier/pr69428.ll
++++ b/llvm/test/Verifier/pr69428.ll
+@@ -2,17 +2,13 @@
+
+ %struct._List_node_emplace_op2 = type { i8 }
+
+-$"??1?$_List_node_emplace_op2@H@@QEAA@XZ" = comdat any
++@"?_List@@3HA" = global i32 0, align 4
+
+-@"?_List@@3HA" = dso_local local_unnamed_addr global i32 0, align 4
+-
+-; Function Attrs: mustprogress noreturn
+-define dso_local void @"?ExecutionEngineaddExecutableDependency@@YAXXZ"() local_unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
++define void @"?ExecutionEngineaddExecutableDependency@@YAXXZ"() personality ptr @__CxxFrameHandler3 {
+ entry:
+ %agg.tmp.ensured.i = alloca %struct._List_node_emplace_op2, align 1
+- call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %agg.tmp.ensured.i)
+ %0 = load i32, ptr @"?_List@@3HA", align 4
+- %call.i = call noundef ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i, i32 noundef %0)
++ %call.i = call noundef ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr %agg.tmp.ensured.i, i32 %0)
+ invoke void @llvm.seh.scope.begin()
+ to label %invoke.cont.i unwind label %ehcleanup.i
+
+@@ -21,7 +17,7 @@ invoke.cont.i: ; preds = %entry
+ to label %invoke.cont2.i unwind label %ehcleanup.i
+
+ invoke.cont2.i: ; preds = %invoke.cont.i
+- call void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6
++ call void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr %agg.tmp.ensured.i) #6
+ unreachable
+
+ ehcleanup.i: ; preds = %invoke.cont.i, %entry
+@@ -35,46 +31,18 @@ invoke.cont.i.i: ; preds = %ehcleanup.i
+
+ ehcleanup.i.i: ; preds = %invoke.cont.i.i, %ehcleanup.i
+ %2 = cleanuppad within %1 []
+- call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6 [ "funclet"(token %2) ]
++ call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr %agg.tmp.ensured.i) #6 [ "funclet"(token %2) ]
+ cleanupret from %2 unwind to caller
+
+ "??1?$_List_node_emplace_op2@H@@QEAA@XZ.exit.i": ; preds = %invoke.cont.i.i
+- call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp.ensured.i) #6 [ "funclet"(token %1) ]
++ call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr %agg.tmp.ensured.i) #6 [ "funclet"(token %1) ]
+ cleanupret from %1 unwind to caller
+ }
+
+-declare dso_local noundef ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr noundef nonnull returned align 1 dereferenceable(1), i32 noundef) unnamed_addr #1
+-
+-declare dso_local i32 @__CxxFrameHandler3(...)
+-
+-; Function Attrs: nofree nosync nounwind memory(none)
+-declare dso_local void @llvm.seh.scope.begin() #2
+-
+-; Function Attrs: nofree nosync nounwind memory(none)
+-declare dso_local void @llvm.seh.scope.end() #2
+-
+-; Function Attrs: mustprogress nounwind
+-define linkonce_odr dso_local void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 personality ptr @__CxxFrameHandler3 {
+-entry:
+- invoke void @llvm.seh.scope.begin()
+- to label %invoke.cont unwind label %ehcleanup
+-
+-invoke.cont: ; preds = %entry
+- invoke void @llvm.seh.scope.end()
+- to label %invoke.cont2 unwind label %ehcleanup
+-
+-invoke.cont2: ; preds = %invoke.cont
+- tail call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) #6
+- ret void
+-
+-ehcleanup: ; preds = %invoke.cont, %entry
+- %0 = cleanuppad within none []
+- call void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1) %this) #6 [ "funclet"(token %0) ]
+- cleanupret from %0 unwind to caller
+-}
+-
+-; Function Attrs: nounwind
+-declare dso_local void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
++declare i32 @__CxxFrameHandler3(...)
++declare void @llvm.seh.scope.begin()
++declare void @llvm.seh.scope.end()
+
+-; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
+-declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #5
++declare void @"??1?$_List_node_emplace_op2@H@@QEAA@XZ"(ptr)
++declare void @"??1_Alloc_construct_ptr@@QEAA@XZ"(ptr)
++declare ptr @"??0?$_List_node_emplace_op2@H@@QEAA@H@Z"(ptr, i32)
diff --git a/vcpkg/ports/llvm/82407.patch b/vcpkg/ports/llvm/82407.patch
new file mode 100644
index 0000000..c51086b
--- /dev/null
+++ b/vcpkg/ports/llvm/82407.patch
@@ -0,0 +1,112 @@
+From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001
+From: Shafik Yaghmour <shafik.yaghmour@intel.com>
+Date: Tue, 20 Feb 2024 11:22:39 -0800
+Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of
+ union with nontrivial member
+
+In 765d8a192180f8f33618087b15c022fe758044af we impelemented a fix for incorrect deletion of
+default constructors in unions. This fix missed a case and so this PR will
+extend the fix to cover the additional case.
+
+Fixes: https://github.com/llvm/llvm-project/issues/81774
+---
+ clang/lib/Sema/SemaDeclCXX.cpp | 18 +++++++++++++++---
+ .../test/CodeGen/union-non-trivial-member.cpp | 17 +++++++++++++++++
+ clang/test/SemaCXX/cxx0x-nontrivial-union.cpp | 11 +++++++++++
+ 4 files changed, 46 insertions(+), 3 deletions(-)
+
+ Bug Fixes to AST Handling
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
+diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
+index 79263bc3ff671..25a4b4381ca25 100644
+--- a/clang/lib/Sema/SemaDeclCXX.cpp
++++ b/clang/lib/Sema/SemaDeclCXX.cpp
+@@ -9442,9 +9442,21 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(
+
+ int DiagKind = -1;
+
+- if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted)
+- DiagKind = !Decl ? 0 : 1;
+- else if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::Ambiguous)
++ if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted) {
++ if (CSM == Sema::CXXDefaultConstructor && Field &&
++ Field->getParent()->isUnion()) {
++ // [class.default.ctor]p2:
++ // A defaulted default constructor for class X is defined as deleted if
++ // - X is a union that has a variant member with a non-trivial default
++ // constructor and no variant member of X has a default member
++ // initializer
++ const auto *RD = cast<CXXRecordDecl>(Field->getParent());
++ if (!RD->hasInClassInitializer())
++ DiagKind = !Decl ? 0 : 1;
++ } else {
++ DiagKind = !Decl ? 0 : 1;
++ }
++ } else if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::Ambiguous)
+ DiagKind = 2;
+ else if (!isAccessible(Subobj, Decl))
+ DiagKind = 3;
+diff --git a/clang/test/CodeGen/union-non-trivial-member.cpp b/clang/test/CodeGen/union-non-trivial-member.cpp
+index fdc9fd16911e1..8b055a9970fc7 100644
+--- a/clang/test/CodeGen/union-non-trivial-member.cpp
++++ b/clang/test/CodeGen/union-non-trivial-member.cpp
+@@ -15,14 +15,25 @@ union UnionNonTrivial {
+ non_trivial_constructor b{};
+ };
+
++struct Handle {
++ Handle(int) {}
++};
++
++union UnionNonTrivialEqualInit {
++ int NoState = 0;
++ Handle CustomState;
++};
++
+ void f() {
+ UnionInt u1;
+ UnionNonTrivial u2;
++ UnionNonTrivialEqualInit u3;
+ }
+
+ // CHECK: define dso_local void @_Z1fv()
+ // CHECK: call void @_ZN8UnionIntC1Ev
+ // CHECK-NEXT: call void @_ZN15UnionNonTrivialC1Ev
++// CHECK-NEXT: call void @_ZN24UnionNonTrivialEqualInitC1Ev
+
+ // CHECK: define {{.*}}void @_ZN8UnionIntC1Ev
+ // CHECK: call void @_ZN8UnionIntC2Ev
+@@ -30,8 +41,14 @@ void f() {
+ // CHECK: define {{.*}}void @_ZN15UnionNonTrivialC1Ev
+ // CHECK: call void @_ZN15UnionNonTrivialC2Ev
+
++// CHECK: define {{.*}}void @_ZN24UnionNonTrivialEqualInitC1Ev
++// CHECK: call void @_ZN24UnionNonTrivialEqualInitC2Ev
++
+ // CHECK: define {{.*}}void @_ZN8UnionIntC2Ev
+ // CHECK: store i32 1000
+
+ // CHECK: define {{.*}}void @_ZN15UnionNonTrivialC2Ev
+ // CHECK: call void @_ZN23non_trivial_constructorC1Ev
++
++// CHECK: define {{.*}}void @_ZN24UnionNonTrivialEqualInitC2Ev
++// CHECK: store i32 0
+diff --git a/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp b/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp
+index c7cdf76d850db..833642b3d739a 100644
+--- a/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp
++++ b/clang/test/SemaCXX/cxx0x-nontrivial-union.cpp
+@@ -188,3 +188,14 @@ static_assert(U2().b.x == 100, "");
+ static_assert(U3().b.x == 100, "");
+
+ } // namespace GH48416
++
++namespace GH81774 {
++struct Handle {
++ Handle(int) {}
++};
++// Should be well-formed because NoState has a brace-or-equal-initializer.
++union a {
++ int NoState = 0;
++ Handle CustomState;
++} b;
++} // namespace GH81774
diff --git a/vcpkg/ports/llvm/add-include-chrono.patch b/vcpkg/ports/llvm/add-include-chrono.patch
new file mode 100644
index 0000000..839920a
--- /dev/null
+++ b/vcpkg/ports/llvm/add-include-chrono.patch
@@ -0,0 +1,12 @@
+diff --git a/lldb/tools/lldb-dap/ProgressEvent.h b/lldb/tools/lldb-dap/ProgressEvent.h
+index dac2197..72317b8 100644
+--- a/lldb/tools/lldb-dap/ProgressEvent.h
++++ b/lldb/tools/lldb-dap/ProgressEvent.h
+@@ -7,6 +7,7 @@
+ //===----------------------------------------------------------------------===//
+
+ #include <atomic>
++#include <chrono>
+ #include <mutex>
+ #include <optional>
+ #include <queue>
diff --git a/vcpkg/ports/llvm/clang_usage b/vcpkg/ports/llvm/clang_usage
new file mode 100644
index 0000000..f239721
--- /dev/null
+++ b/vcpkg/ports/llvm/clang_usage
@@ -0,0 +1,5 @@
+The package clang provides CMake targets:
+
+ find_package(Clang CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${CLANG_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE clangBasic clangLex clangParse clangAST ...)
diff --git a/vcpkg/ports/llvm/cmake4.patch b/vcpkg/ports/llvm/cmake4.patch
new file mode 100644
index 0000000..984981e
--- /dev/null
+++ b/vcpkg/ports/llvm/cmake4.patch
@@ -0,0 +1,117 @@
+diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake
+index 6865f45175..33dda44d18 100644
+--- a/cmake/Modules/HandleCompilerRT.cmake
++++ b/cmake/Modules/HandleCompilerRT.cmake
+@@ -20,25 +20,25 @@ function(get_component_name name variable)
+ if(NOT name MATCHES "builtins.*")
+ set(component_name "${name}_")
+ endif()
+- if (CMAKE_OSX_SYSROOT MATCHES ".+MacOSX.+")
++ if (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+MacOSX.+")
+ set(component_name "${component_name}osx")
+
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+iPhoneOS.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+iPhoneOS.+")
+ set(component_name "${component_name}ios")
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+iPhoneSimulator.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+iPhoneSimulator.+")
+ set(component_name "${component_name}iossim")
+
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+AppleTVOS.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+AppleTVOS.+")
+ set(component_name "${component_name}tvos")
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+AppleTVSimulator.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+AppleTVSimulator.+")
+ set(component_name "${component_name}tvossim")
+
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+WatchOS.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+WatchOS.+")
+ set(component_name "${component_name}watchos")
+- elseif (CMAKE_OSX_SYSROOT MATCHES ".+WatchSimulator.+")
++ elseif (_CMAKE_OSX_SYSROOT_PATH MATCHES ".+WatchSimulator.+")
+ set(component_name "${component_name}watchossim")
+ else()
+- message(WARNING "Unknown Apple SDK ${CMAKE_OSX_SYSROOT}, we don't know which compiler-rt library suffix to use.")
++ message(WARNING "Unknown Apple SDK ${_CMAKE_OSX_SYSROOT_PATH}, we don't know which compiler-rt library suffix to use.")
+ endif()
+ else()
+ set(component_name "${name}")
+diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
+index f4722c3b35..a553615ebc 100644
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -134,7 +134,7 @@ if ( APPLE )
+ # Make sure we link in CrashReporterClient if we find it -- it's used by
+ # abort() on Apple platforms when building the system dylib.
+ find_library(CrashReporterClient NAMES libCrashReporterClient.a
+- PATHS "${CMAKE_OSX_SYSROOT}/usr/local/lib")
++ PATHS "${_CMAKE_OSX_SYSROOT_PATH}/usr/local/lib")
+ if (CrashReporterClient)
+ message(STATUS "Linking with CrashReporterClient at ${CrashReporterClient}")
+ add_library_flags("${CrashReporterClient}")
+diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
+index f0b9756bec..0c784545c4 100644
+--- a/lldb/tools/debugserver/source/CMakeLists.txt
++++ b/lldb/tools/debugserver/source/CMakeLists.txt
+@@ -125,17 +125,17 @@ if(APPLE)
+ set(LIBCOMPRESSION compression)
+ if(APPLE_EMBEDDED)
+ find_library(BACKBOARD_LIBRARY BackBoardServices
+- PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
++ PATHS ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks)
+ find_library(FRONTBOARD_LIBRARY FrontBoardServices
+- PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
++ PATHS ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks)
+ find_library(SPRINGBOARD_LIBRARY SpringBoardServices
+- PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
++ PATHS ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks)
+ find_library(MOBILESERVICES_LIBRARY MobileCoreServices
+- PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
++ PATHS ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks)
+ find_library(LOCKDOWN_LIBRARY lockdown)
+ if (APPLE_EMBEDDED STREQUAL "watchos")
+ find_library(CAROUSELSERVICES_LIBRARY CarouselServices
+- PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
++ PATHS ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks)
+ endif()
+
+ if(NOT BACKBOARD_LIBRARY)
+@@ -158,7 +158,7 @@ endif()
+
+ add_definitions(-DLLDB_USE_OS_LOG)
+
+-if(${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$")
++if(${_CMAKE_OSX_SYSROOT_PATH} MATCHES ".Internal.sdk$")
+ message(STATUS "LLDB debugserver energy support is enabled")
+ add_definitions(-DLLDB_ENERGY)
+ set(ENERGY_LIBRARY -lpmenergy -lpmsample)
+@@ -181,7 +181,7 @@ endif()
+ separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}")
+
+ add_custom_command(OUTPUT ${generated_mach_interfaces}
+- VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
++ VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${_CMAKE_OSX_SYSROOT_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
+ )
+
+@@ -305,7 +305,7 @@ if(APPLE_EMBEDDED)
+ WITH_BKS
+ )
+ set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS
+- -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
++ -F${_CMAKE_OSX_SYSROOT_PATH}/System/Library/PrivateFrameworks
+ )
+
+ add_lldb_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources})
+diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
+index 6127b76db0..0a810db531 100644
+--- a/llvm/test/CMakeLists.txt
++++ b/llvm/test/CMakeLists.txt
+@@ -33,6 +33,7 @@ configure_lit_site_cfg(
+ MAIN_CONFIG
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
+ PATHS
++ "_CMAKE_OSX_SYSROOT_PATH"
+ "CMAKE_OSX_SYSROOT"
+ "LLVM_SOURCE_DIR"
+ "LLVM_BINARY_DIR"
diff --git a/vcpkg/ports/llvm/flang_usage b/vcpkg/ports/llvm/flang_usage
new file mode 100644
index 0000000..b3cb085
--- /dev/null
+++ b/vcpkg/ports/llvm/flang_usage
@@ -0,0 +1,5 @@
+The package flang provides CMake targets:
+
+ find_package(Flang CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${FLANG_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE flangFrontend flangFrontendTool ...)
diff --git a/vcpkg/ports/llvm/lld_usage b/vcpkg/ports/llvm/lld_usage
new file mode 100644
index 0000000..92c8d10
--- /dev/null
+++ b/vcpkg/ports/llvm/lld_usage
@@ -0,0 +1,5 @@
+The package lld provides CMake targets:
+
+ find_package(LLD CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${LLD_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE lldCommon lldCore lldDriver ...)
diff --git a/vcpkg/ports/llvm/llvm_usage b/vcpkg/ports/llvm/llvm_usage
new file mode 100644
index 0000000..72d57db
--- /dev/null
+++ b/vcpkg/ports/llvm/llvm_usage
@@ -0,0 +1,15 @@
+The package llvm provides CMake targets:
+
+ find_package(LLVM CONFIG REQUIRED)
+
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
+ include(HandleLLVMOptions)
+ add_definitions(${LLVM_DEFINITIONS})
+
+ target_include_directories(main PRIVATE ${LLVM_INCLUDE_DIRS})
+
+ # Find the libraries that correspond to the LLVM components that we wish to use
+ llvm_map_components_to_libnames(llvm_libs Support Core IRReader ...)
+
+ # Link against LLVM libraries
+ target_link_libraries(main PRIVATE ${llvm_libs})
diff --git a/vcpkg/ports/llvm/mlir_usage b/vcpkg/ports/llvm/mlir_usage
new file mode 100644
index 0000000..da45a16
--- /dev/null
+++ b/vcpkg/ports/llvm/mlir_usage
@@ -0,0 +1,5 @@
+The package lld provides CMake targets:
+
+ find_package(MLIR CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${MLIR_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE MLIRIR MLIRParser MLIRPass MLIRSupport ...)
diff --git a/vcpkg/ports/llvm/portfile.cmake b/vcpkg/ports/llvm/portfile.cmake
new file mode 100644
index 0000000..7764357
--- /dev/null
+++ b/vcpkg/ports/llvm/portfile.cmake
@@ -0,0 +1,407 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO llvm/llvm-project
+ REF "llvmorg-${VERSION}"
+ SHA512 9e9ec501336127339347c01ffd47768d501a84ef415c6a72fe56d31e867f982baeb3c4659be8e9b8475848a460357f33a6b2aa0ee9f81150e363963b98387bc0
+ HEAD_REF main
+ PATCHES
+ 0001-fix-install-package-dir.patch
+ 0002-fix-tools-install-dir.patch
+ 0003-fix-llvm-config.patch
+ 0004-disable-libomp-aliases.patch
+ 0005-remove-numpy.patch
+ 0006-create-destination-mlir-directory.patch
+ 75711.patch # [clang] Add intrin0.h header to mimic intrin0.h used by MSVC STL for clang-cl #75711
+ 79694.patch # [SEH] Ignore EH pad check for internal intrinsics #79694
+ 82407.patch # [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member #82407
+ add-include-chrono.patch # https://github.com/llvm/llvm-project/pull/118059
+ cmake4.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools LLVM_BUILD_TOOLS
+ tools LLVM_INCLUDE_TOOLS
+ utils LLVM_BUILD_UTILS
+ utils LLVM_INCLUDE_UTILS
+ utils LLVM_INSTALL_UTILS
+ enable-assertions LLVM_ENABLE_ASSERTIONS
+ enable-rtti LLVM_ENABLE_RTTI
+ enable-ffi LLVM_ENABLE_FFI
+ enable-terminfo LLVM_ENABLE_TERMINFO
+ enable-ios COMPILER_RT_ENABLE_IOS
+ enable-eh LLVM_ENABLE_EH
+ enable-bindings LLVM_ENABLE_BINDINGS
+ export-symbols LLVM_EXPORT_SYMBOLS_FOR_PLUGINS
+)
+
+vcpkg_cmake_get_vars(cmake_vars_file)
+include("${cmake_vars_file}")
+
+# LLVM generates CMake error due to Visual Studio version 16.4 is known to miscompile part of LLVM.
+# LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON disables this error.
+# See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html
+# and thread "[llvm-dev] Longstanding failing tests - clang-tidy, MachO, Polly" on llvm-dev Jan 21-23 2020.
+if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND VCPKG_DETECTED_MSVC_VERSION LESS "1925")
+ list(APPEND FEATURE_OPTIONS
+ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON
+ )
+endif()
+
+# Force enable or disable external libraries
+set(llvm_external_libraries
+ zlib
+ libxml2
+ zstd
+)
+foreach(external_library IN LISTS llvm_external_libraries)
+ string(TOLOWER "enable-${external_library}" feature_name)
+ string(TOUPPER "LLVM_ENABLE_${external_library}" define_name)
+ if(feature_name IN_LIST FEATURES)
+ list(APPEND FEATURE_OPTIONS
+ -D${define_name}=FORCE_ON
+ )
+ else()
+ list(APPEND FEATURE_OPTIONS
+ -D${define_name}=OFF
+ )
+ endif()
+endforeach()
+
+# LLVM_ABI_BREAKING_CHECKS can be WITH_ASSERTS (default), FORCE_ON or FORCE_OFF.
+# By default in LLVM, abi-breaking checks are enabled if assertions are enabled.
+# however, this breaks linking with the debug versions, since the option is
+# baked into the header files; thus, we always turn off LLVM_ABI_BREAKING_CHECKS
+# unless the user asks for it
+if("enable-abi-breaking-checks" IN_LIST FEATURES)
+ # Force enable abi-breaking checks.
+ list(APPEND FEATURE_OPTIONS
+ -DLLVM_ABI_BREAKING_CHECKS=FORCE_ON
+ )
+else()
+ # Force disable abi-breaking checks.
+ list(APPEND FEATURE_OPTIONS
+ -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
+ )
+endif()
+
+set(LLVM_ENABLE_PROJECTS)
+if("bolt" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "bolt")
+ list(APPEND FEATURE_OPTIONS
+ -DBOLT_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ )
+endif()
+if("clang" IN_LIST FEATURES OR "clang-tools-extra" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "clang")
+ list(APPEND FEATURE_OPTIONS
+ -DCLANG_INSTALL_PACKAGE_DIR:PATH=share/clang
+ -DCLANG_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ # Disable ARCMT
+ -DCLANG_ENABLE_ARCMT=OFF
+ # Disable static analyzer
+ -DCLANG_ENABLE_STATIC_ANALYZER=OFF
+ )
+ # 1) LLVM/Clang tools are relocated from ./bin/ to ./tools/llvm/ (CLANG_TOOLS_INSTALL_DIR=tools/llvm)
+ # 2) Clang resource files should be relocated from lib/clang/<major_version> to ../tools/llvm/lib/clang/<major_version>
+ string(REGEX MATCH "^[0-9]+" CLANG_VERSION_MAJOR ${VERSION})
+ list(APPEND FEATURE_OPTIONS -DCLANG_RESOURCE_DIR=lib/clang/${CLANG_VERSION_MAJOR})
+endif()
+if("clang-tools-extra" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "clang-tools-extra")
+endif()
+if("compiler-rt" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "compiler-rt")
+endif()
+if("flang" IN_LIST FEATURES)
+ if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ message(FATAL_ERROR "Building Flang with MSVC is not supported on x86. Disable it until issues are fixed.")
+ endif()
+ list(APPEND LLVM_ENABLE_PROJECTS "flang")
+ list(APPEND FEATURE_OPTIONS
+ -DFLANG_INSTALL_PACKAGE_DIR:PATH=share/flang
+ -DFLANG_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ )
+ list(APPEND FEATURE_OPTIONS
+ # Flang requires C++17
+ -DCMAKE_CXX_STANDARD=17
+ )
+endif()
+if("libclc" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "libclc")
+endif()
+if("lld" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "lld")
+ list(APPEND FEATURE_OPTIONS
+ -DLLD_INSTALL_PACKAGE_DIR:PATH=share/lld
+ -DLLD_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ )
+endif()
+if("lldb" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "lldb")
+ list(APPEND FEATURE_OPTIONS
+ -DLLDB_ENABLE_CURSES=OFF
+ )
+endif()
+if("mlir" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "mlir")
+ list(APPEND FEATURE_OPTIONS
+ -DMLIR_INSTALL_PACKAGE_DIR:PATH=share/mlir
+ -DMLIR_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF # Disables installation of object files in lib/objects-{CMAKE_BUILD_TYPE}.
+ )
+ if("enable-mlir-python-bindings" IN_LIST FEATURES)
+ list(APPEND FEATURE_OPTIONS
+ -DMLIR_ENABLE_BINDINGS_PYTHON=ON
+ "-Dpybind11_DIR=${CURRENT_INSTALLED_DIR}/share/pybind11"
+ )
+ endif()
+endif()
+if("openmp" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "openmp")
+ # Perl is required for the OpenMP run-time
+ vcpkg_find_acquire_program(PERL)
+ list(APPEND FEATURE_OPTIONS
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ -DOPENMP_ENABLE_LIBOMPTARGET=OFF # Currently libomptarget cannot be compiled on Windows or MacOS X.
+ -DOPENMP_ENABLE_OMPT_TOOLS=OFF # Currently tools are not tested well on Windows or MacOS X.
+ -DPERL_EXECUTABLE=${PERL}
+ )
+endif()
+if("polly" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_PROJECTS "polly")
+ list(APPEND FEATURE_OPTIONS
+ -DPOLLY_INSTALL_PACKAGE_DIR:PATH=share/polly
+ )
+endif()
+
+set(LLVM_ENABLE_RUNTIMES)
+if("libc" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_RUNTIMES "libc")
+endif()
+if("libcxx" IN_LIST FEATURES)
+ if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND VCPKG_DETECTED_MSVC_VERSION LESS "1914")
+ # libcxx supports being built with clang-cl, but not with MSVC’s cl.exe, as cl doesn’t support the #include_next extension.
+ # Furthermore, VS 2017 or newer (19.14) is required.
+ # More info: https://releases.llvm.org/17.0.1/projects/libcxx/docs/BuildingLibcxx.html#support-for-windows
+ message(FATAL_ERROR "libcxx requiries MSVC 19.14 or newer.")
+ endif()
+ list(APPEND LLVM_ENABLE_RUNTIMES "libcxx")
+endif()
+if("libcxxabi" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_RUNTIMES "libcxxabi")
+endif()
+if("libunwind" IN_LIST FEATURES)
+ list(APPEND LLVM_ENABLE_RUNTIMES "libunwind")
+ list(APPEND FEATURE_OPTIONS
+ -DLIBCXXABI_USE_LLVM_UNWINDER=ON
+ )
+else()
+ list(APPEND FEATURE_OPTIONS
+ -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
+ )
+endif()
+if("pstl" IN_LIST FEATURES)
+ if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ message(FATAL_ERROR "Building pstl with MSVC is not supported.")
+ endif()
+ list(APPEND LLVM_ENABLE_RUNTIMES "pstl")
+endif()
+
+# this is for normal targets
+set(known_llvm_targets
+ AArch64
+ AMDGPU
+ ARM
+ AVR
+ BPF
+ Hexagon
+ Lanai
+ LoongArch
+ Mips
+ MSP430
+ NVPTX
+ PowerPC
+ RISCV
+ Sparc
+ SystemZ
+ VE
+ WebAssembly
+ X86
+ XCore
+)
+
+set(LLVM_TARGETS_TO_BUILD)
+foreach(llvm_target IN LISTS known_llvm_targets)
+ string(TOLOWER "target-${llvm_target}" feature_name)
+ if(feature_name IN_LIST FEATURES)
+ list(APPEND LLVM_TARGETS_TO_BUILD "${llvm_target}")
+ endif()
+endforeach()
+
+# this is for experimental targets
+set(known_llvm_experimental_targets
+ ARC
+ CSKY
+ DirectX
+ M68k
+ SPIRV
+ Xtensa
+)
+
+set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD)
+foreach(llvm_target IN LISTS known_llvm_experimental_targets)
+ string(TOLOWER "target-${llvm_target}" feature_name)
+ if(feature_name IN_LIST FEATURES)
+ list(APPEND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "${llvm_target}")
+ endif()
+endforeach()
+
+vcpkg_find_acquire_program(PYTHON3)
+get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY)
+vcpkg_add_to_path("${PYTHON3_DIR}")
+
+file(REMOVE "${SOURCE_PATH}/llvm/cmake/modules/Findzstd.cmake")
+
+if("${LLVM_ENABLE_RUNTIMES}" STREQUAL "")
+ list(APPEND FEATURE_OPTIONS
+ -DLLVM_INCLUDE_RUNTIMES=OFF
+ -DLLVM_BUILD_RUNTIMES=OFF
+ -DLLVM_BUILD_RUNTIME=OFF
+ )
+endif()
+
+# At least one target must be specified, otherwise default to "all".
+if("${LLVM_TARGETS_TO_BUILD}" STREQUAL "")
+ set(LLVM_TARGETS_TO_BUILD "all")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/llvm"
+ OPTIONS
+ -DLLVM_INCLUDE_EXAMPLES=OFF
+ -DLLVM_BUILD_EXAMPLES=OFF
+ -DLLVM_INCLUDE_TESTS=OFF
+ -DLLVM_BUILD_TESTS=OFF
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_BUILD_BENCHMARKS=OFF
+ # Force TableGen to be built with optimization. This will significantly improve build time.
+ -DLLVM_OPTIMIZED_TABLEGEN=ON
+ -DPACKAGE_VERSION=${VERSION}
+ # Limit the maximum number of concurrent link jobs to 1. This should fix low amount of memory issue for link.
+ -DLLVM_PARALLEL_LINK_JOBS=1
+ -DLLVM_INSTALL_PACKAGE_DIR:PATH=share/llvm
+ -DLLVM_TOOLS_INSTALL_DIR:PATH=tools/llvm
+ "-DLLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS}"
+ "-DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES}"
+ "-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}"
+ "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}"
+ ${FEATURE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ COMPILER_RT_ENABLE_IOS
+)
+
+vcpkg_cmake_install(ADD_BIN_TO_PATH)
+
+function(llvm_cmake_package_config_fixup package_name)
+ cmake_parse_arguments("arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH" "FEATURE_NAME;CONFIG_PATH" "" ${ARGN})
+ if(NOT DEFINED arg_FEATURE_NAME)
+ set(arg_FEATURE_NAME ${package_name})
+ endif()
+ if("${arg_FEATURE_NAME}" STREQUAL "${PORT}" OR "${arg_FEATURE_NAME}" IN_LIST FEATURES)
+ set(args)
+ list(APPEND args PACKAGE_NAME "${package_name}")
+ if(arg_DO_NOT_DELETE_PARENT_CONFIG_PATH)
+ list(APPEND args "DO_NOT_DELETE_PARENT_CONFIG_PATH")
+ endif()
+ if(arg_CONFIG_PATH)
+ list(APPEND args "CONFIG_PATH" "${arg_CONFIG_PATH}")
+ endif()
+ vcpkg_cmake_config_fixup(${args})
+ file(INSTALL "${SOURCE_PATH}/${arg_FEATURE_NAME}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${package_name}" RENAME copyright)
+ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${package_name}_usage")
+ file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/${package_name}_usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${package_name}" RENAME usage)
+ endif()
+ endif()
+endfunction()
+
+llvm_cmake_package_config_fixup("clang" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+llvm_cmake_package_config_fixup("flang" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+llvm_cmake_package_config_fixup("lld" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+llvm_cmake_package_config_fixup("mlir" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+llvm_cmake_package_config_fixup("polly" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+llvm_cmake_package_config_fixup("ParallelSTL" FEATURE_NAME "pstl" DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH "lib/cmake/ParallelSTL")
+llvm_cmake_package_config_fixup("llvm")
+
+if("mlir" IN_LIST FEATURES)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mlir/MLIRConfig.cmake" "set(MLIR_MAIN_SRC_DIR \"${SOURCE_PATH}/mlir\")" "")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/mlir/MLIRConfig.cmake" "${CURRENT_BUILDTREES_DIR}" "\${MLIR_INCLUDE_DIRS}")
+endif()
+
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+
+# Move Clang's runtime libraries from bin/lib to tools/${PORT}/lib
+if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/lib")
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/bin/lib" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/lib")
+endif()
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/lib")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/lib")
+endif()
+
+# Remove empty directories to avoid vcpkg warning
+set(empty_dirs)
+if("clang-tools-extra" IN_LIST FEATURES)
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/clang-tidy/misc/ConfusableTable")
+endif()
+if("pstl" IN_LIST FEATURES)
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/lib/cmake")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")
+ endif()
+endif()
+if("flang" IN_LIST FEATURES)
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/CMakeFiles")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Config")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/CMakeFiles")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/CodeGen/CMakeFiles")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/Dialect/CMakeFiles")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/HLFIR/CMakeFiles")
+ list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/Transforms/CMakeFiles")
+endif()
+if(empty_dirs)
+ foreach(empty_dir IN LISTS empty_dirs)
+ if(NOT EXISTS "${empty_dir}")
+ message(WARNING "Directory '${empty_dir}' does not exist. Please remove it from the list of empty directories.")
+ else()
+ file(GLOB_RECURSE files_in_dir "${empty_dir}/*")
+ if(files_in_dir)
+ message(WARNING "Directory '${empty_dir}' is not empty. Please remove it from the list of empty directories.")
+ else()
+ file(REMOVE_RECURSE "${empty_dir}")
+ endif()
+ endif()
+ endforeach()
+endif()
+
+# Remove debug headers and tools
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/tools"
+ )
+endif()
+
+# LLVM generates shared libraries in a static build (LLVM-C.dll, libclang.dll, LTO.dll, Remarks.dll, ...)
+# for the corresponding export targets (used in LLVMExports-<config>.cmake files on the Windows platform)
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
+else()
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/bin"
+ )
+endif() \ No newline at end of file
diff --git a/vcpkg/ports/llvm/vcpkg.json b/vcpkg/ports/llvm/vcpkg.json
new file mode 100644
index 0000000..3c7ee6e
--- /dev/null
+++ b/vcpkg/ports/llvm/vcpkg.json
@@ -0,0 +1,471 @@
+{
+ "name": "llvm",
+ "version": "18.1.6",
+ "port-version": 5,
+ "description": "The LLVM Compiler Infrastructure.",
+ "homepage": "https://llvm.org",
+ "license": "Apache-2.0 WITH LLVM-exception",
+ "supports": "!uwp & !(arm & windows)",
+ "dependencies": [
+ {
+ "name": "atl",
+ "platform": "windows & !mingw"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-get-vars",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "clang",
+ "default-targets",
+ "enable-bindings",
+ "enable-terminfo",
+ "enable-zlib",
+ "enable-zstd",
+ "lld",
+ "tools"
+ ],
+ "features": {
+ "bolt": {
+ "description": "BOLT is a post-link optimizer developed to speed up large applications.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "clang": {
+ "description": "Include C Language Family Front-end.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "clang-tools-extra": {
+ "description": "Include Clang tools.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang"
+ ]
+ }
+ ]
+ },
+ "compiler-rt": {
+ "description": "Include compiler's runtime libraries.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang"
+ ]
+ }
+ ]
+ },
+ "default-targets": {
+ "description": "Build with platform-specific default targets.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "target-aarch64"
+ ],
+ "platform": "arm64"
+ },
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "target-x86"
+ ],
+ "platform": "x86 | x64"
+ },
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "target-arm"
+ ],
+ "platform": "arm & !arm64"
+ }
+ ]
+ },
+ "enable-abi-breaking-checks": {
+ "description": "Build LLVM with LLVM_ABI_BREAKING_CHECKS=FORCE_ON."
+ },
+ "enable-assertions": {
+ "description": "Build LLVM with assertions."
+ },
+ "enable-bindings": {
+ "description": "Build bindings."
+ },
+ "enable-eh": {
+ "description": "Build LLVM with exception handler.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "enable-rtti"
+ ]
+ }
+ ]
+ },
+ "enable-ffi": {
+ "description": "Build LLVM with FFI.",
+ "dependencies": [
+ "libffi"
+ ]
+ },
+ "enable-ios": {
+ "description": "Build compiler-rt for iOS SDK.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "target-arm"
+ ]
+ }
+ ]
+ },
+ "enable-libxml2": {
+ "description": "Build with LibXml2.",
+ "dependencies": [
+ "libxml2"
+ ]
+ },
+ "enable-mlir-python-bindings": {
+ "description": "Build MLIR Python bindings.",
+ "supports": "!(windows & static)",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "mlir"
+ ]
+ },
+ "pybind11",
+ "python3"
+ ]
+ },
+ "enable-rtti": {
+ "description": "Build LLVM with run-time type information."
+ },
+ "enable-terminfo": {
+ "description": "Use terminfo database if available."
+ },
+ "enable-zlib": {
+ "description": "Build with ZLib.",
+ "dependencies": [
+ "zlib"
+ ]
+ },
+ "enable-zstd": {
+ "description": "Build with zstd.",
+ "dependencies": [
+ "zstd"
+ ]
+ },
+ "export-symbols": {
+ "description": "Export symbols for plugins."
+ },
+ "flang": {
+ "description": "Include Fortran front end.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "mlir",
+ "tools"
+ ]
+ }
+ ]
+ },
+ "libc": {
+ "description": "Include libc library.",
+ "supports": "linux",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "tools"
+ ]
+ }
+ ]
+ },
+ "libclc": {
+ "description": "Include OpenCL library."
+ },
+ "libcxx": {
+ "description": "Include libcxx library.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "libcxxabi",
+ "tools"
+ ]
+ }
+ ]
+ },
+ "libcxxabi": {
+ "description": "Include libcxxabi library.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "libcxx",
+ "tools"
+ ]
+ }
+ ]
+ },
+ "libunwind": {
+ "description": "Include libunwind library.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "lld": {
+ "description": "Include LLVM linker.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "lldb": {
+ "description": "Include LLVM debugger.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "enable-terminfo",
+ "tools"
+ ]
+ }
+ ]
+ },
+ "mlir": {
+ "description": "Include MLIR (Multi-Level IR Compiler Framework) project.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools",
+ "utils"
+ ]
+ }
+ ]
+ },
+ "openmp": {
+ "description": "Include LLVM OpenMP libraries.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "clang",
+ "utils"
+ ]
+ }
+ ]
+ },
+ "polly": {
+ "description": "Include Polly (Polyhedral optimizations for LLVM) project.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools",
+ "utils"
+ ]
+ }
+ ]
+ },
+ "pstl": {
+ "description": "Include pstl (Parallel STL) library.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "target-aarch64": {
+ "description": "Build with AArch64 backend."
+ },
+ "target-all": {
+ "description": "Build with all backends.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "target-aarch64",
+ "target-amdgpu",
+ "target-arc",
+ "target-arm",
+ "target-avr",
+ "target-bpf",
+ "target-csky",
+ "target-directx",
+ "target-hexagon",
+ "target-lanai",
+ "target-loongarch",
+ "target-m68k",
+ "target-mips",
+ "target-msp430",
+ "target-nvptx",
+ "target-powerpc",
+ "target-riscv",
+ "target-sparc",
+ "target-spirv",
+ "target-systemz",
+ "target-ve",
+ "target-webassembly",
+ "target-x86",
+ "target-xcore",
+ "target-xtensa"
+ ]
+ }
+ ]
+ },
+ "target-amdgpu": {
+ "description": "Build with AMDGPU backend."
+ },
+ "target-arc": {
+ "description": "Build with ARC backend (experimental)."
+ },
+ "target-arm": {
+ "description": "Build with ARM backend."
+ },
+ "target-avr": {
+ "description": "Build with AVR backend."
+ },
+ "target-bpf": {
+ "description": "Build with BPF backend."
+ },
+ "target-csky": {
+ "description": "Build with CSKY backend (experimental)."
+ },
+ "target-directx": {
+ "description": "Build with DirectX backend (experimental)."
+ },
+ "target-hexagon": {
+ "description": "Build with Hexagon backend."
+ },
+ "target-lanai": {
+ "description": "Build with Lanai backend."
+ },
+ "target-loongarch": {
+ "description": "Build with LoongArch backend."
+ },
+ "target-m68k": {
+ "description": "Build with M68k backend (experimental)."
+ },
+ "target-mips": {
+ "description": "Build with Mips backend."
+ },
+ "target-msp430": {
+ "description": "Build with MSP430 backend."
+ },
+ "target-nvptx": {
+ "description": "Build with NVPTX backend."
+ },
+ "target-powerpc": {
+ "description": "Build with PowerPC backend."
+ },
+ "target-riscv": {
+ "description": "Build with RISC-V backend."
+ },
+ "target-sparc": {
+ "description": "Build with Sparc backend."
+ },
+ "target-spirv": {
+ "description": "Build with SPIRV backend (experimental)."
+ },
+ "target-systemz": {
+ "description": "Build with SystemZ backend."
+ },
+ "target-ve": {
+ "description": "Build with VE backend."
+ },
+ "target-webassembly": {
+ "description": "Build with WebAssembly backend."
+ },
+ "target-x86": {
+ "description": "Build with X86 backend."
+ },
+ "target-xcore": {
+ "description": "Build with XCore backend."
+ },
+ "target-xtensa": {
+ "description": "Build with Xtensa backend (experimental)."
+ },
+ "tools": {
+ "description": "Build LLVM tools."
+ },
+ "utils": {
+ "description": "Build LLVM utils.",
+ "dependencies": [
+ {
+ "name": "llvm",
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ }
+ }
+}