diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
| commit | d288fb86810bbac1c2890b70e9ecd6f03744dfa7 (patch) | |
| tree | 22054f443f756bd7ca2d32649f00aaea4ebf4245 /llvm/lib/AsmParser | |
| parent | 0d68b4c5ed89f1c8a9e4466badf69de159ee20d7 (diff) | |
| download | bcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.tar.gz bcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.zip | |
[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...
llvm-svn: 233604
Diffstat (limited to 'llvm/lib/AsmParser')
| -rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 75ff79094a2..dc348e4d4b7 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -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) |

