SIL: Add resilience expansion parameter to TypeConverter::countNumberOfFields()

This commit is contained in:
Slava Pestov
2019-03-05 16:49:09 -05:00
parent 980fb7c437
commit ced5548deb
3 changed files with 22 additions and 19 deletions

View File

@@ -683,7 +683,9 @@ class TypeConverter {
llvm::DenseMap<AnyFunctionRef, CaptureInfo> LoweredCaptures;
/// Cache of loadable SILType to number of (estimated) fields
llvm::DenseMap<SILType, unsigned> TypeFields;
///
/// Second element is a ResilienceExpansion.
llvm::DenseMap<std::pair<SILType, unsigned>, unsigned> TypeFields;
CanAnyFunctionType makeConstantInterfaceType(SILDeclRef constant);
@@ -739,7 +741,7 @@ public:
static ProtocolDispatchStrategy getProtocolDispatchStrategy(ProtocolDecl *P);
/// Count the total number of fields inside the given SIL Type
unsigned countNumberOfFields(SILType Ty);
unsigned countNumberOfFields(SILType Ty, ResilienceExpansion expansion);
/// True if a protocol uses witness tables for dynamic dispatch.
static bool protocolRequiresWitnessTable(ProtocolDecl *P) {