mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Deserialize typealiases and builtin types.
This includes the reading half of BCRecordLayout metaprogramming, and then a fairly straightforward deserialize-and-cache implementation in ModuleFile. Once again, this is based on Clang's module implementation: decls and types are referred to by an ID, which is used as an index into an array, which contains offsets to the definitions of the decl/type in the "decls-and-types" block in the serialized module. In order to test the feature, the code is currently eagerly deserializing all declarations. This will be partially fixed in the next commit. Swift SVN r5324
This commit is contained in:
@@ -169,13 +169,15 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
break;
|
||||
}
|
||||
|
||||
if (loadedModuleFile)
|
||||
LoadedModuleFiles.push_back(std::move(loadedModuleFile));
|
||||
|
||||
auto comp = new (Ctx.Allocate<Component>(1)) Component();
|
||||
auto module = new (Ctx) SerializedModule(Ctx, *this, moduleID.first, comp,
|
||||
loadedModuleFile.get());
|
||||
|
||||
if (loadedModuleFile) {
|
||||
loadedModuleFile->associateWithModule(module);
|
||||
LoadedModuleFiles.push_back(std::move(loadedModuleFile));
|
||||
}
|
||||
|
||||
Ctx.LoadedModules[moduleID.first.str()] = module;
|
||||
return module;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user