mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Record nominal types in the module table ASAP.
Deserializing a nominal decl often ends up referring to the nominal's type, so if we're /already/ serializing the type, we should finish that as soon as we have a decl. Accomplish this by adding a callback that is called right after a nominal decl is recorded in the module's decl table, so that the type can be immediately recorded as well. Swift SVN r6227
This commit is contained in:
@@ -188,8 +188,17 @@ private:
|
||||
DeclContext *getDeclContext(serialization::DeclID DID);
|
||||
|
||||
/// Returns the decl with the given ID, deserializing it if needed.
|
||||
///
|
||||
/// \param DID The ID for the decl within this module.
|
||||
/// \param ForcedContext Optional override for the decl context of certain
|
||||
/// kinds of decls, used to avoid re-entrant
|
||||
/// deserialization.
|
||||
/// \param DidRecord Optional callback, called when certain kinds of decls
|
||||
/// have been recorded in the decl table but not necessarily
|
||||
/// completed.
|
||||
Decl *getDecl(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = {});
|
||||
Optional<DeclContext *> ForcedContext = {},
|
||||
Optional<std::function<void(Decl*)>> DidRecord = {});
|
||||
|
||||
/// Returns the type with the given ID, deserializing it if needed.
|
||||
Type getType(serialization::TypeID TID);
|
||||
|
||||
Reference in New Issue
Block a user