From f70da10697770f1d4015d7ecd35fd8664c4d0228 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 8 May 2003 02:44:12 +0000 Subject: Add support for the new va_arg instruction llvm-svn: 6029 --- llvm/lib/Bytecode/Writer/InstructionWriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Bytecode/Writer/InstructionWriter.cpp') diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp index 587e6d1be62..63aede198e4 100644 --- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp @@ -35,7 +35,7 @@ static void outputInstructionFormat0(const Instruction *I, output_vbr(Type, Out); // Result type unsigned NumArgs = I->getNumOperands(); - output_vbr(NumArgs + isa(I), Out); + output_vbr(NumArgs + (isa(I) || isa(I)), Out); for (unsigned i = 0; i < NumArgs; ++i) { int Slot = Table.getValSlot(I->getOperand(i)); @@ -43,9 +43,9 @@ static void outputInstructionFormat0(const Instruction *I, output_vbr((unsigned)Slot, Out); } - if (isa(I)) { + if (isa(I) || isa(I)) { int Slot = Table.getValSlot(I->getType()); - assert(Slot != -1 && "Cast return type unknown?"); + assert(Slot != -1 && "Cast/VarArg return type unknown?"); output_vbr((unsigned)Slot, Out); } @@ -218,7 +218,7 @@ void BytecodeWriter::processInstruction(const Instruction &I) { if (Slot > MaxOpSlot) MaxOpSlot = Slot; // Handle the special case for cast... - if (isa(I)) { + if (isa(I) || isa(I)) { // 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()); -- cgit v1.2.3