aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-04-08 16:17:08 -0700
committerChristopher Tetreault <ctetreau@quicinc.com>2020-04-08 16:29:36 -0700
commitfe69eb119657e9c1b56f4e7818be7c46752ac116 (patch)
tree613983ca6563a8f22ffef11e8f2e5a7bf370bcdf /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent49fd24fe9e45cade2763acbce59e683aebc3d13a (diff)
downloadllvm-fe69eb119657e9c1b56f4e7818be7c46752ac116.zip
llvm-fe69eb119657e9c1b56f4e7818be7c46752ac116.tar.gz
llvm-fe69eb119657e9c1b56f4e7818be7c46752ac116.tar.bz2
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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 6a72ed8..153388b 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -4168,7 +4168,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
if (!Vec->getType()->isVectorTy())
return error("Invalid type for value");
I = ExtractElementInst::Create(Vec, Idx);
- FullTy = FullTy->getVectorElementType();
+ FullTy = cast<VectorType>(FullTy)->getElementType();
InstructionList.push_back(I);
break;
}
@@ -4202,8 +4202,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
return error("Invalid type for value");
I = new ShuffleVectorInst(Vec1, Vec2, Mask);
- FullTy = VectorType::get(FullTy->getVectorElementType(),
- Mask->getType()->getVectorElementCount());
+ FullTy =
+ VectorType::get(cast<VectorType>(FullTy)->getElementType(),
+ cast<VectorType>(Mask->getType())->getElementCount());
InstructionList.push_back(I);
break;
}
@@ -5195,8 +5196,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
!FullTy->isPointerTy() && !isa<StructType>(FullTy) &&
!isa<ArrayType>(FullTy) &&
(!isa<VectorType>(FullTy) ||
- FullTy->getVectorElementType()->isFloatingPointTy() ||
- FullTy->getVectorElementType()->isIntegerTy()) &&
+ cast<VectorType>(FullTy)->getElementType()->isFloatingPointTy() ||
+ cast<VectorType>(FullTy)->getElementType()->isIntegerTy()) &&
"Structured types must be assigned with corresponding non-opaque "
"pointer type");
}