ModuleInterface: teach -compile-module-from-interface to emit forwarding module

-compile-module-from-interface action now takes arguments of -candidate-module-file.
If one of the candidate module files is up-to-date, the action emits a forwarding
module pointing to the candidate module instead of building a binary module.
This commit is contained in:
Xi Ge
2020-07-17 23:48:43 -07:00
parent 5e9934c333
commit f9396f2812
9 changed files with 105 additions and 7 deletions

View File

@@ -900,6 +900,10 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts,
}
if (const Arg *A = Args.getLastArg(OPT_explict_swift_module_map))
Opts.ExplicitSwiftModuleMap = A->getValue();
for (auto A: Args.filtered(OPT_candidate_module_file)) {
Opts.CandidateCompiledModules.push_back(resolveSearchPath(A->getValue()));
}
// Opts.RuntimeIncludePath is set by calls to
// setRuntimeIncludePath() or setMainExecutablePath().
// Opts.RuntimeImportPath is set by calls to