Merge pull request #20855 from gottesmm/pr-94ee6e6c6e2d268f47f17dead77e4feb169c24e6

[ownership] Replace ValueOwnershipKind::Trivial with ValueOwnershipKi…
This commit is contained in:
Michael Gottesman
2018-12-05 14:47:04 -08:00
committed by GitHub
228 changed files with 1483 additions and 1699 deletions

View File

@@ -165,7 +165,7 @@ SILFunctionArgument *SILBasicBlock::replaceFunctionArgument(
assert(isEntry() && "Function Arguments can only be in the entry block");
SILModule &M = getParent()->getModule();
if (Ty.isTrivial(M))
Kind = ValueOwnershipKind::Trivial;
Kind = ValueOwnershipKind::Any;
assert(ArgumentList[i]->use_empty() && "Expected no uses of the old arg!");
@@ -190,7 +190,7 @@ SILPhiArgument *SILBasicBlock::replacePhiArgument(unsigned i, SILType Ty,
assert(!isEntry() && "PHI Arguments can not be in the entry block");
SILModule &M = getParent()->getModule();
if (Ty.isTrivial(M))
Kind = ValueOwnershipKind::Trivial;
Kind = ValueOwnershipKind::Any;
assert(ArgumentList[i]->use_empty() && "Expected no uses of the old BB arg!");
@@ -211,10 +211,8 @@ SILPhiArgument *SILBasicBlock::createPhiArgument(SILType Ty,
ValueOwnershipKind Kind,
const ValueDecl *D) {
assert(!isEntry() && "PHI Arguments can not be in the entry block");
assert(!getParent()->hasQualifiedOwnership() ||
Kind != ValueOwnershipKind::Any);
if (Ty.isTrivial(getModule()))
Kind = ValueOwnershipKind::Trivial;
Kind = ValueOwnershipKind::Any;
return new (getModule()) SILPhiArgument(this, Ty, Kind, D);
}
@@ -222,10 +220,8 @@ SILPhiArgument *SILBasicBlock::insertPhiArgument(arg_iterator Iter, SILType Ty,
ValueOwnershipKind Kind,
const ValueDecl *D) {
assert(!isEntry() && "PHI Arguments can not be in the entry block");
assert(!getParent()->hasQualifiedOwnership() ||
Kind != ValueOwnershipKind::Any);
if (Ty.isTrivial(getModule()))
Kind = ValueOwnershipKind::Trivial;
Kind = ValueOwnershipKind::Any;
return new (getModule()) SILPhiArgument(this, Iter, Ty, Kind, D);
}