diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-03 17:17:02 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-03 17:17:02 +0000 |
commit | 3e6b1ce614f9b090876e52c6eae49baa91d20eef (patch) | |
tree | f210190b24777eef20b17d0f1ec69c74b537b981 /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | c031269ee3069d836facafb3c6320cf497185c12 (diff) | |
download | bcm5719-llvm-3e6b1ce614f9b090876e52c6eae49baa91d20eef.tar.gz bcm5719-llvm-3e6b1ce614f9b090876e52c6eae49baa91d20eef.zip |
Support ICmp/FCmp constant expression reading and writing.
llvm-svn: 32160
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 9cf61c6ee21..127a3bac003 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -791,6 +791,13 @@ void BytecodeWriter::outputInstruction(const Instruction &I) { } } + // In the weird case of the ICmp or FCmp instructions, we need to also put + // out the instruction's predicate value. We do that here, after the + // instruction's type and operands have been written so we can reuse the + // code above. + if (const CmpInst* CI = dyn_cast<CmpInst>(&I)) + output_vbr((unsigned)CI->getPredicate()); + // If we weren't handled before here, we either have a large number of // operands or a large operand index that we are referring to. outputInstructionFormat0(&I, Opcode, Table, Type); |