<div dir="ltr">I don't think token was envisioned as something that could be exposed via C builtins. Perhaps you could modify CGBuiltins.cpp to avoid the bitcast, but you still won't be able to store the token to a variable in C. It will only be usable in an expression, like this:<div>  consume_token(produce_token(), foo(), bar());</div><div><br></div><div>This doesn't seem like a particularly good design direction either.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 2, 2018 at 7:34 PM Dounia Khaldi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>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).</div><div><br></div><div>My question is how to generate the code in CGBuiltins.cpp to generate token type instead of void *. The usual code is not working. </div><div><br></div><div>The intrinsic I get generated is:</div><div>%1 = call token @llvm.new_intrinsic()</div><div><br></div><div>but it wants to convert the token into void* like the following:</div><div><div>%2 = bitcast token %1 to i8*  </div><div>store i8* %2, i8** %myvariable</div></div><div><br></div><div> How to get it to use directly token type like this:</div><div>

<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">%myvariale = call token @llvm.new_intrinsic()</div><div><br></div><div>Did anyone have done this before: token in the intrinsic and void* in the builtin?</div><div><br></div>Thanks,</div><div>Dounia<br class="m_6392452636323485554gmail-Apple-interchange-newline">

 </div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>