[nfc] rename or eliminate isPureMoveOnly APIs

I think from SIL's perspective, it should only worry about whether the
type is move-only. That includes MoveOnlyWrapped SILTypes and regular
types that cannot be copied.

Most of the code querying `SILType::isPureMoveOnly` is in SILGen, where
it's very likely that the original AST type is sitting around already.
In such cases, I think it's fine to ask the AST type if it is
noncopyable. The clarity of only asking the ASTType if it's noncopyable
is beneficial, I think.
This commit is contained in:
Kavon Farvardin
2023-09-20 14:45:09 -07:00
parent c01360d02e
commit f1142d5da4
30 changed files with 65 additions and 71 deletions

View File

@@ -530,7 +530,7 @@ static ManagedValue createInputFunctionArgument(
"Function arguments of non-bare functions must have a decl");
auto *arg = F.begin()->createFunctionArgument(type, decl);
if (auto *pd = dyn_cast_or_null<ParamDecl>(decl)) {
if (!arg->getType().isPureMoveOnly()) {
if (!arg->getType().getASTType()->isNoncopyable()) {
isNoImplicitCopy |= pd->getSpecifier() == ParamSpecifier::Borrowing;
isNoImplicitCopy |= pd->getSpecifier() == ParamSpecifier::Consuming;
}