[llvm-commits] TypeBuilder helper class

Jeffrey Yasskin jyasskin at google.com
Wed Apr 22 10:55:56 PDT 2009


On Sun, Apr 12, 2009 at 5:16 PM, Jeffrey Yasskin <jyasskin at google.com> 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?
>
> I also don't have any tests that TypeBuilder<size_t, true> correctly
> fails to compile. dejagnu could do it in theory, but Nick tells me
> that it doesn't work for code that calls into LLVM.

Any word on this?



More information about the llvm-commits mailing list