[Driver] Add -emit-reference-dependencies to the driver.

This just adds another possible output kind and forwards it to the frontend.
Note that in builds without an output map, this will just dump the dependencies
next to the output file, which is a temp file whose name is chosen randomly.
That's not so useful, but we can fix it later.

Part of rdar://problem/15353101

Swift SVN r23220
This commit is contained in:
Jordan Rose
2014-11-11 00:43:22 +00:00
parent 3d396f8b12
commit 1fdf0e48b4
8 changed files with 27 additions and 4 deletions

View File

@@ -810,6 +810,7 @@ void Driver::buildActions(const ToolChain &TC,
case types::TY_SerializedDiagnostics:
case types::TY_ObjCHeader:
case types::TY_ClangModuleFile:
case types::TY_SwiftDeps:
// We could in theory handle assembly or LLVM input, but let's not.
// FIXME: What about LTO?
Diags.diagnose(SourceLoc(), diag::error_unknown_file_type,
@@ -1329,6 +1330,9 @@ Job *Driver::buildJobsForAction(const Compilation &C, const Action *A,
if (C.getArgs().hasArg(options::OPT_emit_dependencies)) {
addAuxiliaryOutput(*Output, types::TY_Dependencies, OI, OutputMap);
}
if (C.getArgs().hasArg(options::OPT_emit_reference_dependencies)) {
addAuxiliaryOutput(*Output, types::TY_SwiftDeps, OI, OutputMap);
}
}
// Choose the Objective-C header output path.