[PowerPC] Do not special case Darwin on PowerPC in target cpu handling
authorstevewan <wan.yu@ibm.com>
Fri, 5 Jun 2020 23:54:00 +0000 (19:54 -0400)
committerSteven Wan <wanyu9511@gmail.com>
Fri, 5 Jun 2020 23:55:28 +0000 (19:55 -0400)
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

clang/lib/Driver/ToolChains/CommonArgs.cpp

index 0ddbfac..7fdb3fd 100644 (file)
@@ -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;
   }