mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Driver] Handle dependencies we learn about after a job is run.
Specifically, we care about the case where a job is run because of a private dependency, and then a non-private dependency turns out to be dirty. In this case, we still need to make sure to build all downstream files. With this the driver support for private dependencies should be complete and correct. Swift SVN r23853
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "swift/AST/DiagnosticEngine.h"
|
||||
#include "swift/AST/DiagnosticsDriver.h"
|
||||
#include "swift/Basic/Fallthrough.h"
|
||||
#include "swift/Basic/Program.h"
|
||||
#include "swift/Basic/TaskQueue.h"
|
||||
#include "swift/Driver/Action.h"
|
||||
@@ -135,10 +136,10 @@ int Compilation::performJobsInList(const JobList &JL, PerformJobsState &State) {
|
||||
case DependencyGraphImpl::LoadResult::HadError:
|
||||
NeedToRunEverything = true;
|
||||
break;
|
||||
case DependencyGraphImpl::LoadResult::Valid:
|
||||
case DependencyGraphImpl::LoadResult::UpToDate:
|
||||
Condition = Cmd->getCondition();
|
||||
break;
|
||||
case DependencyGraphImpl::LoadResult::NeedsRebuilding:
|
||||
case DependencyGraphImpl::LoadResult::AffectsDownstream:
|
||||
llvm_unreachable("we haven't marked anything in this graph yet");
|
||||
}
|
||||
}
|
||||
@@ -244,11 +245,12 @@ int Compilation::performJobsInList(const JobList &JL, PerformJobsState &State) {
|
||||
DeferredCommands.clear();
|
||||
Dependents.clear();
|
||||
break;
|
||||
case DependencyGraphImpl::LoadResult::NeedsRebuilding:
|
||||
llvm_unreachable("currently unused");
|
||||
case DependencyGraphImpl::LoadResult::Valid:
|
||||
if (wasNonPrivate)
|
||||
DepGraph.markTransitive(Dependents, FinishedCmd);
|
||||
case DependencyGraphImpl::LoadResult::UpToDate:
|
||||
if (!wasNonPrivate)
|
||||
break;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case DependencyGraphImpl::LoadResult::AffectsDownstream:
|
||||
DepGraph.markTransitive(Dependents, FinishedCmd);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user