[clang][driver] Clean up unnecessary reference to TC. NFC.
authorMichael Liao <michael.hliao@gmail.com>
Thu, 6 Feb 2020 14:52:01 +0000 (09:52 -0500)
committerMichael Liao <michael.hliao@gmail.com>
Thu, 6 Feb 2020 20:14:21 +0000 (15:14 -0500)
clang/lib/Driver/ToolChains/Clang.cpp

index 37adad1..65039ac 100644 (file)
@@ -307,10 +307,9 @@ static void getWebAssemblyTargetFeatures(const ArgList &Args,
   handleTargetFeaturesGroup(Args, Features, options::OPT_m_wasm_Features_Group);
 }
 
-static void getTargetFeatures(const ToolChain &TC, const llvm::Triple &Triple,
+static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
                               const ArgList &Args, ArgStringList &CmdArgs,
                               bool ForAS, bool IsAux = false) {
-  const Driver &D = TC.getDriver();
   std::vector<StringRef> Features;
   switch (Triple.getArch()) {
   default:
@@ -1594,7 +1593,7 @@ void Clang::RenderTargetOptions(const llvm::Triple &EffectiveTriple,
   const ToolChain &TC = getToolChain();
 
   // Add the target features
-  getTargetFeatures(TC, EffectiveTriple, Args, CmdArgs, false);
+  getTargetFeatures(TC.getDriver(), EffectiveTriple, Args, CmdArgs, false);
 
   // Add target specific flags.
   switch (TC.getArch()) {
@@ -4643,7 +4642,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-aux-target-cpu");
       CmdArgs.push_back(Args.MakeArgString(HostCPU));
     }
-    getTargetFeatures(TC, *TC.getAuxTriple(), HostArgs, CmdArgs,
+    getTargetFeatures(D, *TC.getAuxTriple(), HostArgs, CmdArgs,
                       /*ForAS*/ false, /*IsAux*/ true);
   }
 
@@ -6679,7 +6678,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
   }
 
   // Add the target features
-  getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, true);
+  getTargetFeatures(D, Triple, Args, CmdArgs, true);
 
   // Ignore explicit -force_cpusubtype_ALL option.
   (void)Args.hasArg(options::OPT_force__cpusubtype__ALL);