IRGen: Intialize single case enum extrainhabitant value witness in generated code

Older Swift runtimes miss this initialization in the swift_initEnumMetadataSingleCase runtime call.

rdar://49786768
This commit is contained in:
Arnold Schwaighofer
2019-04-25 14:19:08 -07:00
parent 9850150c91
commit e2d3f533d6
6 changed files with 53 additions and 5 deletions

View File

@@ -228,6 +228,13 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
SizeTy // extra inhabitant flags (optional)
});
TypeLayoutTy = createStructType(*this, "swift.type_layout", {
SizeTy, // size
SizeTy, // stride
Int32Ty, // flags
Int32Ty // extra inhabitant count
});
// A protocol descriptor describes a protocol. It is not type metadata in
// and of itself, but is referenced in the structure of existential type
// metadata records.