Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
Greg Parker
2017-06-28 15:25:17 -07:00
629 changed files with 21576 additions and 10961 deletions

View File

@@ -1430,7 +1430,7 @@ public:
allocate(IRGenFunction &IGF, SILType boxedType, GenericEnvironment *env,
const llvm::Twine &name) const override {
return OwnedAddress(IGF.getTypeInfo(boxedType).getUndefAddress(),
IGF.IGM.RefCountedNull);
IGF.emitAllocEmptyBoxCall());
}
void
@@ -1584,7 +1584,11 @@ const TypeInfo *TypeConverter::convertBoxType(SILBoxType *T) {
// For fixed-sized types, we can emit concrete box metadata.
auto &fixedTI = cast<FixedTypeInfo>(eltTI);
// For empty types, we don't really need to allocate anything.
// Because we assume in enum's that payloads with a Builtin.NativeObject which
// is also the type for indirect enum cases have extra inhabitants of pointers
// we can't have a nil pointer as a representation for an empty box type --
// nil conflicts with the extra inhabitants. We return a static singleton
// empty box object instead.
if (fixedTI.isKnownEmpty(ResilienceExpansion::Maximal)) {
if (!EmptyBoxTI)
EmptyBoxTI = new EmptyBoxTypeInfo(IGM);