[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

@@ -266,7 +266,7 @@ getTypeRefByFunction(IRGenModule &IGM,
// If a type is noncopyable, lie about the resolved type unless the
// runtime is sufficiently aware of noncopyable types.
if (substT->isPureMoveOnly()) {
if (substT->isNoncopyable()) {
// Darwin-based platforms have ABI stability, and we want binaries
// that use noncopyable types nongenerically today to be forward
// compatible with a future OS runtime that supports noncopyable
@@ -391,7 +391,7 @@ getTypeRefImpl(IRGenModule &IGM,
// noncopyable, use a function to emit the type ref which will look for a
// signal from future runtimes whether they support noncopyable types before
// exposing their metadata to them.
if (type->isPureMoveOnly()) {
if (type->isNoncopyable()) {
IGM.IRGen.noteUseOfTypeMetadata(type);
return getTypeRefByFunction(IGM, sig, type);
}