It is likely that I missing something however I have to ask.
We are working on Mull project https://github.com/mull-project which deals with
LLVM IR in the first place so it is often that we encounter errors like
the following one when we do things like parseAssemblyString(IR, Err, GlobalCtx);`:
test: <string>:7237:187: error: invalid field 'variable' !1526 = distinct !DIGlobalVariable(name: "test_info_", linkageName: "_ZN14Hello_sup_Test10test_info_E", scope: !0, file: !1527, line: 4, type: !1528, isLocal: false, isDefinition: true, variable: %"class.testing::TestInfo"** @_ZN14Hello_sup_Test10test_info_E, declaration: !2817)
Quick research of recent LLVM commits reveals that stuff is being changed
Author: Adrian Prantl <email@example.com>
[IR] Remove the DIExpression field from DIGlobalVariable.
The questions are:
- why do Asm / LL parsers not produce warnings like:
“LLVM IR you are using has version 3.9 which is incompatible with current
supported version 4.0.”
- I didn’t find any special version markers in LLVM IR. My guess is that
having them there would allow a developer who is changing LLVM IR format to
put deprecation / backward incompatibility checks so that higher-level
developers, like we are, see the friendly messages/warnings (see 1). It would
help us a lot to see that the reason is incompatibility, not any other reasons
like mistakes that we sometimes make.
Is there a reason why this kind of versioning is not being done in
Is it hard to have such functionality in place?
Background: we develop
Mull as in-source project inside LLVM. We often
use stable LLVM distribution from
brew and Rust stable/nightly compilers that are
often one version behind the latest stable version of LLVM. Currently our solution
is to stick to stable version of LLVM source tree however having a more friendly
output from AsmParser/LLParser would help us a lot to understand and debug
things faster and easier.