r260478 - Remove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 10 18:00:50 PST 2016
Author: jlebar
Date: Wed Feb 10 20:00:50 2016
New Revision: 260478
URL: http://llvm.org/viewvc/llvm-project?rev=260478&view=rev
Log:
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
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=260478&r1=260477&r2=260478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Wed Feb 10 20:00:50 2016
@@ -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
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=260478&r1=260477&r2=260478&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Feb 10 20:00:50 2016
@@ -510,8 +510,7 @@ Compilation *Driver::BuildCompilation(Ar
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::generateCompilationDiagnost
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(Compi
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(Compilat
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(Compilat
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
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
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) {
More information about the cfe-commits
mailing list