Skip to content

Commit 39ab02a

Browse files
Group base element type checks.
1 parent 64e41f8 commit 39ab02a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4538,12 +4538,12 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
45384538
if (!Indices.empty() && !Ty->isSized(&Visited))
45394539
return error(ID.Loc, "base element of getelementptr must be sized");
45404540

4541-
if (!GetElementPtrInst::getIndexedType(Ty, Indices))
4542-
return error(ID.Loc, "invalid getelementptr indices");
4543-
45444541
if (!ConstantExpr::isSupportedGetElementPtr(Ty))
45454542
return error(ID.Loc, "invalid base element for constant getelementptr");
45464543

4544+
if (!GetElementPtrInst::getIndexedType(Ty, Indices))
4545+
return error(ID.Loc, "invalid getelementptr indices");
4546+
45474547
ID.ConstantVal =
45484548
ConstantExpr::getGetElementPtr(Ty, Elts[0], Indices, NW, InRange);
45494549
} else if (Opc == Instruction::ShuffleVector) {

0 commit comments

Comments
 (0)