[Mangling] Introduce known manglings for many more standard library types.

Since the mangling scheme and set of standard library types is effectively
fixed now, introduce known mangling substitutions for a number of new
standard library types, filling out the S[A-Za-z] space.

Reduces standard library binary size by ~195k.
This commit is contained in:
Doug Gregor
2018-06-17 22:12:01 -07:00
parent c0836b9cf8
commit 7952a19f31
4 changed files with 80 additions and 13 deletions

View File

@@ -1974,10 +1974,10 @@ static bool tryDynamicCastBoxedSwiftValue(OpaqueValue *dest,
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(Sa);
/// Nominal type descriptor for Swift.Dictionary.
extern "C" const StructDescriptor STRUCT_TYPE_DESCR_SYM(s10Dictionary);
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(SD);
/// Nominal type descriptor for Swift.Set.
extern "C" const StructDescriptor STRUCT_TYPE_DESCR_SYM(s3Set);
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(Sh);
// internal func _arrayDownCastIndirect<SourceValue, TargetValue>(
// _ source: UnsafePointer<Array<SourceValue>>,
@@ -2091,7 +2091,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
}
// Dictionaries.
} else if (descriptor == &STRUCT_TYPE_DESCR_SYM(s10Dictionary)) {
} else if (descriptor == &NOMINAL_TYPE_DESCR_SYM(SD)) {
if (flags & DynamicCastFlags::Unconditional) {
_swift_dictionaryDownCastIndirect(source, destination,
sourceArgs[0], sourceArgs[1],
@@ -2107,7 +2107,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
}
// Sets.
} else if (descriptor == &STRUCT_TYPE_DESCR_SYM(s3Set)) {
} else if (descriptor == &NOMINAL_TYPE_DESCR_SYM(Sh)) {
if (flags & DynamicCastFlags::Unconditional) {
_swift_setDownCastIndirect(source, destination,
sourceArgs[0], targetArgs[0],