-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow parsing METADATA_DERIVED_TYPE
from Apple LLVM
#247
Conversation
I'm not quite sure of the best way to test this, since the bug depends on a very particular |
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.
I added PR #249 which adds the ability to test these. I don't have the Apple bitcode file, but I believe you have one corresponding the Ryan Mcleeary's minimal example; please feel free to update #249 with that Apple-generated bitcode and corresponding .ll
. You could even merge that PR before this one and rebase this one to ensure the fix here, although it's a pretty trivial change, so that's not critical.
Thanks, @kquick! This would indeed be helpful. Sadly, now that I've actually tried out the
My upstream version of LLVM really doesn't like Apple LLVM, it seems. I don't feel confident in my ability to hack the |
I just made a modification to #249 which allows |
Thank again. Sadly, there's still another obstacle:
The indices |
That is the situation that #228 will fix. |
Hah, I managed to forget about that issue entirely. (A lot has occurred in the |
Or you can add this test and add an entry in |
Apple's fork of LLVM uses an ever-so-slightly different bitcode format than the upstream version of LLVM. In particular, it adds an additional record to `METADATA_DERIVED_TYPE`, which means that we must be slightly more permissive during parsing to allow Apple LLVM bitcodes through. See the new `Note [Apple LLVM]` for a slightly more detailed explanation. As that Note explains, this is good enough for now, but we may want to think about a more robust solution in the future. I have added an `apple-llvm.bc` regression test to `disasm-test`, but it doesn't yet pass the test suite for unrelated reasons documented in #222. I have added a `known_bugs` entry for this test case until that issue is resolved. Fixes #235.
Right you are—I also forgot about |
Apple's fork of LLVM uses an ever-so-slightly different bitcode format than the upstream version of LLVM. In particular, it adds an additional record to
METADATA_DERIVED_TYPE
, which means that we must be slightly more permissive during parsing to allow Apple LLVM bitcodes through. See the newNote [Apple LLVM]
for a slightly more detailed explanation. As that Note explains, this is good enough for now, but we may want to think about a more robust solution in the future.I have added an
apple-llvm.bc
regression test todisasm-test
, but it doesn't yet pass the test suite for unrelated reasons documented in #222. I have added aknown_bugs
entry for this test case until that issue is resolved.Fixes #235.