diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -4164,7 +4164,7 @@ if (!Vec->getType()->isVectorTy()) return error("Invalid type for value"); I = ExtractElementInst::Create(Vec, Idx); - FullTy = FullTy->getVectorElementType(); + FullTy = cast(FullTy)->getElementType(); InstructionList.push_back(I); break; } @@ -4198,8 +4198,9 @@ return error("Invalid type for value"); I = new ShuffleVectorInst(Vec1, Vec2, Mask); - FullTy = VectorType::get(FullTy->getVectorElementType(), - Mask->getType()->getVectorElementCount()); + FullTy = + VectorType::get(cast(FullTy)->getElementType(), + cast(Mask->getType())->getElementCount()); InstructionList.push_back(I); break; } @@ -5191,8 +5192,8 @@ !FullTy->isPointerTy() && !isa(FullTy) && !isa(FullTy) && (!isa(FullTy) || - FullTy->getVectorElementType()->isFloatingPointTy() || - FullTy->getVectorElementType()->isIntegerTy()) && + cast(FullTy)->getElementType()->isFloatingPointTy() || + cast(FullTy)->getElementType()->isIntegerTy()) && "Structured types must be assigned with corresponding non-opaque " "pointer type"); }