[clang] faa29ee - [Clang] Fix warning on unused varaible

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 19:49:14 PST 2023


Author: Joseph Huber
Date: 2023-01-06T21:14:31-06:00
New Revision: faa29ee0f9c941b193161ad48a46713a04a81163

URL: https://github.com/llvm/llvm-project/commit/faa29ee0f9c941b193161ad48a46713a04a81163
DIFF: https://github.com/llvm/llvm-project/commit/faa29ee0f9c941b193161ad48a46713a04a81163.diff

LOG: [Clang] Fix warning on unused varaible

Summary:
Don't check the flag this way, it leads to unused variables. Fix.

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 3cbffef3064d..b2eadaf67e95 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -8429,7 +8429,8 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
   Args.ClaimAllArgs(options::OPT_Xoffload_linker);
 
   // Embed bitcode instead of an object in JIT mode.
-  if (const Arg *A = Args.getLastArg(options::OPT_fopenmp_target_jit))
+  if (Args.hasFlag(options::OPT_fopenmp_target_jit,
+                   options::OPT_fno_openmp_target_jit, false))
     CmdArgs.push_back("--embed-bitcode");
 
   // Forward `-mllvm` arguments to the LLVM invocations if present.


        


More information about the cfe-commits mailing list