Skip to content

Commit fe69eb1

Browse files
Clean up usages of asserting vector getters in Type
Summary: Remove usages of asserting vector getters in Type in preparation for the VectorType refactor. The existence of these functions complicates the refactor while adding little value. Reviewers: espindola, efriedma, sdesmalen Reviewed By: efriedma Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77275
1 parent 49fd24f commit fe69eb1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4168,7 +4168,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
41684168
if (!Vec->getType()->isVectorTy())
41694169
return error("Invalid type for value");
41704170
I = ExtractElementInst::Create(Vec, Idx);
4171-
FullTy = FullTy->getVectorElementType();
4171+
FullTy = cast<VectorType>(FullTy)->getElementType();
41724172
InstructionList.push_back(I);
41734173
break;
41744174
}
@@ -4202,8 +4202,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
42024202
return error("Invalid type for value");
42034203

42044204
I = new ShuffleVectorInst(Vec1, Vec2, Mask);
4205-
FullTy = VectorType::get(FullTy->getVectorElementType(),
4206-
Mask->getType()->getVectorElementCount());
4205+
FullTy =
4206+
VectorType::get(cast<VectorType>(FullTy)->getElementType(),
4207+
cast<VectorType>(Mask->getType())->getElementCount());
42074208
InstructionList.push_back(I);
42084209
break;
42094210
}
@@ -5195,8 +5196,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
51955196
!FullTy->isPointerTy() && !isa<StructType>(FullTy) &&
51965197
!isa<ArrayType>(FullTy) &&
51975198
(!isa<VectorType>(FullTy) ||
5198-
FullTy->getVectorElementType()->isFloatingPointTy() ||
5199-
FullTy->getVectorElementType()->isIntegerTy()) &&
5199+
cast<VectorType>(FullTy)->getElementType()->isFloatingPointTy() ||
5200+
cast<VectorType>(FullTy)->getElementType()->isIntegerTy()) &&
52005201
"Structured types must be assigned with corresponding non-opaque "
52015202
"pointer type");
52025203
}

0 commit comments

Comments
 (0)