mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[semantic-sil] Ensure that all function arguments have the correct ownership kind and create a verifier check that this is preserved.
rdar://29791263
This commit is contained in:
@@ -124,7 +124,11 @@ void SILBasicBlock::cloneArgumentList(SILBasicBlock *Other) {
|
||||
SILFunctionArgument *SILBasicBlock::createFunctionArgument(SILType Ty,
|
||||
const ValueDecl *D) {
|
||||
assert(isEntry() && "Function Arguments can only be in the entry block");
|
||||
auto OwnershipKind = ValueOwnershipKind::Any;
|
||||
SILFunction *Parent = getParent();
|
||||
auto OwnershipKind = ValueOwnershipKind(
|
||||
Parent->getModule(), Ty,
|
||||
Parent->getLoweredFunctionType()->getSILArgumentConvention(
|
||||
getNumArguments()));
|
||||
return new (getModule()) SILFunctionArgument(this, Ty, OwnershipKind, D);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user