diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-31 00:58:22 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-31 00:58:22 +0000 |
commit | 1ecaf45cf17780f1761147f53cf0f8c5d363a35a (patch) | |
tree | a0f9e8a4cc2ada33880c625fbdeb6fb58a089c5a /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | a3774667d3b490d10a208695b2ce147414f59a8f (diff) | |
download | bcm5719-llvm-1ecaf45cf17780f1761147f53cf0f8c5d363a35a.tar.gz bcm5719-llvm-1ecaf45cf17780f1761147f53cf0f8c5d363a35a.zip |
IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.
There's definately more to come here, but I'm checking this
basic support in now to make it available to people who are
interested.
llvm-svn: 51806
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index cb5963cb8e9..376cc056392 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -610,20 +610,26 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal, Record.push_back(VE.getValueID(C->getOperand(i))); } break; - case Instruction::ExtractValue: + case Instruction::ExtractValue: { Code = bitc::CST_CODE_CE_EXTRACTVAL; - 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))); - } + Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); + Record.push_back(VE.getValueID(C->getOperand(0))); + const SmallVector<unsigned, 4> &Indices = CE->getIndices(); + for (unsigned i = 0, e = Indices.size(); i != e; ++i) + Record.push_back(Indices[i]); break; - case Instruction::InsertValue: + } + case Instruction::InsertValue: { Code = bitc::CST_CODE_CE_INSERTVAL; - 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))); - } + Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); + Record.push_back(VE.getValueID(C->getOperand(0))); + Record.push_back(VE.getTypeID(C->getOperand(1)->getType())); + Record.push_back(VE.getValueID(C->getOperand(1))); + const SmallVector<unsigned, 4> &Indices = CE->getIndices(); + for (unsigned i = 0, e = Indices.size(); i != e; ++i) + Record.push_back(Indices[i]); break; + } case Instruction::Select: Code = bitc::CST_CODE_CE_SELECT; Record.push_back(VE.getValueID(C->getOperand(0))); |