mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[driver] Reworked Driver::buildJobsForAction() so that it doesn’t create the same Job multiple times.
Since a Job may be reached through multiple paths in the dependency graph, we need to include support for caching Jobs. (Currently, the cache maps Action/ToolChain pairs to Jobs.) As a result of these changes, Tool::constructJob() and Driver::buildJobsForAction() return a plain Job *, instead of a std::unique_ptr<Job>, since the Jobs returned by buildJobsForAction() no longer need to be unique. Swift SVN r12443
This commit is contained in:
@@ -34,13 +34,12 @@ public:
|
||||
|
||||
virtual bool hasGoodDiagnostics() const { return true; }
|
||||
|
||||
virtual std::unique_ptr<Job>
|
||||
constructJob(const JobAction &JA,
|
||||
std::unique_ptr<JobList> Inputs,
|
||||
std::unique_ptr<CommandOutput> Output,
|
||||
const ActionList &InputActions,
|
||||
const llvm::opt::ArgList &Args,
|
||||
StringRef LinkingOutput) const;
|
||||
virtual Job *constructJob(const JobAction &JA,
|
||||
std::unique_ptr<JobList> Inputs,
|
||||
std::unique_ptr<CommandOutput> Output,
|
||||
const ActionList &InputActions,
|
||||
const llvm::opt::ArgList &Args,
|
||||
StringRef LinkingOutput) const;
|
||||
};
|
||||
|
||||
namespace darwin {
|
||||
@@ -67,13 +66,12 @@ class LLVM_LIBRARY_VISIBILITY Linker : public DarwinTool {
|
||||
public:
|
||||
Linker(const ToolChain &TC) : DarwinTool("darwin::Linker", "linker", TC) {}
|
||||
|
||||
virtual std::unique_ptr<Job>
|
||||
constructJob(const JobAction &JA,
|
||||
std::unique_ptr<JobList> Inputs,
|
||||
std::unique_ptr<CommandOutput> Output,
|
||||
const ActionList &InputActions,
|
||||
const llvm::opt::ArgList &Args,
|
||||
StringRef LinkingOutput) const;
|
||||
virtual Job *constructJob(const JobAction &JA,
|
||||
std::unique_ptr<JobList> Inputs,
|
||||
std::unique_ptr<CommandOutput> Output,
|
||||
const ActionList &InputActions,
|
||||
const llvm::opt::ArgList &Args,
|
||||
StringRef LinkingOutput) const;
|
||||
};
|
||||
|
||||
} // end namespace darwin
|
||||
|
||||
Reference in New Issue
Block a user