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:
Slava Pestov
2018-08-10 14:13:19 -07:00
parent 038a55757d
commit 6812fd63b8
4 changed files with 18 additions and 50 deletions

View File

@@ -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);