diff options
-rw-r--r-- | lib/VMCore/Type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 59467c2122..767df24f27 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -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; |