[PATCH] D131594: WORK IN PROGRESS Add Clang UEFI target to support "x86_64-unknown-uefi" triple
Prabhu Karthikeyan Rajasekaran via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 16:53:51 PDT 2022
Prabhuk updated this revision to Diff 468370.
Prabhuk added a comment.
Herald added a subscriber: MaskRay.
Added changes to the Driver.cpp.
This version uses underlying MSVC toolchain to compile UEFI target introduced here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131594/new/
https://reviews.llvm.org/D131594
Files:
clang/lib/Basic/Targets.cpp
clang/lib/Driver/Driver.cpp
llvm/include/llvm/ADT/Triple.h
llvm/lib/Support/Triple.cpp
Index: llvm/lib/Support/Triple.cpp
===================================================================
--- llvm/lib/Support/Triple.cpp
+++ 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)
Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -195,6 +195,7 @@
NetBSD,
OpenBSD,
Solaris,
+ UEFI,
Win32,
ZOS,
Haiku,
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -6019,6 +6019,9 @@
case llvm::Triple::Mesa3D:
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
break;
+ case llvm::Triple::UEFI:
+ TC = std::make_unique<toolchains::MSVCToolChain>(*this, Target, Args); ////TODO(prabhukr): Replace with a new UEFI toolchain
+ break;
case llvm::Triple::Win32:
switch (Target.getEnvironment()) {
default:
Index: clang/lib/Basic/Targets.cpp
===================================================================
--- clang/lib/Basic/Targets.cpp
+++ clang/lib/Basic/Targets.cpp
@@ -575,6 +575,9 @@
return new KFreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
case llvm::Triple::Solaris:
return new SolarisTargetInfo<X86_64TargetInfo>(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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131594.468370.patch
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221017/5f68eef8/attachment.bin>
More information about the llvm-commits
mailing list