Thread overview
Intrinsic has incorrect return type for LLVM IR token
Dec 10, 2020
Calvin P
Dec 10, 2020
Calvin P
Dec 10, 2020
Guillaume Piolat
Dec 12, 2020
Calvin P
December 10, 2020
https://run.dlang.io/is/kZZCEP

I try play with LLVM Intrinsic,  what is the type for LLVM IR token https://reviews.llvm.org/D11861
December 10, 2020
On Thursday, 10 December 2020 at 07:49:33 UTC, Calvin P wrote:
> https://run.dlang.io/is/kZZCEP
>
> I try play with LLVM Intrinsic,  what is the type for LLVM IR token https://reviews.llvm.org/D11861

This type seems not exists in LDC: https://github.com/ldc-developers/ldc/blob/master/ir/irtype.cpp


Maybe we can add this into LDC so D can support LLVM coroutine.

like this

pragma(LDC_intrinsic_type, "token")
struct llvm_token;



Or create a LLVM_TOKEN built-in type.
December 10, 2020
On Thursday, 10 December 2020 at 07:49:33 UTC, Calvin P wrote:
> https://run.dlang.io/is/kZZCEP
>
> I try play with LLVM Intrinsic,  what is the type for LLVM IR token https://reviews.llvm.org/D11861

Not solving this problem in particular, but when using LDC_intrinsic you can usually get enlightned about the expected signaure by looking at the builtins list in clang source code.

For your example: https://github.com/llvm/llvm-project-staging/blob/f0fd4f3af0acda5068acc5bbe10b3792c41bdfc4/clang/include/clang/Basic/Builtins.def#L1508

It seems like on this arch the return value should be voi*
December 12, 2020
On Thursday, 10 December 2020 at 17:43:22 UTC, Guillaume Piolat wrote:
> On Thursday, 10 December 2020 at 07:49:33 UTC, Calvin P wrote:
>> https://run.dlang.io/is/kZZCEP
>>
>> I try play with LLVM Intrinsic,  what is the type for LLVM IR token https://reviews.llvm.org/D11861
>
> Not solving this problem in particular, but when using LDC_intrinsic you can usually get enlightned about the expected signaure by looking at the builtins list in clang source code.
>
> For your example: https://github.com/llvm/llvm-project-staging/blob/f0fd4f3af0acda5068acc5bbe10b3792c41bdfc4/clang/include/clang/Basic/Builtins.def#L1508
>
> It seems like on this arch the return value should be voi*

Thanks for the tips, but void* not work.