aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-21 15:15:37 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-21 15:15:37 +0000
commit4b5e207bf24ea9799547a0634acaf7398b32897c (patch)
tree4abb1a538b5c1bb7d2c718bc1868348446d5c1f2 /lib/Bitcode
parentb60e851c03970291086966b3610be9485e1eec85 (diff)
downloadexternal_llvm-4b5e207bf24ea9799547a0634acaf7398b32897c.zip
external_llvm-4b5e207bf24ea9799547a0634acaf7398b32897c.tar.gz
external_llvm-4b5e207bf24ea9799547a0634acaf7398b32897c.tar.bz2
Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 910987a..e8e8c2a 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1352,10 +1352,9 @@ bool BitcodeReader::ParseConstants() {
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], 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#]