SIL: fix a header-file layering violation: SILArgument.h should not include SILFunction.h

"Containers" should include their "content" and not the other way round.
Also, remove some unused stuff of SILArgument.
This commit is contained in:
Erik Eckstein
2021-01-21 22:08:08 +01:00
parent a0884baa3c
commit 2c7027da97
8 changed files with 53 additions and 83 deletions

View File

@@ -163,12 +163,15 @@ SILBasicBlock::createFunctionArgument(SILType Ty, const ValueDecl *D,
return new (getModule()) SILFunctionArgument(this, Ty, OwnershipKind, D);
}
SILFunctionArgument *SILBasicBlock::insertFunctionArgument(arg_iterator Iter,
SILFunctionArgument *SILBasicBlock::insertFunctionArgument(unsigned AtArgPos,
SILType Ty,
ValueOwnershipKind OwnershipKind,
const ValueDecl *D) {
assert(isEntry() && "Function Arguments can only be in the entry block");
return new (getModule()) SILFunctionArgument(this, Iter, Ty, OwnershipKind, D);
auto *arg = new (getModule()) SILFunctionArgument(Ty, OwnershipKind, D);
arg->parentBlock = this;
insertArgument(ArgumentList.begin() + AtArgPos, arg);
return arg;
}
SILFunctionArgument *SILBasicBlock::replaceFunctionArgument(
@@ -255,13 +258,16 @@ SILPhiArgument *SILBasicBlock::createPhiArgument(SILType Ty,
return new (getModule()) SILPhiArgument(this, Ty, Kind, D);
}
SILPhiArgument *SILBasicBlock::insertPhiArgument(arg_iterator Iter, SILType Ty,
SILPhiArgument *SILBasicBlock::insertPhiArgument(unsigned AtArgPos, SILType Ty,
ValueOwnershipKind Kind,
const ValueDecl *D) {
assert(!isEntry() && "PHI Arguments can not be in the entry block");
if (Ty.isTrivial(*getParent()))
Kind = OwnershipKind::None;
return new (getModule()) SILPhiArgument(this, Iter, Ty, Kind, D);
auto *arg = new (getModule()) SILPhiArgument(Ty, Kind, D);
arg->parentBlock = this;
insertArgument(ArgumentList.begin() + AtArgPos, arg);
return arg;
}
void SILBasicBlock::eraseArgument(int Index) {