r312616 - Driver: remove unused variable (NFC)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 21:56:23 PDT 2017


Author: compnerd
Date: Tue Sep  5 21:56:23 2017
New Revision: 312616

URL: http://llvm.org/viewvc/llvm-project?rev=312616&view=rev
Log:
Driver: remove unused variable (NFC)

Remove `IsHosted` which is no longer needed in `RenderSSPOptions` after
SVN r312595.  The single use can now be inlined.  NFC

Modified:
    cfe/trunk/lib/Driver/ToolChains/Clang.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=312616&r1=312615&r2=312616&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Tue Sep  5 21:56:23 2017
@@ -2276,8 +2276,7 @@ static void RenderAnalyzerOptions(const
 }
 
 static void RenderSSPOptions(const ToolChain &TC, const ArgList &Args,
-                             ArgStringList &CmdArgs, bool KernelOrKext,
-                             bool IsHosted) {
+                             ArgStringList &CmdArgs, bool KernelOrKext) {
   const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple();
 
   // NVPTX doesn't support stack protectors; from the compiler's perspective, it
@@ -3803,10 +3802,8 @@ void Clang::ConstructJob(Compilation &C,
   Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
 
   // -fhosted is default.
-  bool IsHosted =
-      !Args.hasFlag(options::OPT_ffreestanding, options::OPT_fhosted, false) &&
-      !KernelOrKext;
-  if (!IsHosted)
+  if (Args.hasFlag(options::OPT_ffreestanding, options::OPT_fhosted, false) ||
+      KernelOrKext)
     CmdArgs.push_back("-ffreestanding");
 
   // Forward -f (flag) options which we can pass directly.
@@ -3914,7 +3911,7 @@ void Clang::ConstructJob(Compilation &C,
 
   Args.AddLastArg(CmdArgs, options::OPT_pthread);
 
-  RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext, IsHosted);
+  RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
 
   // Translate -mstackrealign
   if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign,




More information about the cfe-commits mailing list