On Mar 1, 2010, at 04:43, Duncan Sands wrote:> [I wrote:] >> >> Nevertheless, the LLVM Language Reference document suggests, in the examples for the Function Types section, that parameter attributes are part of function types. > > 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. — j h woodyatt <jhw at conjury.org> http://jhw.vox.com/
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/
On Mon, Mar 1, 2010 at 8:20 PM, james woodyatt <jhw at conjury.org> wrote:> 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.Attributes, including signext, are not part of the type.> 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.Attributes can be attached to function declarations and to calls. For attributes like signext, the attribute needs to be attached to both to work properly. -Eli
>>> Nevertheless, the LLVM Language Reference document suggests, in the examples for the Function Types section, that parameter attributes are part of function types. >> >> 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 *) *This has been removed. Ciao, Duncan.