Fix a bug when compiling 'shl ubyte * %var, ubyte 2'
authorChris Lattner <sabre@nondot.org>
Wed, 25 Jul 2001 22:47:32 +0000 (22:47 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Jul 2001 22:47:32 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Expressions.cpp

index 07fb8c4ff15f2335c01dd05ea4b6f89dc0c21dd6..f7342963e623e3c9324549119f47f8bee0696e16 100644 (file)
@@ -62,6 +62,7 @@ static ConstPoolInt *getIntegralConstant(ConstantPool &CP, unsigned char V,
 static ConstPoolInt *getUnsignedConstant(ConstantPool &CP, uint64_t V,
                                         const Type *Ty) {
   // FIXME: Lookup prexisting constant in table!
+  if (Ty->isPointerType()) Ty = Type::ULongTy;
 
   ConstPoolInt *CPI;
   CPI = Ty->isSigned() ? new ConstPoolSInt(Ty, V) : new ConstPoolUInt(Ty, V);
@@ -273,7 +274,7 @@ ExprType analysis::ClassifyExpression(Value *Expr) {
     assert(CPV->getType()->isIntegral() && "Must have an integral type!");
     return (ConstPoolInt*)CPV;
   } // end case Instruction::Cast
-    // TODO: Handle SUB (at least!)
+    // TODO: Handle SUB, SHR?
 
   }  // end switch