Skip to content

Commit 8436d4e

Browse files
committed
Set the InMemoryOutputFileSystem on the subinstance that builds referenced .swiftinterface files.
When the main compiler instance is using an InMemoryOutputFileSystem for its ClangLoader, this should be used by the subinstance loader as well as any files it otherwise writes to the filesystem may not be visible.
1 parent d2873b6 commit 8436d4e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,17 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
12131213
if (Opts.DetailedRecord) {
12141214
subInvocation.getClangImporterOptions().DetailedPreprocessingRecord = true;
12151215
}
1216+
1217+
// SWIFT_ENABLE_TENSORFLOW
1218+
// If the ClangModuleLoader is using an InMemoryOutputFileSystem, the
1219+
// subinstance loader should use it as well, as files written to the file
1220+
// system may not be visible to read, causing subinvocations to fail loading
1221+
// dependencies.
1222+
auto &Instance = clangImporter->getClangInstance();
1223+
if (Instance.getInMemoryOutputFileSystem()) {
1224+
subInvocation.getClangImporterOptions().InMemoryOutputFileSystem =
1225+
Instance.getInMemoryOutputFileSystem();
1226+
}
12161227
}
12171228

12181229
// Tell the subinvocation to serialize dependency hashes if asked to do so.

0 commit comments

Comments
 (0)