mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several callers - I'll essentially just have to keep pushing that up the stack until I can eliminate every call to it... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2831,7 +2831,10 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
||||
!BasePointerType->getElementType()->isSized(&Visited))
|
||||
return Error(ID.Loc, "base element of getelementptr must be sized");
|
||||
|
||||
if (!GetElementPtrInst::getIndexedType(Elts[0]->getType(), Indices))
|
||||
if (!GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(Elts[0]->getType()->getScalarType())
|
||||
->getElementType(),
|
||||
Indices))
|
||||
return Error(ID.Loc, "invalid getelementptr indices");
|
||||
ID.ConstantVal = ConstantExpr::getGetElementPtr(Elts[0], Indices,
|
||||
InBounds);
|
||||
@@ -5523,7 +5526,9 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
!BasePointerType->getElementType()->isSized(&Visited))
|
||||
return Error(Loc, "base element of getelementptr must be sized");
|
||||
|
||||
if (!GetElementPtrInst::getIndexedType(BaseType, Indices))
|
||||
if (!GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(BaseType->getScalarType())->getElementType(),
|
||||
Indices))
|
||||
return Error(Loc, "invalid getelementptr indices");
|
||||
Inst = GetElementPtrInst::Create(Ty, Ptr, Indices);
|
||||
if (InBounds)
|
||||
|
Reference in New Issue
Block a user