Do not pessimize users of this function. Fix logic.
authorChris Lattner <sabre@nondot.org>
Thu, 6 Dec 2001 18:06:37 +0000 (18:06 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 6 Dec 2001 18:06:37 +0000 (18:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1428 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index e0af0cbc45b38f8298613aa77d1bcd803503e18a..b13bb602f7c20524b21c912f88b318955eedd1d2 100644 (file)
@@ -72,8 +72,8 @@ const Type *Type::getPrimitiveType(PrimitiveID IDNumber) {
 //
 bool Type::isLosslesslyConvertableTo(const Type *Ty) const {
   if (this == Ty) return true;
-  if ((!isPrimitiveType() && !Ty->isPointerType()) ||
-      (!isPointerType()   && !Ty->isPrimitiveType())) return false;
+  if ((!isPrimitiveType()   && !isPointerType()) ||
+      (!Ty->isPointerType() && !Ty->isPrimitiveType())) return false;
 
   if (getPrimitiveID() == Ty->getPrimitiveID())
     return true;  // Handles identity cast, and cast of differing pointer types