mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Delay adding ModuleFiles until they're loaded
Rather than adding a ModuleFile to a parent module and then removing it afterwards if it fails to load, let's wait until we've loaded the file before deciding to add it to the parent module. This then allows us to get rid of `ModuleDecl::removeFile`. In addition, push down the calls to `addFile` into the callers of `loadAST` in preparation for `addFile` being replaced with a one-time-only call to a `setFiles` method.
This commit is contained in:
@@ -195,6 +195,7 @@ static void indexModule(llvm::MemoryBuffer *Input,
|
||||
return;
|
||||
}
|
||||
|
||||
Mod->addFile(*FUnit);
|
||||
Mod->setHasResolvedImports();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user