ExplicitModuleLoader: take a JSON file that specifies details of explicit Swift modules

Instead of taking paths of Swift module files from front-end command line
arguments, we should take a JSON file specifying details of explicit modules.
The advantages is (1) .swiftdoc and .swiftsourceinfo can be associated
with a .swiftmodule file, and (2) module names are explicitly used as
keys in the JSON input so we don't need to eagerly deserialize a .swiftmodule
file to collect the module name.
This commit is contained in:
Xi Ge
2020-06-12 12:12:52 -07:00
parent 1c8ad2f615
commit ec9cd91c1b
7 changed files with 150 additions and 8 deletions

View File

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