diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 37adad152c56..65039ac64b5a 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -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 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);