[llvm-commits] TypeBuilder helper class
Chris Lattner
clattner at apple.com
Sat Apr 25 15:15:19 PDT 2009
On Apr 12, 2009, at 5:16 PM, Jeffrey Yasskin wrote:
> On Thu, Apr 9, 2009 at 11:38 PM, Chris Lattner <clattner at apple.com>
> wrote:
>>
>> On Apr 9, 2009, at 9:40 AM, Jeffrey Yasskin wrote:
>>
>>>
>>> I think I see how to define TypeBuilder<typename T, bool
>>> restrict_to_cross_compilable_types> so that TypeBuilder<size_t,
>>> true>
>>> fails to compile but TypeBuilder<sometype<64>, false> succeeds,
>>> without duplicating code. Could you confirm that that's along the
>>> lines of what you want implemented before I waste time implementing
>>> it? Also, what's the right spelling for "sometype"? I'd vote for
>>> llvm::types::i<N> or something similar.
>>>
>>
>> Sounds great to me!
>
> Ok, here's the new version. I'm not entirely happy with using a bool
> for this decision since it makes user code harder to read. I could use
> an enum or distinct subtypes, but then I'd need names. "Host" seems to
> work for the version that accepts types like 'size_t', but
> "CrossCompilable" seems too long for the version that doesn't.
> Thoughts?
This looks great! Can you please add some mention of this to the
programmer's manual?
http://llvm.org/docs/ProgrammersManual.html
Perhaps a "how to create types" entry in the "Helpful Hints for Common
Operations" section.
Applied here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090420/076704.html
Thanks Jeffrey!
-Chris
More information about the llvm-commits
mailing list