Changes in directory llvm/lib/Bytecode/Writer:
Writer.cpp updated: 1.130 -> 1.131 --- Log message: Implement reading and writing of the ICmp and FCmp instructions. --- Diffs of the changes: (+9 -0) Writer.cpp | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.130 llvm/lib/Bytecode/Writer/Writer.cpp:1.131 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.130 Tue Nov 28 18:19:40 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Sun Dec 3 00:28:54 2006 @@ -718,6 +718,15 @@ if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1]; NumOperands = 2; } + } else if (isa<ICmpInst>(I) || isa<FCmpInst>(I)) { + // We need to encode the compare instruction's predicate as the third + // operand. Its not really a slot, but we don't want to break the + // instruction format for these instructions. + NumOperands++; + assert(NumOperands == 3 && "CmpInst with wrong number of operands?"); + Slots[2] = unsigned(cast<CmpInst>(&I)->getPredicate()); + if (Slots[2] > MaxOpSlot) + MaxOpSlot = Slots[2]; } else if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I)) { // We need to encode the type of sequential type indices into their slot # unsigned Idx = 1; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits