mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
handle upcast instructions in statically initialized globals
This allows statically initialized multi-dimensional arrays in embedded swift.
This commit is contained in:
@@ -2714,6 +2714,15 @@ MetatypeInst *MetatypeInst::create(SILDebugLocation Loc, SILType Ty,
|
||||
return ::new (Buffer) MetatypeInst(Loc, Ty, TypeDependentOperands);
|
||||
}
|
||||
|
||||
UpcastInst *UpcastInst::create(SILDebugLocation DebugLoc, SILValue Operand,
|
||||
SILType Ty, SILModule &Mod,
|
||||
ValueOwnershipKind forwardingOwnershipKind) {
|
||||
unsigned size = totalSizeToAlloc<swift::Operand>(1);
|
||||
void *Buffer = Mod.allocateInst(size, alignof(UpcastInst));
|
||||
return ::new (Buffer) UpcastInst(DebugLoc, Operand, {}, Ty,
|
||||
forwardingOwnershipKind);
|
||||
}
|
||||
|
||||
UpcastInst *UpcastInst::create(SILDebugLocation DebugLoc, SILValue Operand,
|
||||
SILType Ty, SILFunction &F,
|
||||
ValueOwnershipKind forwardingOwnershipKind) {
|
||||
|
||||
Reference in New Issue
Block a user