[LLVMdev] Seemingly ambiguous parameter lists
Chris Lattner
sabre at nondot.org
Tue Aug 26 16:07:08 PDT 2003
On Tue, 26 Aug 2003, Robert Mykland wrote:
> And while we're on the subject to the type definitions table, what's the
> difference between
>
> 0e 07 01 00
> function returning Int ( Void )? Function returning Int ( ... )?
Void is not a legal argument. The bytecode file uses the void marker as
a way to store the ... for a varargs function. IE, the declaration:
void foo(void);
in C, becomes the LLVM type 'void ()*' %foo. The C declaration:
void foo(...);
becomes the LLVM type 'void (...)*' %foo, which is stored in the bytecode
file (to be compact) as 'void (void)*'.
> 0e 07 00
> Function returning Int ()
That is just 'int ()', function returning int, with no arguments.
> I'm guessing the former really is a function returning Int ( ... ), but how
> is the callee supposed to decode the parameter list? I'm an old callee and
> I don't know this new trick. :-)
Void is not a legal argument type, it is just used as a marker in the
bytecode files. :)
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/
More information about the llvm-dev
mailing list