SIL: Generalize archetype_method to accept concrete types.

Allow archetype_method to look up a witness from a concrete ProtocolConformance record. This will allow generic specialization to apply to constrained generic functions independent of archetype_method devirtualization. <rdar://problem/14748543>

Swift SVN r10950
This commit is contained in:
Joe Groff
2013-12-07 00:00:51 +00:00
parent 725eda93a7
commit 27d96bbdc9
14 changed files with 142 additions and 45 deletions

View File

@@ -214,16 +214,6 @@ private:
serialization::IdentifierID moduleID,
llvm::BitstreamCursor &Cursor);
/// Recursively reads a protocol conformance from \c DeclTypeCursor.
///
/// The conformance will be newly-created; it's likely that it already exists
/// in the AST, and will need to be canonicalized.
///
/// 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, llvm::BitstreamCursor &Cursor);
/// Reads a generic param list from \c DeclTypeCursor.
///
/// If the record at the cursor is not a generic param list, returns null
@@ -388,6 +378,16 @@ public:
///
/// If the record at the cursor is not a substitution, returns Nothing.
Optional<Substitution> maybeReadSubstitution(llvm::BitstreamCursor &Cursor);
/// Recursively reads a protocol conformance from \c DeclTypeCursor.
///
/// The conformance will be newly-created; it's likely that it already exists
/// in the AST, and will need to be canonicalized.
///
/// 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, llvm::BitstreamCursor &Cursor);
};
/// A file-unit loaded from a serialized AST file.