I would like to add an intrinsic that returns a token type argument. The equivalent in C that I found other builtins using is void *(coro_id for instance).
My question is how to generate the code in CGBuiltins.cpp to generate token type instead of void *. The usual code is not working.
The intrinsic I get generated is:
%1 = call token @llvm.new_intrinsic()
but it wants to convert the token into void* like the following:
%2 = bitcast token %1 to i8*
store i8* %2, i8** %myvariable
How to get it to use directly token type like this:
%myvariale = call token @llvm.new_intrinsic()
Did anyone have done this before: token in the intrinsic and void* in the builtin?