[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:
Jordan Rose
2014-12-11 01:12:02 +00:00
parent 20cd316500
commit 24118c95db
37 changed files with 191 additions and 31 deletions

View File

@@ -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;
}