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

How can I create a ConstantFP with the managed API? #216

Closed
PrettyFlower opened this issue Jul 10, 2023 · 2 comments
Closed

How can I create a ConstantFP with the managed API? #216

PrettyFlower opened this issue Jul 10, 2023 · 2 comments

Comments

@PrettyFlower
Copy link

It looks like there’s a newer managed API in here that the tutorials don’t use, and it has some nice helper methods like IRBuilder.CreateFAdd() which more closely follows the c++ api. I’m trying to figure out how to do chapter 3 of the kaleidoscope tutorial but can’t figure out how to make a ConstantFP or APFloat value like they use in the NumberExprAST.

@tannergooding
Copy link
Member

The managed API surface isn't "complete" today and there are still many APIs that could be exposed which don't exist yet. I've been adding these when I have time/availability to do so, but am more than open to interested parties helping out here if they have time as well.

In this case, we're missing an API like static Constant Get(Type Ty, double V) and/or some wrapper for the APFloat concept so we can expose static Constant Get(Type Ty, APFloat V)

@PrettyFlower
Copy link
Author

Thanks for getting back to me. I’m only just getting started with LLVM so I’m not sure I understand it well enough to work on the managed wrapper yet. I’ll use the unmanaged one for now.

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

No branches or pull requests

2 participants