[clang] 8a2b41b - [X86][NFC] Split mapxf options from mapx_features (#179638)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 03:17:29 PST 2026
Author: Phoebe Wang
Date: 2026-02-04T11:17:23Z
New Revision: 8a2b41b49d754c3664d834416525a8195b220db5
URL: https://github.com/llvm/llvm-project/commit/8a2b41b49d754c3664d834416525a8195b220db5
DIFF: https://github.com/llvm/llvm-project/commit/8a2b41b49d754c3664d834416525a8195b220db5.diff
LOG: [X86][NFC] Split mapxf options from mapx_features (#179638)
So that we don't need to check `Name == "apxf"` again.
Added:
Modified:
clang/lib/Driver/ToolChains/Arch/X86.cpp
Removed:
################################################################################
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