[LLVMdev] parameter attributes and function types

james woodyatt jhw at conjury.org
Mon Mar 1 20:20:16 PST 2010


On Mar 1, 2010, at 09:56, james woodyatt wrote:
> On Mar 1, 2010, at 04:43, Duncan Sands wrote:
>> 
>> Where exactly?  I don't see it in the online version.
> 
> See <http://llvm.org/docs/LangRef.html#t_function> and look at the second example:
> 
> 	float (i16 signext, i32 *) *
> 
> 	Pointer to a function that takes an i16 that should be sign extended
> 	and a pointer to i32, returning float.
> 
> Hence, my confusion over the issue.  If parameter attributes aren't included in function types, then I'd like to know how to call a function through a pointer of the type in the example above.  I must be failing still to comprehend an important concept in the language.

I'm sorry to pester about this, but I was really hoping somebody could straighten me out about this.  The Language Reference really does seem to be ambiguous about this, and I'm willing to compose a patch to fix it, but I need to know what the document should actually say to match the code.

Should the reference document not be showing parameter attributes in function types?  If that's the case, then how does one call a function through a pointer where, for example, one of the parameters is declared with the 'inreg' parameter attribute?  I suppose the parameter attributes could be applied in the <function args> part of the 'call' instruction, but if that's the case, then *that* isn't clear from the documentation.

So, what is the correct form?  Are parameter attributes part of function types, or are they just qualifiers to the function arguments at call sites and function declarations?  Thanks for any help you guys can provide.


—
j h woodyatt <jhw at conjury.org>
http://jhw.vox.com/





More information about the llvm-dev mailing list