everyone-- I'm confused about what I'm seeing in LLVM 2.6, and I have a series of related questions. I can see how to apply attributes to function parameters and return values when defining and declaring functions, but I don't see how to do it for function type definitions. It's certainly absent from the OCaml bindings. I'm also not seeing it in the C-langauge bindings over which the OCaml bindings are a thin veneer. I'm not seeing obvious signs of it in the C++ headers. Nevertheless, the LLVM Language Reference document suggests, in the examples for the Function Types section, that parameter attributes are part of function types. q1. Am I missing something? Is there a way to apply attributes to parameters in function types? q2. If not in LLVM 2.6, is this something already sorted out in the forthcoming LLVM 2.7 release? q3. If not, is it something that *could* be sorted out in the forthcoming LLVM 2.7 release? — j h woodyatt <jhw at conjury.org> http://jhw.vox.com/
Hi James,> I can see how to apply attributes to function parameters and return values when defining and declaring functions, but I don't see how to do it for function type definitions.you can't. It used to be the case long ago that attributes went on types, but now they go only on calls and function declarations.> 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.> q1. Am I missing something? Is there a way to apply attributes to parameters in function types?No, there is no way.> q2. If not in LLVM 2.6, is this something already sorted out in the forthcoming LLVM 2.7 release? > q3. If not, is it something that *could* be sorted out in the forthcoming LLVM 2.7 release?Not sure what you are asking here. If you are asking if parameter attributes could be added back to function types, then the answer is no, they will not be added back to function types. Maybe you should explain why you want that? Ciao, Duncan.
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/