mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] <rdar://46081260> Fallback behaviour and testing env vars.
This commit is contained in:
committed by
Jordan Rose
parent
0ccfe34513
commit
f7200e87bd
@@ -35,8 +35,9 @@ namespace {
|
||||
|
||||
// Defined out-of-line so that we can see ~ModuleFile.
|
||||
SerializedModuleLoaderBase::SerializedModuleLoaderBase(ASTContext &ctx,
|
||||
DependencyTracker *tracker)
|
||||
: ModuleLoader(tracker), Ctx(ctx) {}
|
||||
DependencyTracker *tracker,
|
||||
ModuleLoadingMode loadMode)
|
||||
: ModuleLoader(tracker), Ctx(ctx), LoadMode(loadMode) {}
|
||||
SerializedModuleLoaderBase::~SerializedModuleLoaderBase() = default;
|
||||
|
||||
SerializedModuleLoader::~SerializedModuleLoader() = default;
|
||||
@@ -50,6 +51,12 @@ std::error_code SerializedModuleLoaderBase::openModuleFiles(
|
||||
(!ModuleBuffer && !ModuleDocBuffer)) &&
|
||||
"Module and Module Doc buffer must both be initialized or NULL");
|
||||
|
||||
// The SerializedModuleLoaderBase implementation here only knows how to do a
|
||||
// serialized (not parseable) module-load; this is valid behaviour in all
|
||||
// ModuleLoadingModes except OnlyParseable mode, where it is disabled.
|
||||
if (LoadMode == ModuleLoadingMode::OnlyParseable)
|
||||
return std::make_error_code(std::errc::not_supported);
|
||||
|
||||
clang::vfs::FileSystem &FS = *Ctx.SourceMgr.getFileSystem();
|
||||
|
||||
// Try to open the module file first. If we fail, don't even look for the
|
||||
|
||||
Reference in New Issue
Block a user