summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-27 21:53:46 +0000
committerDan Gohman <gohman@apple.com>2009-07-27 21:53:46 +0000
commit1639c3905e934654195318aba00f7eae3d5d677f (patch)
tree480fc9d2338e97b45b6fd2b06657dd8f23620dfe /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent52d03b252eb4abae3ad24c5757ffe683bf3620d6 (diff)
downloadbcm5719-llvm-1639c3905e934654195318aba00f7eae3d5d677f.tar.gz
bcm5719-llvm-1639c3905e934654195318aba00f7eae3d5d677f.zip
Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details. llvm-svn: 77259
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 687cae9ecf6..e1cc1a3afba 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -997,6 +997,7 @@ bool BitcodeReader::ParseConstants() {
}
break;
}
+ case bitc::CST_CODE_CE_INBOUNDS_GEP:
case bitc::CST_CODE_CE_GEP: { // CE_GEP: [n x operands]
if (Record.size() & 1) return Error("Invalid CE_GEP record");
SmallVector<Constant*, 16> Elts;
@@ -1007,6 +1008,8 @@ bool BitcodeReader::ParseConstants() {
}
V = Context.getConstantExprGetElementPtr(Elts[0], &Elts[1],
Elts.size()-1);
+ if (BitCode == bitc::CST_CODE_CE_INBOUNDS_GEP)
+ cast<GEPOperator>(V)->setIsInBounds(true);
break;
}
case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
@@ -1556,6 +1559,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
I = CastInst::Create((Instruction::CastOps)Opc, Op, ResTy);
break;
}
+ case bitc::FUNC_CODE_INST_INBOUNDS_GEP:
case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands]
unsigned OpNum = 0;
Value *BasePtr;
@@ -1571,6 +1575,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
}
I = GetElementPtrInst::Create(BasePtr, GEPIdx.begin(), GEPIdx.end());
+ if (BitCode == bitc::FUNC_CODE_INST_INBOUNDS_GEP)
+ cast<GEPOperator>(I)->setIsInBounds(true);
break;
}
OpenPOWER on IntegriCloud