diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2020-04-22 14:42:44 +0100 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2020-04-22 14:57:28 +0100 |
commit | 78aa260df742bc1fbe252bffdb7a1da0613ef116 (patch) | |
tree | ff857afd862518f54f42d21c298f30027bb3f120 /llvm/lib/IR/Constants.cpp | |
parent | bcca6ae3cd6d8b259d428767fed3b13eca3db67c (diff) | |
download | llvm-78aa260df742bc1fbe252bffdb7a1da0613ef116.zip llvm-78aa260df742bc1fbe252bffdb7a1da0613ef116.tar.gz llvm-78aa260df742bc1fbe252bffdb7a1da0613ef116.tar.bz2 |
[NFC] Fix unused result of dyn_cast<VectorType> in non-assert build
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index 338029f..b86b747 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -1895,8 +1895,8 @@ Constant *ConstantExpr::getPtrToInt(Constant *C, Type *DstTy, assert(DstTy->isIntOrIntVectorTy() && "PtrToInt destination must be integer or integer vector"); assert(isa<VectorType>(C->getType()) == isa<VectorType>(DstTy)); - if (auto *CVTy = dyn_cast<VectorType>(C->getType())) - assert(CVTy->getNumElements() == + if (isa<VectorType>(C->getType())) + assert(cast<VectorType>(C->getType())->getNumElements() == cast<VectorType>(DstTy)->getNumElements() && "Invalid cast between a different number of vector elements"); return getFoldedCast(Instruction::PtrToInt, C, DstTy, OnlyIfReduced); @@ -1909,8 +1909,8 @@ Constant *ConstantExpr::getIntToPtr(Constant *C, Type *DstTy, assert(DstTy->isPtrOrPtrVectorTy() && "IntToPtr destination must be a pointer or pointer vector"); assert(isa<VectorType>(C->getType()) == isa<VectorType>(DstTy)); - if (auto *CVTy = dyn_cast<VectorType>(C->getType())) - assert(CVTy->getNumElements() == + if (isa<VectorType>(C->getType())) + assert(cast<VectorType>(C->getType())->getNumElements() == cast<VectorType>(DstTy)->getNumElements() && "Invalid cast between a different number of vector elements"); return getFoldedCast(Instruction::IntToPtr, C, DstTy, OnlyIfReduced); |