summaryrefslogtreecommitdiff
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-02 05:40:28 +0000
committerChris Lattner <sabre@nondot.org>2006-04-02 05:40:28 +0000
commita3124a3d1eb4349d22b4abaac3a08b4d112d87a5 (patch)
treec7efe07bae6452005d85aa54a9129923b82ad829 /lib/VMCore/Type.cpp
parenta1c3538537b853482479222b50810a16be7b04c9 (diff)
downloadllvm-a3124a3d1eb4349d22b4abaac3a08b4d112d87a5.tar.gz
llvm-a3124a3d1eb4349d22b4abaac3a08b4d112d87a5.tar.bz2
llvm-a3124a3d1eb4349d22b4abaac3a08b4d112d87a5.tar.xz
vector casts never reinterpret bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp5
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;