summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-21 14:31:17 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-21 14:31:17 +0000
commited8db7d9df395497d54ea9cecf1cecdad674cd7e (patch)
tree4da14cc7a50cc83e03bd6353a059c10b5a719eee /llvm/lib/AsmParser
parent95f1ebd41b103eba1cb64305e9cc924527a8744f (diff)
downloadbcm5719-llvm-ed8db7d9df395497d54ea9cecf1cecdad674cd7e.tar.gz
bcm5719-llvm-ed8db7d9df395497d54ea9cecf1cecdad674cd7e.zip
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index c70731f018c..32993f73acb 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/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");
OpenPOWER on IntegriCloud