diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-07-21 14:31:17 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-07-21 14:31:17 +0000 |
commit | dab3d29605a5c83db41b28176273ef55961120c1 (patch) | |
tree | 12b71353630e2902c1f2d6ea9dfcbb8d974030f0 /lib/AsmParser/LLParser.cpp | |
parent | 14732a1f42e9df9c4ca4f6403f67de27b563fcbb (diff) |
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index c70731f018..32993f73ac 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2273,16 +2273,14 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { if (Elts.size() == 0 || !Elts[0]->getType()->isPointerTy()) 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)) return Error(ID.Loc, "invalid indices for getelementptr"); ID.ConstantVal = InBounds ? - ConstantExpr::getInBoundsGetElementPtr(Elts[0], - Elts.data() + 1, - Elts.size() - 1) : - ConstantExpr::getGetElementPtr(Elts[0], - Elts.data() + 1, Elts.size() - 1); + ConstantExpr::getInBoundsGetElementPtr(Elts[0], Indices) : + ConstantExpr::getGetElementPtr(Elts[0], Indices); } else if (Opc == Instruction::Select) { if (Elts.size() != 3) return Error(ID.Loc, "expected three operands to select"); |