Add frontend mode -build-module-from-parseable-interface

Makes it easier to test the caching behavior, and may also be useful
for "prebuilding" swiftinterfaces in the future, or having the Driver
kick off a bunch of separate builds as proper tasks.
This commit is contained in:
Jordan Rose
2018-12-13 11:17:31 -08:00
parent 13c8a75da5
commit 37708ede6e
9 changed files with 80 additions and 6 deletions

View File

@@ -92,6 +92,17 @@ public:
return std::unique_ptr<ParseableInterfaceModuleLoader>(
new ParseableInterfaceModuleLoader(ctx, cacheDir, tracker, loadMode));
}
/// Unconditionally build \p InPath (a swiftinterface file) to \p OutPath (as
/// a swiftmodule file).
///
/// A simplified version of the core logic in #openModuleFiles, mostly for
/// testing purposes.
static bool buildSwiftModuleFromSwiftInterface(ASTContext &Ctx,
StringRef CacheDir,
StringRef ModuleName,
StringRef InPath,
StringRef OutPath);
};