[clang] [clang] Abort on unsupported uefi triples. (PR #124824)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 28 11:23:58 PST 2025
https://github.com/Prabhuk updated https://github.com/llvm/llvm-project/pull/124824
>From 270c260ba8160c71c6602fcb91a635368ee09a88 Mon Sep 17 00:00:00 2001
From: Prabhu Karthikeyan Rajasekaran <prabhukr at google.com>
Date: Tue, 28 Jan 2025 19:07:06 +0000
Subject: [PATCH 1/2] [clang] Abort on unsupported uefi triples.
The only architecture currently being supported (still a WIP) is
x86_64. Other UEFI triples targeting other architectures will now
report an error.
---
clang/lib/Driver/Driver.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 87855fdb799710..f1cd6353234a90 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6677,6 +6677,8 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
break;
case llvm::Triple::UEFI:
+ if(Target.getArch() != llvm::Triple::x86_64)
+ llvm::report_fatal_error("Currently the only architecture supported by *-uefi triples are x86_64.");
TC = std::make_unique<toolchains::UEFI>(*this, Target, Args);
break;
case llvm::Triple::Win32:
>From 8b5cdb310d299e362ec3191941065876d26c5475 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Tue, 28 Jan 2025 19:22:49 +0000
Subject: [PATCH 2/2] Fix formatting
---
clang/lib/Driver/Driver.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index f1cd6353234a90..07362e852d4d9b 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6677,8 +6677,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
break;
case llvm::Triple::UEFI:
- if(Target.getArch() != llvm::Triple::x86_64)
- llvm::report_fatal_error("Currently the only architecture supported by *-uefi triples are x86_64.");
+ if (Target.getArch() != llvm::Triple::x86_64)
+ llvm::report_fatal_error("Currently the only architecture supported by "
+ "*-uefi triples are x86_64.");
TC = std::make_unique<toolchains::UEFI>(*this, Target, Args);
break;
case llvm::Triple::Win32:
More information about the cfe-commits
mailing list