Skip to content
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

Consider being more permissive when parsing LLVM metadata #248

Open
RyanGlScott opened this issue Aug 14, 2023 · 0 comments
Open

Consider being more permissive when parsing LLVM metadata #248

RyanGlScott opened this issue Aug 14, 2023 · 0 comments

Comments

@RyanGlScott
Copy link
Contributor

Whenever we fail to parse a bitcode file from a more recent Clang version, it's usually because a piece of LLVM metadata has gained an additional record field that llvm-pretty-bc-parser does not support. Whenever LLVM disassembles a .bc file, LLVM's policy is to reject metadata with a number of records that does not lie within a predefined range of expected records. llvm-pretty-bc-parser has adopted this policy as well, but at the expense of making llvm-pretty-bc-parser much more slow to adopt new LLVM versions (or, in extreme cases, alternative releases of supported LLVM versions, as in #235).

Most of the time, however, adding new metadata records is harmless, as they almost never affect the actual semantics of the bitcode itself. In light of this, perhaps we should relax llvm-pretty-bc-parser and allow parsing metadata with more records than what the predefined ranges allow. We might consider emitting a warning if that ever happens, but it need not be a fatal error. This would make llvm-pretty-bc-parser more forward-compatible with LLVM releases it has not encountered yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant