diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-07-25 09:48:08 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-07-25 09:48:08 +0000 |
commit | a9203109f4ac95aa7e9624f2838e3d89623ec902 (patch) | |
tree | 49efd5cde506bb3127e6c0b4a4b8f504d5466dcf /lib/AsmParser | |
parent | b7fbcc9696e38ca26c7eb67077c04b51c846c9cb (diff) |
Convert GetElementPtrInst to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 4b20d03006..7164ae1ba5 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2274,9 +2274,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { return Error(ID.Loc, "getelementptr requires pointer operand"); ArrayRef<Constant *> Indices(Elts.begin() + 1, Elts.end()); - if (!GetElementPtrInst::getIndexedType(Elts[0]->getType(), - (Value**)(Elts.data() + 1), - Elts.size() - 1)) + if (!GetElementPtrInst::getIndexedType(Elts[0]->getType(), Indices)) return Error(ID.Loc, "invalid indices for getelementptr"); ID.ConstantVal = ConstantExpr::getGetElementPtr(Elts[0], Indices, InBounds); @@ -3660,10 +3658,9 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) { Indices.push_back(Val); } - if (!GetElementPtrInst::getIndexedType(Ptr->getType(), - Indices.begin(), Indices.end())) + if (!GetElementPtrInst::getIndexedType(Ptr->getType(), Indices)) return Error(Loc, "invalid getelementptr indices"); - Inst = GetElementPtrInst::Create(Ptr, Indices.begin(), Indices.end()); + Inst = GetElementPtrInst::Create(Ptr, Indices); if (InBounds) cast<GetElementPtrInst>(Inst)->setIsInBounds(true); return AteExtraComma ? InstExtraComma : InstNormal; |