[clang] 4084e31 - [Driver] Use hasArg to fix -Wunused-but-set-variable after #97342
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 26 08:52:08 PDT 2024
Author: Fangrui Song
Date: 2024-07-26T08:52:04-07:00
New Revision: 4084e31d3369521615c706a3995566aa7165be97
URL: https://github.com/llvm/llvm-project/commit/4084e31d3369521615c706a3995566aa7165be97
DIFF: https://github.com/llvm/llvm-project/commit/4084e31d3369521615c706a3995566aa7165be97.diff
LOG: [Driver] Use hasArg to fix -Wunused-but-set-variable after #97342
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 fa3d900784e65..6790079ccd26a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3774,7 +3774,7 @@ static void RenderOpenCLOptions(const ArgList &Args, ArgStringList &CmdArgs,
CmdArgs.push_back(Args.MakeArgString(CLExtStr));
}
- if (Arg *A = Args.getLastArg(options::OPT_cl_finite_math_only)) {
+ if (Args.hasArg(options::OPT_cl_finite_math_only)) {
CmdArgs.push_back("-menable-no-infs");
CmdArgs.push_back("-menable-no-nans");
}
More information about the cfe-commits
mailing list