vector casts never reinterpret bits

llvm-svn: 27354
This commit is contained in:
Chris Lattner 2006-04-02 05:40:28 +00:00
parent ebca476b27
commit 7ee10dec05
1 changed files with 5 additions and 0 deletions

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;