diff options
| author | Dan Gohman <gohman@apple.com> | 2009-07-27 21:53:46 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-07-27 21:53:46 +0000 |
| commit | 106b2ae077265a00db914776c8eafa21694ae696 (patch) | |
| tree | 635ee4ff5a89aefb2eb5ba8394207f65c8771bcf /lib/Bitcode/Writer | |
| parent | 9a7b61d639628292b88f94404016bb3e1b4429bb (diff) | |
| download | external_llvm-106b2ae077265a00db914776c8eafa21694ae696.zip external_llvm-106b2ae077265a00db914776c8eafa21694ae696.tar.gz external_llvm-106b2ae077265a00db914776c8eafa21694ae696.tar.bz2 | |
Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
| -rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index b312420..fd09ede 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/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; |
