diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -575,6 +575,9 @@ return new KFreeBSDTargetInfo(Triple, Opts); case llvm::Triple::Solaris: return new SolarisTargetInfo(Triple, Opts); + case llvm::Triple::UEFI: + //TODO(prabhukr): UEFITargetInfo need to be introduced + return new MicrosoftX86_64TargetInfo(Triple, Opts); case llvm::Triple::Win32: { switch (Triple.getEnvironment()) { case llvm::Triple::Cygnus: diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -6019,6 +6019,9 @@ case llvm::Triple::Mesa3D: TC = std::make_unique(*this, Target, Args); break; + case llvm::Triple::UEFI: + TC = std::make_unique(*this, Target, Args); ////TODO(prabhukr): Replace with a new UEFI toolchain + break; case llvm::Triple::Win32: switch (Target.getEnvironment()) { default: diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -195,6 +195,7 @@ NetBSD, OpenBSD, Solaris, + UEFI, Win32, ZOS, Haiku, diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -235,6 +235,7 @@ case RTEMS: return "rtems"; case Solaris: return "solaris"; case TvOS: return "tvos"; + case UEFI: return "uefi"; case WASI: return "wasi"; case WatchOS: return "watchos"; case Win32: return "windows"; @@ -562,6 +563,7 @@ .StartsWith("netbsd", Triple::NetBSD) .StartsWith("openbsd", Triple::OpenBSD) .StartsWith("solaris", Triple::Solaris) + .StartsWith("uefi", Triple::UEFI) .StartsWith("win32", Triple::Win32) .StartsWith("windows", Triple::Win32) .StartsWith("zos", Triple::ZOS)