Remove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.

Summary:
Actions don't depend on the toolchain; they get bound to a particular
toolchain via BindArch.

No functional changes.

Reviewers: echristo

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17100

llvm-svn: 260478
This commit is contained in:
Justin Lebar 2016-02-11 02:00:50 +00:00
parent 6f46de21e1
commit 0f3474c1dc
2 changed files with 13 additions and 20 deletions

View File

@ -299,12 +299,10 @@ public:
/// given arguments, which are only done for a single architecture.
///
/// \param C - The compilation that is being built.
/// \param TC - The default host tool chain.
/// \param Args - The input arguments.
/// \param Actions - The list to store the resulting actions onto.
void BuildActions(Compilation &C, const ToolChain &TC,
llvm::opt::DerivedArgList &Args, const InputList &Inputs,
ActionList &Actions) const;
void BuildActions(Compilation &C, llvm::opt::DerivedArgList &Args,
const InputList &Inputs, ActionList &Actions) const;
/// BuildUniversalActions - Construct the list of actions to perform
/// for the given arguments, which may require a universal build.
@ -376,9 +374,8 @@ public:
/// ConstructAction - Construct the appropriate action to do for
/// \p Phase on the \p Input, taking in to account arguments
/// like -fsyntax-only or --analyze.
Action *ConstructPhaseAction(Compilation &C, const ToolChain &TC,
const llvm::opt::ArgList &Args, phases::ID Phase,
Action *Input) const;
Action *ConstructPhaseAction(Compilation &C, const llvm::opt::ArgList &Args,
phases::ID Phase, Action *Input) const;
/// BuildJobsForAction - Construct the jobs to perform for the action \p A and
/// return an InputInfo for the result of running \p A. Will only construct

View File

@ -510,8 +510,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
if (TC.getTriple().isOSBinFormatMachO())
BuildUniversalActions(*C, C->getDefaultToolChain(), Inputs);
else
BuildActions(*C, C->getDefaultToolChain(), C->getArgs(), Inputs,
C->getActions());
BuildActions(*C, C->getArgs(), Inputs, C->getActions());
if (CCCPrintPhases) {
PrintActions(*C);
@ -625,7 +624,7 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
if (TC.getTriple().isOSBinFormatMachO())
BuildUniversalActions(C, TC, Inputs);
else
BuildActions(C, TC, C.getArgs(), Inputs, C.getActions());
BuildActions(C, C.getArgs(), Inputs, C.getActions());
BuildJobs(C);
@ -1036,7 +1035,7 @@ void Driver::BuildUniversalActions(Compilation &C, const ToolChain &TC,
Archs.push_back(Args.MakeArgString(TC.getDefaultUniversalArchName()));
ActionList SingleActions;
BuildActions(C, TC, Args, BAInputs, SingleActions);
BuildActions(C, Args, BAInputs, SingleActions);
// Add in arch bindings for every top level action, as well as lipo and
// dsymutil steps if needed.
@ -1322,8 +1321,7 @@ static Action *buildCudaActions(Compilation &C, DerivedArgList &Args,
assert(C.getCudaDeviceToolChain() &&
"Missing toolchain for device-side compilation.");
ActionList CudaDeviceActions;
C.getDriver().BuildActions(C, *C.getCudaDeviceToolChain(), Args,
CudaDeviceInputs, CudaDeviceActions);
C.getDriver().BuildActions(C, Args, CudaDeviceInputs, CudaDeviceActions);
assert(GpuArchList.size() == CudaDeviceActions.size() &&
"Failed to create actions for all devices");
@ -1387,9 +1385,8 @@ static Action *buildCudaActions(Compilation &C, DerivedArgList &Args,
ActionList({FatbinAction}));
}
void Driver::BuildActions(Compilation &C, const ToolChain &TC,
DerivedArgList &Args, const InputList &Inputs,
ActionList &Actions) const {
void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
const InputList &Inputs, ActionList &Actions) const {
llvm::PrettyStackTraceString CrashInfo("Building compilation actions");
if (!SuppressMissingInputWarning && Inputs.empty()) {
@ -1516,7 +1513,7 @@ void Driver::BuildActions(Compilation &C, const ToolChain &TC,
continue;
// Otherwise construct the appropriate action.
Current = ConstructPhaseAction(C, TC, Args, Phase, Current);
Current = ConstructPhaseAction(C, Args, Phase, Current);
if (InputType == types::TY_CUDA && Phase == CudaInjectionPhase) {
Current = buildCudaActions(C, Args, InputArg, Current, Actions);
@ -1553,9 +1550,8 @@ void Driver::BuildActions(Compilation &C, const ToolChain &TC,
Args.ClaimAllArgs(options::OPT_cuda_host_only);
}
Action *Driver::ConstructPhaseAction(Compilation &C, const ToolChain &TC,
const ArgList &Args, phases::ID Phase,
Action *Input) const {
Action *Driver::ConstructPhaseAction(Compilation &C, const ArgList &Args,
phases::ID Phase, Action *Input) const {
llvm::PrettyStackTraceString CrashInfo("Constructing phase actions");
// Build the appropriate action.
switch (Phase) {