[SIL] Added strong_copy_weak_value.

The new instruction unwraps an `@sil_weak` box and produces an owned
value. It is only legal in opaque values mode and is transformed by
`AddressLowering` to `load_weak`.
This commit is contained in:
Nate Chandler
2023-07-31 07:13:12 -07:00
parent c44b23c954
commit e135c5cac7
22 changed files with 265 additions and 106 deletions

View File

@@ -8098,6 +8098,17 @@ class ExplicitCopyValueInst
: UnaryInstructionBase(DebugLoc, operand, operand->getType()) {}
};
#define NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
class StrongCopy##Name##ValueInst \
: public UnaryInstructionBase< \
SILInstructionKind::StrongCopy##Name##ValueInst, \
SingleValueInstruction> { \
friend class SILBuilder; \
StrongCopy##Name##ValueInst(SILDebugLocation DebugLoc, SILValue operand, \
SILType type) \
: UnaryInstructionBase(DebugLoc, operand, \
type.getReferenceStorageReferentType()) {} \
};
#define UNCHECKED_REF_STORAGE(Name, ...) \
class StrongCopy##Name##ValueInst \
: public UnaryInstructionBase< \
@@ -8108,7 +8119,6 @@ class ExplicitCopyValueInst
SILType type) \
: UnaryInstructionBase(DebugLoc, operand, type) {} \
};
#define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
class StrongCopy##Name##ValueInst \
: public UnaryInstructionBase< \