mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Generate unchecked_ref_cast, not unchecked_ref_bit_cast.
This improves support for promoting to and generating unchecked_ref_cast so we no longer need unchecked_ref_bit_cast, which will just go away in the next commit. Swift SVN r32597
This commit is contained in:
@@ -1527,12 +1527,6 @@ class UncheckedRefCastInst
|
||||
|
||||
UncheckedRefCastInst(SILLocation Loc, SILValue Operand, SILType Ty)
|
||||
: UnaryInstructionBase(Loc, Operand, Ty) {}
|
||||
|
||||
public:
|
||||
// Only reference cast heap objects with single pointer representation.
|
||||
static bool canRefCastType(SILType Ty) {
|
||||
return Ty.isHeapObjectReferenceType();
|
||||
}
|
||||
};
|
||||
|
||||
/// Converts a heap object reference to a different type without any runtime
|
||||
@@ -1611,16 +1605,6 @@ class UncheckedRefBitCastInst
|
||||
|
||||
UncheckedRefBitCastInst(SILLocation Loc, SILValue Operand, SILType Ty)
|
||||
: UnaryInstructionBase(Loc, Operand, Ty) {}
|
||||
|
||||
public:
|
||||
// Reference bitcast from representations with single pointer low bits.
|
||||
static bool canRefBitCastFromType(SILType Ty) {
|
||||
return Ty.isHeapObjectReferenceType() || Ty.isClassExistentialType();
|
||||
}
|
||||
// Only reference bitcast to simple single pointer representations.
|
||||
static bool canRefBitCastToType(SILType Ty) {
|
||||
return Ty.isHeapObjectReferenceType();
|
||||
}
|
||||
};
|
||||
|
||||
/// Bitwise copy a value into another value of the same size or smaller.
|
||||
|
||||
Reference in New Issue
Block a user