diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-25 22:47:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-25 22:47:55 +0000 |
commit | 90e0d464baa147c6255823cc41055f9f58dcabb9 (patch) | |
tree | 05274b778613cac7b57a397211e425264a7a21d3 /llvm/lib/Bytecode/Writer/ConstantWriter.cpp | |
parent | 42b5a8a6e5c4c8327d6a70c92ed80a459b60a684 (diff) | |
download | bcm5719-llvm-90e0d464baa147c6255823cc41055f9f58dcabb9.tar.gz bcm5719-llvm-90e0d464baa147c6255823cc41055f9f58dcabb9.zip |
Add support for extern varargs methods & varargs method calls
llvm-svn: 297
Diffstat (limited to 'llvm/lib/Bytecode/Writer/ConstantWriter.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/ConstantWriter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp index 7e2c9307b99..bac5a4c0502 100644 --- a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp +++ b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp @@ -28,6 +28,9 @@ void BytecodeWriter::outputType(const Type *T) { assert(Slot != -1 && "Type used but not available!!"); output_vbr((unsigned)Slot, Out); + // Output the number of arguments to method (+1 if varargs): + output_vbr(MT->getParamTypes().size()+MT->isVarArg(), Out); + // Output all of the arguments... MethodType::ParamTypes::const_iterator I = MT->getParamTypes().begin(); for (; I != MT->getParamTypes().end(); ++I) { @@ -36,8 +39,9 @@ void BytecodeWriter::outputType(const Type *T) { output_vbr((unsigned)Slot, Out); } - // Terminate list with VoidTy - output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out); + // Terminate list with VoidTy if we are a varargs function... + if (MT->isVarArg()) + output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out); break; } |