Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -6695,6 +6695,8 @@ def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">, HelpText<"Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum.">, Alias; +def _SLASH_arm64EC : CLFlag<"arm64EC">, + HelpText<"Set build target to arm64ec">; // Non-aliases: Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ clang/lib/Driver/Driver.cpp @@ -1252,6 +1252,8 @@ T.setVendor(llvm::Triple::PC); T.setEnvironment(llvm::Triple::MSVC); T.setObjectFormat(llvm::Triple::COFF); + if (Args.hasArg(options::OPT__SLASH_arm64EC)) + T.setArch(llvm::Triple::aarch64, llvm::Triple::AArch64SubArch_arm64ec); TargetTriple = T.str(); } else if (IsDXCMode()) { // Build TargetTriple from target_profile option for clang-dxc. Index: clang/test/Driver/cl-options.c =================================================================== --- clang/test/Driver/cl-options.c +++ clang/test/Driver/cl-options.c @@ -783,4 +783,7 @@ // EXTERNAL_W0: "-Wno-system-headers" // EXTERNAL_Wn: "-Wsystem-headers" +// RUN: %clang_cl -vctoolsdir "" /arm64EC /c -### -- %s 2>&1 | FileCheck %s --check-prefix ARM64EC +// ARM64EC: "-triple" "arm64ec-pc-windows-msvc19.20.0" + void f(void) { }