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:
Andrew Trick
2015-10-10 05:42:53 +00:00
parent 9009c5e7bd
commit 57a450b28f
37 changed files with 419 additions and 429 deletions

View File

@@ -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.