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/Bitcode/Reader | |
parent | 14732a1f42e9df9c4ca4f6403f67de27b563fcbb (diff) | |
download | external_llvm-dab3d29605a5c83db41b28176273ef55961120c1.zip external_llvm-dab3d29605a5c83db41b28176273ef55961120c1.tar.gz external_llvm-dab3d29605a5c83db41b28176273ef55961120c1.tar.bz2 |
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/Bitcode/Reader')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 374a041..910987a 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/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#] |