Skip to content

Commit

Permalink
[Driver][RISCV] Simplify -mtune
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 22, 2022
1 parent 12fbd2d commit a4df2da
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,18 +2181,11 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args,

SetRISCVSmallDataLimit(getToolChain(), Args, CmdArgs);

std::string TuneCPU;

if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mtune_EQ)) {
StringRef Name = A->getValue();

Name = llvm::RISCV::resolveTuneCPUAlias(Name, Triple.isArch64Bit());
TuneCPU = std::string(Name);
}

if (!TuneCPU.empty()) {
if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) {
StringRef Name =
llvm::RISCV::resolveTuneCPUAlias(A->getValue(), Triple.isArch64Bit());
CmdArgs.push_back("-tune-cpu");
CmdArgs.push_back(Args.MakeArgString(TuneCPU));
CmdArgs.push_back(Name.data());
}
}

Expand Down

0 comments on commit a4df2da

Please sign in to comment.