Skip to content

Commit 91d4726

Browse files
authored
Merge pull request #31940 from mwyman/tensorflow
Set the InMemoryOutputFileSystem on the SwiftModuleBuilder's subinstance.
2 parents 26996d4 + 8436d4e commit 91d4726

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
@@ -1198,6 +1198,17 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
11981198
if (Opts.DetailedRecord) {
11991199
subInvocation.getClangImporterOptions().DetailedPreprocessingRecord = true;
12001200
}
1201+
1202+
// SWIFT_ENABLE_TENSORFLOW
1203+
// If the ClangModuleLoader is using an InMemoryOutputFileSystem, the
1204+
// subinstance loader should use it as well, as files written to the file
1205+
// system may not be visible to read, causing subinvocations to fail loading
1206+
// dependencies.
1207+
auto &Instance = clangImporter->getClangInstance();
1208+
if (Instance.getInMemoryOutputFileSystem()) {
1209+
subInvocation.getClangImporterOptions().InMemoryOutputFileSystem =
1210+
Instance.getInMemoryOutputFileSystem();
1211+
}
12011212
}
12021213

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

0 commit comments

Comments
 (0)