[clang] a4df2da - [Driver][RISCV] Simplify -mtune
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 22 14:51:12 PDT 2022
Author: Fangrui Song
Date: 2022-07-22T14:51:07-07:00
New Revision: a4df2da173ba3907d652d24c9b4d8bb7d2ff447c
URL: https://github.com/llvm/llvm-project/commit/a4df2da173ba3907d652d24c9b4d8bb7d2ff447c
DIFF: https://github.com/llvm/llvm-project/commit/a4df2da173ba3907d652d24c9b4d8bb7d2ff447c.diff
LOG: [Driver][RISCV] Simplify -mtune
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 4cf4bc817144..a0b6422e51e2 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -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());
}
}
More information about the cfe-commits
mailing list