[clang] [X86][NFC] Split mapxf options from mapx_features (PR #179638)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 02:55:15 PST 2026
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/179638
So that we don't need to check `Name == "apxf"` again.
>From e855de77a320530a6547e8b8e4e5679b93b424d7 Mon Sep 17 00:00:00 2001
From: Phoebe Wang <phoebe.wang at intel.com>
Date: Wed, 4 Feb 2026 18:50:31 +0800
Subject: [PATCH] [X86][NFC] Split mapxf options from mapx_features
So that we don't need to check `Name == "apxf"` again.
---
clang/lib/Driver/ToolChains/Arch/X86.cpp | 41 ++++++++++++------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index 4fcb744db120d..61d512f9e093f 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -254,30 +254,29 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
if (IsNegative)
Name = Name.substr(3);
- if (A->getOption().matches(options::OPT_mapxf) ||
- A->getOption().matches(options::OPT_mno_apxf) ||
- A->getOption().matches(options::OPT_mapx_features_EQ) ||
- A->getOption().matches(options::OPT_mno_apx_features_EQ)) {
- if (Name == "apxf") {
- if (IsNegative) {
- Features.insert(Features.end(),
- {"-egpr", "-ndd", "-ccmp", "-nf", "-zu"});
- if (!Triple.isOSWindows())
- Features.insert(Features.end(), {"-push2pop2", "-ppx"});
- } else {
- Features.insert(Features.end(),
- {"+egpr", "+ndd", "+ccmp", "+nf", "+zu"});
- if (!Triple.isOSWindows())
- Features.insert(Features.end(), {"+push2pop2", "+ppx"});
-
- if (Not64Bit)
- D.Diag(diag::err_drv_unsupported_opt_for_target)
- << StringRef("-mapxf") << Triple.getTriple();
- }
- continue;
+ if (A->getOption().matches(options::OPT_mapxf) ||
+ A->getOption().matches(options::OPT_mno_apxf)) {
+ if (IsNegative) {
+ Features.insert(Features.end(),
+ {"-egpr", "-ndd", "-ccmp", "-nf", "-zu"});
+ if (!Triple.isOSWindows())
+ Features.insert(Features.end(), {"-push2pop2", "-ppx"});
+ } else {
+ Features.insert(Features.end(),
+ {"+egpr", "+ndd", "+ccmp", "+nf", "+zu"});
+ if (!Triple.isOSWindows())
+ Features.insert(Features.end(), {"+push2pop2", "+ppx"});
+
+ if (Not64Bit)
+ D.Diag(diag::err_drv_unsupported_opt_for_target)
+ << StringRef("-mapxf") << Triple.getTriple();
}
+ continue;
+ }
+ if (A->getOption().matches(options::OPT_mapx_features_EQ) ||
+ A->getOption().matches(options::OPT_mno_apx_features_EQ)) {
if (Not64Bit && !IsNegative)
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< StringRef("-mapx-features=") << Triple.getTriple();
More information about the cfe-commits
mailing list