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