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
This commit is contained in:
Jay Foad
2011-07-21 14:31:17 +00:00
parent 14732a1f42
commit dab3d29605
20 changed files with 99 additions and 106 deletions

View File

@ -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#]