vector casts never reinterpret bits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27354 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-04-02 05:40:28 +00:00
parent a1c3538537
commit a3124a3d1e

View File

@ -75,6 +75,11 @@ const Type *Type::getPrimitiveType(TypeID IDNumber) {
//
bool Type::isLosslesslyConvertibleTo(const Type *Ty) const {
if (this == Ty) return true;
// Packed type conversions are always bitwise.
if (isa<PackedType>(this) && isa<PackedType>(Ty))
return true;
if ((!isPrimitiveType() && !isa<PointerType>(this)) ||
(!isa<PointerType>(Ty) && !Ty->isPrimitiveType())) return false;