We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5300dc2 + fb99e84 commit c4b3727Copy full SHA for c4b3727
lib/Frontend/ModuleInterfaceLoader.cpp
@@ -1503,8 +1503,10 @@ struct ExplicitSwiftModuleLoader::Implementation {
1503
return;
1504
}
1505
StringRef Buffer = fileBufOrErr->get()->getBuffer();
1506
- Stream Stream(llvm::MemoryBufferRef(Buffer, fileName),
1507
- Ctx.SourceMgr.getLLVMSourceMgr());
+ // Use a new source manager instead of the one from ASTContext because we
+ // don't want the JSON file to be persistent.
1508
+ llvm::SourceMgr SM;
1509
+ Stream Stream(llvm::MemoryBufferRef(Buffer, fileName), SM);
1510
for (auto DI = Stream.begin(); DI != Stream.end(); ++ DI) {
1511
assert(DI != Stream.end() && "Failed to read a document");
1512
if (auto *MN = dyn_cast_or_null<SequenceNode>(DI->getRoot())) {
0 commit comments