mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Remove an old hack
SILFunctions no longer have a GenericParamList, so all of these circularity and ordering problems are gone. We *do* deserialize the generic parameters before creating decls that have them though, so serialize generic parameters as if their DeclContext was the DeclContext of the owner decl. This is what we do when we parse generic parameters too; in both cases, the constructor for the owner decl gives the generic parameters the right DeclContext.
This commit is contained in:
@@ -506,8 +506,7 @@ private:
|
||||
|
||||
/// Main logic of getDeclChecked.
|
||||
llvm::Expected<Decl *>
|
||||
getDeclCheckedImpl(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = None);
|
||||
getDeclCheckedImpl(serialization::DeclID DID);
|
||||
|
||||
/// Reads the index block, which contains global tables.
|
||||
///
|
||||
@@ -796,23 +795,15 @@ public:
|
||||
/// 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.
|
||||
///
|
||||
|
||||
/// \sa getDeclChecked
|
||||
Decl *getDecl(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = None);
|
||||
Decl *getDecl(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.
|
||||
llvm::Expected<Decl *>
|
||||
getDeclChecked(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = None);
|
||||
getDeclChecked(serialization::DeclID DID);
|
||||
|
||||
/// Returns the decl context with the given ID, deserializing it if needed.
|
||||
DeclContext *getDeclContext(serialization::DeclContextID DID);
|
||||
|
||||
Reference in New Issue
Block a user