-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use llvm-hs to generate LLVM code #9
Comments
About cleanups: There's some annoying code that tracks what needs to be forward declared in the generated code because duplicate forward declarations aren't allowed. With llvm-hs we have an AST for the generated code, so perhaps forward declarations could be extracted from usage. |
The code-generator could also probably use the |
The strings don't work out of the box on Ubuntu (I'm guessing you are on macOS?) as the default binaries generated are differently named ( |
Thanks for that info @theindigamer. Perhaps that could be fixed before going to I think Sixten should be compatible with both LLVM 4 and 5 but haven't done any work to find out the exact bounds, and we're not yet doing any testing to ensure compatibility. I do most of my development on Arch Linux which now has LLVM 5, though the update was fairly recent. I also occasionally try it on a Mac. I'd like to do more CI to ensure compatibility. |
I don't know a generic way to get it working across all Linux distros, although I did install LLVM 5 and associated packages (on Ubuntu) and checked that the binaries follow the same naming scheme, i.e. A more convoluted slapdash solution would be to use the output of
which will just use the latest version (if numbered) or simply I think the key question here is: how long do you think the porting will take? If it's going to take long, then it might be a good idea to think this through further and come up with a reasonable solution. If not, then maybe just leave this as is for now and directly jump to I was actually going to work on the test writing issue, when I noticed this problem. For now, I've just changed the strings locally and will keep the changed strings uncommitted and only commit the test once it's done. |
Using llvm-hs is next on my list, so hopefully the wait won't be too long. Since you're happy with a few local changes I guess we can just wait until someone else complains. :) Nice! That will be very welcome! |
* Use llvm-irbuilder to generate the LLVM IR. * Use llvm-hs-pretty to pretty-print the IR to file. There are still some loose ends here and there, but the tests pass so cleanups can come later. Fixes #9.
* Use llvm-irbuilder to generate the LLVM IR. * Use llvm-hs-pretty to pretty-print the IR to file. There are still some loose ends here and there, but the tests pass so cleanups can come later. Fixes #9.
* Use llvm-irbuilder to generate the LLVM IR. * Use llvm-hs-pretty to pretty-print the IR to file. There are still some loose ends here and there, but the tests pass so cleanups can come later. Fixes #9.
Instead of doing it with strings.
https://github.com/llvm-hs/llvm-hs
Also a good idea to clean up the code generator.
The text was updated successfully, but these errors were encountered: