mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL Serialization: handle more SILInstructions
Use a worklist in SIL linking to traverse the newly serialized SILFunction. Add serialization/deserialization of the following SILInstructions: AllocArray, Apply, FunctionRef, IntegerLiteral, Metatype, StructExtract, Struct and Tuple. Make getDecl and getIdentifier in ModuleFile public to be used by SILDeserializer, also make addDeclRef and addIdentifierRef in Serializer public to be used by SILSerializer. Update testing case to cover the above SILInstructions. TODO: lookupSILFunction should replace the existing empty SILFunction instead of creating a new SILFunction. Swift SVN r8339
This commit is contained in:
@@ -258,22 +258,6 @@ private:
|
||||
/// Returns the decl context with the given ID, deserializing it if needed.
|
||||
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 at some point after the decl
|
||||
/// has been recorded in the decl table (but not necessarily
|
||||
/// completed).
|
||||
Decl *getDecl(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = {},
|
||||
std::function<void(Decl*)> DidRecord = nullptr);
|
||||
|
||||
/// Returns the identifier with the given ID, deserializing it if needed.
|
||||
Identifier getIdentifier(serialization::IdentifierID IID);
|
||||
|
||||
/// Returns the appropriate module for the given name.
|
||||
///
|
||||
/// If the name matches the name of the current module, a shadowed module
|
||||
@@ -389,6 +373,22 @@ public:
|
||||
|
||||
/// Returns the type with the given ID, deserializing it if needed.
|
||||
Type getType(serialization::TypeID TID);
|
||||
|
||||
/// Returns the identifier with the given ID, deserializing it if needed.
|
||||
Identifier getIdentifier(serialization::IdentifierID IID);
|
||||
|
||||
/// 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 at some point after the decl
|
||||
/// has been recorded in the decl table (but not necessarily
|
||||
/// completed).
|
||||
Decl *getDecl(serialization::DeclID DID,
|
||||
Optional<DeclContext *> ForcedContext = {},
|
||||
std::function<void(Decl*)> DidRecord = nullptr);
|
||||
};
|
||||
|
||||
class SerializedModule : public LoadedModule {
|
||||
|
||||
Reference in New Issue
Block a user