mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user