For PR1195:
[oota-llvm.git] / lib / Bytecode / Reader / Reader.cpp
index d16105153627eb50e880a26e23b34911c8712269..200f0d7a2fe3fa1080ea0eec02b792e71510484a 100644 (file)
@@ -482,12 +482,12 @@ void BytecodeReader::ParseInstruction(SmallVector<unsigned, 8> &Oprnds,
       break;
     }
     case Instruction::InsertElement: {
-      const PackedType *PackedTy = dyn_cast<PackedType>(InstTy);
-      if (!PackedTy || Oprnds.size() != 3)
+      const VectorType *VectorTy = dyn_cast<VectorType>(InstTy);
+      if (!VectorTy || Oprnds.size() != 3)
         error("Invalid insertelement instruction!");
       
       Value *V1 = getValue(iType, Oprnds[0]);
-      Value *V2 = getValue(getTypeSlot(PackedTy->getElementType()),Oprnds[1]);
+      Value *V2 = getValue(getTypeSlot(VectorTy->getElementType()),Oprnds[1]);
       Value *V3 = getValue(Int32TySlot, Oprnds[2]);
         
       if (!InsertElementInst::isValidOperands(V1, V2, V3))
@@ -496,13 +496,13 @@ void BytecodeReader::ParseInstruction(SmallVector<unsigned, 8> &Oprnds,
       break;
     }
     case Instruction::ShuffleVector: {
-      const PackedType *PackedTy = dyn_cast<PackedType>(InstTy);
-      if (!PackedTy || Oprnds.size() != 3)
+      const VectorType *VectorTy = dyn_cast<VectorType>(InstTy);
+      if (!VectorTy || Oprnds.size() != 3)
         error("Invalid shufflevector instruction!");
       Value *V1 = getValue(iType, Oprnds[0]);
       Value *V2 = getValue(iType, Oprnds[1]);
-      const PackedType *EltTy = 
-        PackedType::get(Type::Int32Ty, PackedTy->getNumElements());
+      const VectorType *EltTy = 
+        VectorType::get(Type::Int32Ty, VectorTy->getNumElements());
       Value *V3 = getValue(getTypeSlot(EltTy), Oprnds[2]);
       if (!ShuffleVectorInst::isValidOperands(V1, V2, V3))
         error("Invalid shufflevector instruction!");
@@ -1029,10 +1029,10 @@ const Type *BytecodeReader::ParseType() {
     Result =  ArrayType::get(ElementType, NumElements);
     break;
   }
-  case Type::PackedTyID: {
+  case Type::VectorTyID: {
     const Type *ElementType = readType();
     unsigned NumElements = read_vbr_uint();
-    Result =  PackedType::get(ElementType, NumElements);
+    Result =  VectorType::get(ElementType, NumElements);
     break;
   }
   case Type::StructTyID: {
@@ -1265,7 +1265,7 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
       Result = ConstantInt::get(IT, Val);
       if (Handler) Handler->handleConstantValue(Result);
     } else 
-      assert("Integer types > 64 bits not supported");
+      assert(0 && "Integer types > 64 bits not supported");
     break;
   }
   case Type::FloatTyID: {
@@ -1314,8 +1314,8 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
     break;
   }
 
-  case Type::PackedTyID: {
-    const PackedType *PT = cast<PackedType>(Ty);
+  case Type::VectorTyID: {
+    const VectorType *PT = cast<VectorType>(Ty);
     unsigned NumElements = PT->getNumElements();
     unsigned TypeSlot = getTypeSlot(PT->getElementType());
     std::vector<Constant*> Elements;
@@ -1323,8 +1323,8 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
     while (NumElements--)     // Read all of the elements of the constant.
       Elements.push_back(getConstantValue(TypeSlot,
                                           read_vbr_uint()));
-    Result = ConstantPacked::get(PT, Elements);
-    if (Handler) Handler->handleConstantPacked(PT, &Elements[0],Elements.size(),
+    Result = ConstantVector::get(PT, Elements);
+    if (Handler) Handler->handleConstantVector(PT, &Elements[0],Elements.size(),
                                                TypeSlot, Result);
     break;
   }