Skip to content

Commit 61cd264

Browse files
committed
[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
1 parent 32c09d5 commit 61cd264

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -294,19 +294,19 @@ std::string tools::getCPUName(const ArgList &Args, const llvm::Triple &T,
294294
std::string TargetCPUName = ppc::getPPCTargetCPU(Args);
295295
// LLVM may default to generating code for the native CPU,
296296
// but, like gcc, we default to a more generic option for
297-
// each architecture. (except on AIX or Darwin)
298-
if (TargetCPUName.empty()) {
299-
if (T.isOSAIX())
300-
TargetCPUName = "pwr4";
301-
else if (!T.isOSDarwin()) {
302-
if (T.getArch() == llvm::Triple::ppc64)
303-
TargetCPUName = "ppc64";
304-
else if (T.getArch() == llvm::Triple::ppc64le)
305-
TargetCPUName = "ppc64le";
306-
else
307-
TargetCPUName = "ppc";
308-
}
309-
}
297+
// each architecture. (except on AIX)
298+
if (!TargetCPUName.empty())
299+
return TargetCPUName;
300+
301+
if (T.isOSAIX())
302+
TargetCPUName = "pwr4";
303+
else if (T.getArch() == llvm::Triple::ppc64le)
304+
TargetCPUName = "ppc64le";
305+
else if (T.getArch() == llvm::Triple::ppc64)
306+
TargetCPUName = "ppc64";
307+
else
308+
TargetCPUName = "ppc";
309+
310310
return TargetCPUName;
311311
}
312312

0 commit comments

Comments
 (0)