[Driver][SystemZ] Simplify -mtune

Similar to AArch64.
This commit is contained in:
Fangrui Song 2022-07-22 14:54:27 -07:00
parent a4df2da173
commit 1f02ba4843
1 changed files with 5 additions and 12 deletions

View File

@ -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 =