diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-07-08 04:57:15 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-07-08 04:57:15 +0000 |
| commit | a682182f6485caf4f2bb23d2fe7f2e1d10d9fb2a (patch) | |
| tree | ac566bc85cd22b41c0f530d82937408cd7c5e79a /llvm/lib/Bytecode/Writer/InstructionWriter.cpp | |
| parent | 52112fb34e6846c33208bab143b7815eefcb0421 (diff) | |
| download | bcm5719-llvm-a682182f6485caf4f2bb23d2fe7f2e1d10d9fb2a.tar.gz bcm5719-llvm-a682182f6485caf4f2bb23d2fe7f2e1d10d9fb2a.zip | |
Neg instruction removed. Cast instruction implemented.
llvm-svn: 156
Diffstat (limited to 'llvm/lib/Bytecode/Writer/InstructionWriter.cpp')
| -rw-r--r-- | llvm/lib/Bytecode/Writer/InstructionWriter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp index 3bd9a0902b6..34d95682bfe 100644 --- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp @@ -145,6 +145,15 @@ bool BytecodeWriter::processInstruction(const Instruction *I) { assert(Slot != -1 && "Type not available!!?!"); Type = (unsigned)Slot; + // Handle the special case for cast... + if (I->getOpcode() == Instruction::Cast) { + // Cast has to encode the destination type as the second argument in the + // packet, or else we won't know what type to cast to! + Slots[1] = Table.getValSlot(I->getType()); + assert(Slots[1] != -1 && "Cast return type unknown?"); + if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1]; + NumOperands++; + } // Decide which instruction encoding to use. This is determined primarily by // the number of operands, and secondarily by whether or not the max operand |

