mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL Serialization: perform SIL linking right after SILGen.
Add a SILLinkage mode "Deserialized" to make sure IRGen will emit hidden symbols for deserialized SILFunction. Inside SIL linker, set Linkage to external if we only have a declaration for a callee function. Both sil block and decl block in a module can emit an array of substitutions. To share the serialization between SILSerializer and Serializer, we modify the interface to pass in the abbreviation codes to write functions and to pass in a cursor to read functions. We now correctly handle the serialization of Substitutions in SpecializeInst. For a deserialized SILFunction, we now temporarily set its SILLocation and DebugScope to an empty FileLocation. Once mandatory inliner sets the SILLocation to the location of ApplyInst, a null SILLocation and a null DebugScope may work for a deserialized SILFunction. Update testing cases to reflect that we are now inlining transparent functions from modules, or to disable SILDeserializer for now (I am not sure how to update those testing cases). Swift SVN r8582
This commit is contained in:
@@ -222,7 +222,8 @@ private:
|
||||
ProtocolConformance *
|
||||
readUnderlyingConformance(ProtocolDecl *proto,
|
||||
serialization::DeclID typeID,
|
||||
serialization::IdentifierID moduleID);
|
||||
serialization::IdentifierID moduleID,
|
||||
llvm::BitstreamCursor &Cursor);
|
||||
|
||||
/// Recursively reads a protocol conformance from \c DeclTypeCursor.
|
||||
///
|
||||
@@ -232,12 +233,7 @@ private:
|
||||
/// If the record at the cursor is not a protocol conformance, returns
|
||||
/// Nothing. Note that a null pointer is a valid conformance value.
|
||||
Optional<std::pair<ProtocolDecl *, ProtocolConformance *>>
|
||||
maybeReadConformance(Type conformingType);
|
||||
|
||||
/// Reads a substitution record from \c DeclTypeCursor.
|
||||
///
|
||||
/// If the record at the cursor is not a substitution, returns Nothing.
|
||||
Optional<Substitution> maybeReadSubstitution();
|
||||
maybeReadConformance(Type conformingType, llvm::BitstreamCursor &Cursor);
|
||||
|
||||
/// Reads a generic param list from \c DeclTypeCursor.
|
||||
///
|
||||
@@ -389,6 +385,11 @@ public:
|
||||
/// If the name matches the name of the current module, a shadowed module
|
||||
/// is loaded instead. An empty name represents the Builtin module.
|
||||
Module *getModule(Identifier name);
|
||||
|
||||
/// Reads a substitution record from \c DeclTypeCursor.
|
||||
///
|
||||
/// If the record at the cursor is not a substitution, returns Nothing.
|
||||
Optional<Substitution> maybeReadSubstitution(llvm::BitstreamCursor &Cursor);
|
||||
};
|
||||
|
||||
class SerializedModule : public LoadedModule {
|
||||
|
||||
Reference in New Issue
Block a user