https://github.com/Prabhuk updated 
https://github.com/llvm/llvm-project/pull/138364

>From d0786948b07adb0318a19562c9a9ee72e893feef Mon Sep 17 00:00:00 2001
From: prabhukr <prabh...@google.com>
Date: Fri, 2 May 2025 23:38:40 +0000
Subject: [PATCH 1/2] [clang] UEFI default ABI

Set MS ABI as default ABI for UEFI.
---
 clang/lib/Driver/ToolChains/Arch/X86.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp 
b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index e6ac3a9e4b350..eea0c9e2ae6e0 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -122,7 +122,7 @@ void x86::getX86TargetFeatures(const Driver &D, const 
llvm::Triple &Triple,
   // Claim and report unsupported -mabi=. Note: we don't support "sysv_abi" or
   // "ms_abi" as default function attributes.
   if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mabi_EQ)) {
-    StringRef DefaultAbi = Triple.isOSWindows() ? "ms" : "sysv";
+    StringRef DefaultAbi = Triple.isOSWindowsOrUEFI() ? "ms" : "sysv";
     if (A->getValue() != DefaultAbi)
       D.Diag(diag::err_drv_unsupported_opt_for_target)
           << A->getSpelling() << Triple.getTriple();

>From d32b6b62a43f2a413f1145f4bbe977fc97f7e87a Mon Sep 17 00:00:00 2001
From: prabhukr <prabh...@google.com>
Date: Wed, 7 May 2025 19:19:48 +0000
Subject: [PATCH 2/2] Add test.

---
 clang/test/Driver/x86-mabi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/test/Driver/x86-mabi.c b/clang/test/Driver/x86-mabi.c
index 5d15337cb1118..1aae5e08507a7 100644
--- a/clang/test/Driver/x86-mabi.c
+++ b/clang/test/Driver/x86-mabi.c
@@ -1,6 +1,8 @@
 // RUN: %clang -### --target=x86_64-windows-msvc -mabi=ms -S %s 2>&1 | 
FileCheck %s
+// RUN: %clang -### --target=x86_64-uefi -mabi=ms -S %s 2>&1 | FileCheck %s
 // RUN: not %clang -### --target=i386-unknown-linux -mabi=ms -S %s 2>&1 | 
FileCheck --check-prefix=ERR %s
 // RUN: not %clang -### --target=x86_64-windows-msvc -mabi=sysv -S %s 2>&1 | 
FileCheck --check-prefix=ERR %s
+// RUN: not %clang -### --target=x86_64-uefi -mabi=sysv -S %s 2>&1 | FileCheck 
--check-prefix=ERR %s
 // RUN: %clang -### --target=i386-unknown-linux -mabi=sysv -S %s 2>&1 | 
FileCheck %s
 
 // RUN: %clang -### --target=x86_64-windows-gnu -mabi=ms -S %s 2>&1 | 
FileCheck %s

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to