Skip to content

Commit

Permalink
[Driver][SystemZ] Simplify -mtune
Browse files Browse the repository at this point in the history
Similar to AArch64.
  • Loading branch information
MaskRay committed Jul 22, 2022
1 parent a4df2da commit 1f02ba4
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2209,19 +2209,12 @@ void Clang::AddSparcTargetArgs(const ArgList &Args,

void Clang::AddSystemZTargetArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mtune_EQ)) {
StringRef Name = A->getValue();

std::string TuneCPU;
if (Name == "native")
TuneCPU = std::string(llvm::sys::getHostCPUName());
if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) {
CmdArgs.push_back("-tune-cpu");
if (strcmp(A->getValue(), "native") == 0)
CmdArgs.push_back(Args.MakeArgString(llvm::sys::getHostCPUName()));
else
TuneCPU = std::string(Name);

if (!TuneCPU.empty()) {
CmdArgs.push_back("-tune-cpu");
CmdArgs.push_back(Args.MakeArgString(TuneCPU));
}
CmdArgs.push_back(A->getValue());
}

bool HasBackchain =
Expand Down

0 comments on commit 1f02ba4

Please sign in to comment.