summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
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/Bitcode/Reader/BitcodeReader.cpp
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/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 374a0418c95..910987a472d 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1351,12 +1351,11 @@ bool BitcodeReader::ParseConstants() {
if (!ElTy) return Error("Invalid CE_GEP record");
Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy));
}
+ ArrayRef<Constant *> Indices(Elts.begin() + 1, Elts.end());
if (BitCode == bitc::CST_CODE_CE_INBOUNDS_GEP)
- V = ConstantExpr::getInBoundsGetElementPtr(Elts[0], &Elts[1],
- Elts.size()-1);
+ V = ConstantExpr::getInBoundsGetElementPtr(Elts[0], Indices);
else
- V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1],
- Elts.size()-1);
+ V = ConstantExpr::getGetElementPtr(Elts[0], Indices);
break;
}
case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
OpenPOWER on IntegriCloud