From 2f5fc8c67d9c7220a3fe8940c00aa274cedbbaf0 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 21 Jul 2011 15:15:37 +0000 Subject: Make better use of ConstantExpr::getGetElementPtr's InBounds parameter. llvm-svn: 135676 --- 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 910987a472d..e8e8c2a7b6f 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1352,10 +1352,9 @@ bool BitcodeReader::ParseConstants() { 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], Indices); - else - V = ConstantExpr::getGetElementPtr(Elts[0], Indices); + V = ConstantExpr::getGetElementPtr(Elts[0], Indices, + BitCode == + bitc::CST_CODE_CE_INBOUNDS_GEP); break; } case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#] -- cgit v1.2.3