From ed8db7d9df395497d54ea9cecf1cecdad674cd7e Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 21 Jul 2011 14:31:17 +0000 Subject: Convert ConstantExpr::getGetElementPtr and ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') 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 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#] -- cgit v1.2.3