diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-08 02:44:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-08 02:44:12 +0000 |
commit | 8f77daef04355c00b78b645f5aae5694e7a8b631 (patch) | |
tree | 44b5b785fe68c331d24b79ca5f6faa3850b9d586 /lib/Bytecode/Writer/InstructionWriter.cpp | |
parent | 97b315a58581261ec4bd6430ec9b438ba5fb728e (diff) |
Add support for the new va_arg instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/InstructionWriter.cpp')
-rw-r--r-- | lib/Bytecode/Writer/InstructionWriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp index 587e6d1be6..63aede198e 100644 --- a/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/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<CastInst>(I), Out); + output_vbr(NumArgs + (isa<CastInst>(I) || isa<VarArgInst>(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<CastInst>(I)) { + if (isa<CastInst>(I) || isa<VarArgInst>(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<CastInst>(I)) { + if (isa<CastInst>(I) || isa<VarArgInst>(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()); |