[Driver] Allow passing all source files in a filelist.

Generate frontend commands with -filelist in them. This isn't actually
implemented yet, but we can start testing at this point.

Part 1 of https://bugs.swift.org/browse/SR-280.
This commit is contained in:
Jordan Rose
2016-01-12 16:43:21 -08:00
parent 67eaab6a4e
commit b45a69ef09
8 changed files with 123 additions and 31 deletions

View File

@@ -618,3 +618,23 @@ int Compilation::performJobs() {
return result;
}
const std::string &Compilation::getAllSourcesPath() const {
auto *mutableThis = const_cast<Compilation *>(this);
if (AllSourceFilesPath.empty()) {
SmallString<128> Buffer;
std::error_code EC =
llvm::sys::fs::createTemporaryFile("sources", "", Buffer);
if (EC) {
Diags.diagnose(SourceLoc(),
diag::error_unable_to_make_temporary_file,
EC.message());
// FIXME: This should not take down the entire process.
llvm::report_fatal_error("unable to create list of input sources");
}
mutableThis->addTemporaryFile(Buffer.str());
mutableThis->AllSourceFilesPath = TempFilePaths.back();
}
return AllSourceFilesPath;
}