diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -3650,9 +3650,10 @@ ExplicitTypeLoc, "explicit pointee type doesn't match operand's pointee type"); - unsigned GEPWidth = BaseType->isVectorTy() - ? cast(BaseType)->getNumElements() - : 0; + unsigned GEPWidth = + BaseType->isVectorTy() + ? cast(BaseType)->getNumElements() + : 0; ArrayRef Indices(Elts.begin() + 1, Elts.end()); for (Constant *Val : Indices) { @@ -3660,7 +3661,7 @@ if (!ValTy->isIntOrIntVectorTy()) return Error(ID.Loc, "getelementptr index must be an integer"); if (auto *ValVTy = dyn_cast(ValTy)) { - unsigned ValNumEl = ValVTy->getNumElements(); + unsigned ValNumEl = cast(ValVTy)->getNumElements(); if (GEPWidth && (ValNumEl != GEPWidth)) return Error( ID.Loc,