-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add missing LLVM::Attribute members #8358
Conversation
This enables support for LLVM 9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I don't understand: did some enum values change? Does this mean some values work for llvm 8 but for llvm you need other (integer) values for the same enum members? If so, this change should include mapping between these values between versions.
LLVM completely uses the "kind ids" internally, which we query LLVM for at runtime by string literal and store them. The raw enum values are only used for crystal. A look at the llvm bindings and the context for this diff is probaby the best way to grok this. For reference, here is the LLVM-internal enum IDs for my particular build of LLVM:
Notice how some of them are completely out of order, especially |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Thank you for the explanation too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested in osx against llvm@9 👍
It works fine at Arch Linux. Thank you very much @RX14 for the fix. |
Note this still isn't the entire set of missing enum members, only the ones that changed between LLVM 8 and 9 which I thought were likely to be culprits. More work could be done on the bindings in the future, this just fixed the immediate fire. |
cc @anatol
Applying this patch (or actually a subset of it, only
ImmArg
needs to be added) should allow building crystal for LLVM 9.ImmArg
is set on some function args by default, it can be ignored, just needs to be mapped correctly so as to not fail.Fixes #8294.