mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-13 11:22:03 +00:00
[SVE] Remove calls to VectorType::getNumElements from AsmParser
Reviewers: efriedma, RKSimon, c-rhodes, fpetrogalli Reviewed By: fpetrogalli Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82208
This commit is contained in:
parent
887c0b5665
commit
433c9adf7b
@ -3650,9 +3650,10 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
||||
ExplicitTypeLoc,
|
||||
"explicit pointee type doesn't match operand's pointee type");
|
||||
|
||||
unsigned GEPWidth = BaseType->isVectorTy()
|
||||
? cast<VectorType>(BaseType)->getNumElements()
|
||||
: 0;
|
||||
unsigned GEPWidth =
|
||||
BaseType->isVectorTy()
|
||||
? cast<FixedVectorType>(BaseType)->getNumElements()
|
||||
: 0;
|
||||
|
||||
ArrayRef<Constant *> Indices(Elts.begin() + 1, Elts.end());
|
||||
for (Constant *Val : Indices) {
|
||||
@ -3660,7 +3661,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
||||
if (!ValTy->isIntOrIntVectorTy())
|
||||
return Error(ID.Loc, "getelementptr index must be an integer");
|
||||
if (auto *ValVTy = dyn_cast<VectorType>(ValTy)) {
|
||||
unsigned ValNumEl = ValVTy->getNumElements();
|
||||
unsigned ValNumEl = cast<FixedVectorType>(ValVTy)->getNumElements();
|
||||
if (GEPWidth && (ValNumEl != GEPWidth))
|
||||
return Error(
|
||||
ID.Loc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user