[Driver] Write out a record of which files were compiled in a build.

This is important because we might get part-way through the full
compilation, overwriting swiftdeps files as we go, and then encounter an
error. We don't want to lose information about any decls that have been
removed since the previous compile, so we propagate forward the information
we already have by saving it to a "build record" file.

More simply, this is necessary to track when a file is removed from a target.

The next commit will handle reading in this file at the start of a build.

Swift SVN r23968
This commit is contained in:
Jordan Rose
2014-12-17 00:26:28 +00:00
parent addfed670d
commit 94e7a284bd
19 changed files with 292 additions and 1 deletions

View File

@@ -80,6 +80,11 @@ class Compilation {
/// These apply whether the compilation succeeds or fails.
std::vector<std::string> TempFilePaths;
/// Write information about this compilation to this file.
///
/// This is used for incremental builds.
std::string CompilationRecordPath;
/// The number of commands which this compilation should attempt to run in
/// parallel.
unsigned NumberOfParallelCommands;
@@ -130,6 +135,11 @@ public:
EnableIncrementalBuild = false;
}
void setCompilationRecordPath(StringRef path) {
assert(CompilationRecordPath.empty() && "already set");
CompilationRecordPath = path;
}
/// Asks the Compilation to perform the Jobs which it knows about.
/// \returns result code for the Compilation's Jobs; 0 indicates success and
/// -2 indicates that one of the Compilation's Jobs crashed during execution