summaryrefslogtreecommitdiffstats
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
commit7ee10dec05cdf2ddf24239aa8794402d77f385aa (patch)
tree98029065e11d3c8e554345cbac3a7884af07158f
parentebca476b274deb26fe8e598c95ea91a622b8bb32 (diff)
downloadbcm5719-llvm-7ee10dec05cdf2ddf24239aa8794402d77f385aa.tar.gz
bcm5719-llvm-7ee10dec05cdf2ddf24239aa8794402d77f385aa.zip
vector casts never reinterpret bits
llvm-svn: 27354
-rw-r--r--llvm/lib/VMCore/Type.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 59467c2122a..767df24f279 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud