[clang] 61cd264 - [PowerPC] Do not special case Darwin on PowerPC in target cpu handling

Steven Wan via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 16:55:36 PDT 2020


Author: stevewan
Date: 2020-06-05T19:55:28-04:00
New Revision: 61cd264068ee77ae4e7a503ecd93f0d9fc6120c8

URL: https://github.com/llvm/llvm-project/commit/61cd264068ee77ae4e7a503ecd93f0d9fc6120c8
DIFF: https://github.com/llvm/llvm-project/commit/61cd264068ee77ae4e7a503ecd93f0d9fc6120c8.diff

LOG: [PowerPC] Do not special case Darwin on PowerPC in target cpu handling

Summary: This patch removes the special handling for Darwin on PowerPC in the default target cpu handling, because Darwin is no longer supported on the PowerPC platform.

Reviewers: hubert.reinterpretcast, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: wuzish, nemanjai, shchenz, steven.zhang, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81115

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/CommonArgs.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 0ddbfac81b33..7fdb3fdf0009 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -294,19 +294,19 @@ std::string tools::getCPUName(const ArgList &Args, const llvm::Triple &T,
     std::string TargetCPUName = ppc::getPPCTargetCPU(Args);
     // LLVM may default to generating code for the native CPU,
     // but, like gcc, we default to a more generic option for
-    // each architecture. (except on AIX or Darwin)
-    if (TargetCPUName.empty()) {
-      if (T.isOSAIX())
-        TargetCPUName = "pwr4";
-      else if (!T.isOSDarwin()) {
-        if (T.getArch() == llvm::Triple::ppc64)
-          TargetCPUName = "ppc64";
-        else if (T.getArch() == llvm::Triple::ppc64le)
-          TargetCPUName = "ppc64le";
-        else
-          TargetCPUName = "ppc";
-      }
-    }
+    // each architecture. (except on AIX)
+    if (!TargetCPUName.empty())
+      return TargetCPUName;
+
+    if (T.isOSAIX())
+      TargetCPUName = "pwr4";
+    else if (T.getArch() == llvm::Triple::ppc64le)
+      TargetCPUName = "ppc64le";
+    else if (T.getArch() == llvm::Triple::ppc64)
+      TargetCPUName = "ppc64";
+    else
+      TargetCPUName = "ppc";
+
     return TargetCPUName;
   }
 


        


More information about the cfe-commits mailing list