From 61cd264068ee77ae4e7a503ecd93f0d9fc6120c8 Mon Sep 17 00:00:00 2001 From: stevewan Date: Fri, 5 Jun 2020 19:54:00 -0400 Subject: [PATCH] [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 --- clang/lib/Driver/ToolChains/CommonArgs.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) 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; }