Closed jiachen247 closed 3 years ago
What a coincidence! I'm doing something similar to you.
I'm also working on a project to turn TypeScript into LLVM IR. It would be better if I could cooperate with you.
Besides, I developed a library called llvm-bindings to replace llvm-node, because it seems that llvm-node is no longer maintained.
If you like, you can try to use llvm-bindings.
If some APIs you needing have not been exposed, you can remind me in the discussion area of its repository that I should be able to add them in 1-2 days.
Hi @ApsarasX , wow thats great to hear will check out your bindings if I ever have to work with llvm and node again!
I found a hack around this! you can have a create a corresponding struct that has a pointer instead of a int field and bitcasting the whole stuct from one to the other should not throw an error (just to do inttoptr
lol)
Hope this helps anyone whole might be stuck!
I'm maintaining the library in my free time but am not adding new functionality because I'm no longer working on a project using it. Thanks for suggesting an alternative @ApsarasX and great to see that it's built on top of N-API.
@jiachen247 I'm happy to merge a PR that adds support for the required instruction.
@MichaReiser Thank you very much for your affirmation. llvm-bindings is mostly inspired by llvm-node. I will indicate your contribution in README.md
@jiachen247
I have release v0.1.2 of llvm-bindings.
In the v0.1.1, I have added many create methods of cast instruction in IRBuilder, including CreatePtrToInt
and CreateIntToPtr
.
I hope that these help to you.
I'm maintaining the library in my free time but am not adding new functionality because I'm no longer working on a project using it. Thanks for suggesting an alternative @ApsarasX and great to see that it's built on top of N-API.
@jiachen247 I'm happy to merge a PR that adds support for the required instruction.
@MichaReiser Excuse me, can you help me guide how to implement inheritance? I find an issue in node-addon-api, but I can find any valid method to implement inheritance.
@ApsarasX I'm sorry but I don't know. Inheritance wasn't supported the last time I tried (see #19 and your linked issue) and I haven't tried to migrate since then (it would be nice because it allows to delete much of the boilerplate code).
This currently no way to convent a int back to a pointer! https://llvm.org/docs/LangRef.html#inttoptr-to-instruction