Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Box Token inside BasicValue #494

Open
hero-clashes opened this issue Apr 30, 2024 · 2 comments
Open

Can't Box Token inside BasicValue #494

hero-clashes opened this issue Apr 30, 2024 · 2 comments

Comments

@hero-clashes
Copy link

hero-clashes commented Apr 30, 2024

Describe the Bug
I am trying to add coroutines inside my compiler and I wanted to use the llvm.coro.id intrinsic
but when I tried to call it, it is panicking since in the build_call_help function it checks for the function return type but in that function is tries to box the Token type in BasicTypeEnum which doesn't support the token type
Expected Behavior
creating a call inst successfully
for now I will call it manually by just copying the code for the build_call_help and removing the void return check
LLVM Version (please complete the following information):

  • LLVM Version: 17
  • inkwell = { version = "0.4.0", features = ["llvm17-0-prefer-dynamic","target-x86"],default-features = false}

Desktop (please complete the following information):

  • OS: Windows 10

Add to that I can't box the id too, so every call that uses it I need to do it manually

@TheDan64
Copy link
Owner

TheDan64 commented Apr 30, 2024

Do you have any examples of how token usage might look like? Inkwell pseudo code or llvm sys. Relevant llvm sys functions would help too

@hero-clashes
Copy link
Author

hero-clashes commented May 1, 2024

the thing their use aren't different from normal values, but they always used with intrinsic as args, for exmaple I call llvm.coro.alloc with a token just like normal call let need_alloc = manual_call(llvm_coro_alloc, vec![id.as_value_ref()], "need_alloc".to_owned()); the manual_call func is the same function as direct call just without the void type return check, and with using the value ref directly, and the id is a token returned from llvm.coro.id call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants