llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Phoebe Wang (phoebewang)

<details>
<summary>Changes</summary>

So that we don't need to check `Name == "apxf"` again.

---
Full diff: https://github.com/llvm/llvm-project/pull/179638.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChains/Arch/X86.cpp (+20-21) 


``````````diff
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();

``````````

</details>


https://github.com/llvm/llvm-project/pull/179638
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to