summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
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/Writer
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/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index b3124204903..fd09edec942 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -706,6 +706,8 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
break;
case Instruction::GetElementPtr:
Code = bitc::CST_CODE_CE_GEP;
+ if (cast<GEPOperator>(C)->isInBounds())
+ Code = bitc::CST_CODE_CE_INBOUNDS_GEP;
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
Record.push_back(VE.getTypeID(C->getOperand(i)->getType()));
Record.push_back(VE.getValueID(C->getOperand(i)));
@@ -829,6 +831,8 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
case Instruction::GetElementPtr:
Code = bitc::FUNC_CODE_INST_GEP;
+ if (cast<GEPOperator>(&I)->isInBounds())
+ Code = bitc::FUNC_CODE_INST_INBOUNDS_GEP;
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
PushValueAndType(I.getOperand(i), InstID, Vals, VE);
break;
OpenPOWER on IntegriCloud