aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-03 17:17:02 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-03 17:17:02 +0000
commit9f132765a2d8277f8cc4a4053542b19940862aad (patch)
treec4f19727b85af36ced440a5ed4fa83958f49ab01 /lib/Bytecode/Writer/Writer.cpp
parent42ddd84addeabef697be2d2f7e33c8f8acb446d9 (diff)
Support ICmp/FCmp constant expression reading and writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 9cf61c6ee2..127a3bac00 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/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);