mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Hide LoadedModules From Clients of ASTContext
There's no reason clients need to be able to access this data directly. It obscures where module loading is actually happening, and makes it too easy to accidentally register a module with the wrong identifier in the context. Hide the registration operations behind opaque accessors.
This commit is contained in:
@@ -27,7 +27,7 @@ SerializedSILLoader::SerializedSILLoader(
|
||||
|
||||
// Get a list of SerializedModules from ASTContext.
|
||||
// FIXME: Iterating over LoadedModules is not a good way to do this.
|
||||
for (auto &Entry : Ctx.LoadedModules) {
|
||||
for (const auto &Entry : Ctx.getLoadedModules()) {
|
||||
for (auto File : Entry.second->getFiles()) {
|
||||
if (auto LoadedAST = dyn_cast<SerializedASTFile>(File)) {
|
||||
auto Des = new SILDeserializer(&LoadedAST->File, *SILMod, callbacks);
|
||||
|
||||
Reference in New Issue
Block a user