[llvm-commits] TypeBuilder helper class

Nick Lewycky nicholas at mxc.ca
Thu Apr 2 21:06:31 PDT 2009


Dan Gohman wrote:
> On Apr 2, 2009, at 11:37 AM, Jeffrey Yasskin wrote:
> 
>> When declaring global variables and functions that are defined in the
>> Python C libraries, I've found the attached class helpful.
>> TypeBuilder<void(int*, size_t*)>::get() will return an LLVM Type*
>> corresponding to that function type, which is otherwise quite verbose
>> to build up. Let me know what you think.
> 
> This looks neat, though it's problematic for cross-compiling, where
> the host's int and size_t may be different from those of the target.
> It's not a problem for everyone, but an LLVM in-tree type builder
> utility should support cross compilation.

What makes this different from the IRBuilder is that it's reflective. We 
could have reflection based and non-reflection based IRBuilder and 
TypeBuilders independently. What you're asking for is a non-reflection 
based TypeBuilder, which would be useful for the reasons you mention, 
but would have a different API and is out of scope for this change. Agreed?

Nick



More information about the llvm-commits mailing list