mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix fulfillments for type metadata and witness table packs
A lot of the fixes here are adjustments to compensate in the fulfillment and metadata-path subsystems for the recent pack substitutions representation change. I think these adjustments really make the case for why the change was the right one to make: the code was clearly not considering the possibility of packs in these positions, and the need to handle packs makes everything work out much more cleanly. There's still some work that needs to happen around type packs; in particular, we're not caching them or fulfilling them as a whole, and we do have the setup to do that properly now.
This commit is contained in:
@@ -121,6 +121,15 @@ namespace irgen {
|
||||
unsigned reqtIndex,
|
||||
llvm::Value *metadata);
|
||||
|
||||
/// Given a reference to nominal type metadata of the given type,
|
||||
/// derive a reference to the type metadata pack stored in the nth
|
||||
/// requirement slot. The type must have generic arguments.
|
||||
llvm::Value *emitArgumentMetadataPackRef(IRGenFunction &IGF,
|
||||
NominalTypeDecl *theDecl,
|
||||
const GenericTypeRequirements &reqts,
|
||||
unsigned reqtIndex,
|
||||
llvm::Value *metadata);
|
||||
|
||||
/// Given a reference to nominal type metadata of the given type,
|
||||
/// derive a reference to a protocol witness table stored in the nth
|
||||
/// requirement slot. The type must have generic arguments.
|
||||
@@ -130,6 +139,15 @@ namespace irgen {
|
||||
unsigned reqtIndex,
|
||||
llvm::Value *metadata);
|
||||
|
||||
/// Given a reference to nominal type metadata of the given type,
|
||||
/// derive a reference to a protocol witness table pack stored in the nth
|
||||
/// requirement slot. The type must have generic arguments.
|
||||
llvm::Value *emitArgumentWitnessTablePackRef(IRGenFunction &IGF,
|
||||
NominalTypeDecl *theDecl,
|
||||
const GenericTypeRequirements &reqts,
|
||||
unsigned reqtIndex,
|
||||
llvm::Value *metadata);
|
||||
|
||||
/// Given a reference to nominal type metadata of the given type,
|
||||
/// derive a reference to a the pack shape stored in the nth
|
||||
/// requirement slot. The type must have generic arguments.
|
||||
|
||||
Reference in New Issue
Block a user