-
Notifications
You must be signed in to change notification settings - Fork 4
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
update to latest version of llir/llvm #24
Conversation
Also, use util.StdLibDir() in ast.SearchPaths instead of hardcoded /usr/local/lib/geodelib. After this commit, it is possible to use relative paths for the standard library: $ export GEODELIB=./lib/ $ geode test Total: 23 / 23 tests ran succesfully
This was done automatically, using the following script: find . -type f -name '*.go' | xargs -I '{}' sar -i "github.com/geode-lang/geode/llvm/" "github.com/llir/llvm/" '{}' Where the sar tool is from the https://github.com/mewkiz/cmd repo, and may be installed as follows: go get github.com/mewkiz/cmd/sar
This is to avoid confusion with the ir/types package.
Set the name of the comment pseudo-instruction to "nop" to avoid it being unnamed, and thus increasing the local ID counter.
Since ir.NewGetElementPtr is unaware of Geode types, introduce an indirection through the ast.gep function which only present the underlying LLVM IR element type to ir.NewGetElementPtr. Note, this is note the prettiest approach, but seems to work. I'd be glad to discuss alternatives that may be cleaner than this.
Test test cases are now passing. $ geode test -> 23/23 (100%) tests ran succesfully
@nickwanninger Thanks a lot for releasing Geode! I've had a lot of fun playing around with it, and feel I've learned a lot by reading the code you wrote. Going through the code base of Geode and updating it to make use of the latest version of llir/llvm, also helped uncover a regression of the llir API with regards to usability, which has since been addressed in llir/llvm@cba8644 If you notice anything else that feels strange or quirky, please let us know. We definitely want to improve the API of llir/llvm to be more generally useful for anyone writing compilers, interpreters, static code analysis tools, etc. Wish you all the best and hope you'll have a most lovely winter! Cheerful regards from Sweden, |
Amazing work Robin. I really appreciate the feedback and I'm glad my code helped you get your project in a better state! Thanks a bunch! |
As part of PR geode-lang#24, Geode switched to using an unmodified version of llir/llvm, as such the old copy of llvm is no longer needed.
This is a quite substantial change to Geode as it attempts to make use of an unmodified version of llir/llvm. To accomplish this, two Geode specific types are defined in the new
pkg/gtypes
package, a Geode struct type and a Geode slice type:Whether this is a good fit for Geode is yet to be determined.
The main benefit is that with this approach, Geode would be able to use updates to
llir/llvm
seamlessly, and all Geode specific features are implemented on top of the LLVM IR agnostic llir/llvm library.With this PR, the latest version of llir/llvm is used (
v0.3.0
). All test cases of Geode are passing:This PR fixes #22 and superseeds PR #23.
Note: after this commit has been merged, the
llvm
subdirectory of the Geode repository may be removed, as the upstream llir/llvm repo is used unmodified. Also, ago.mod
file has been added to track the specific versions of dependencies.