<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 26, 2017, at 1:56 AM, Stanislav Pankevich via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">Hello,<br class=""><br class="">It is likely that I missing something however I have to ask.<br class=""><br class="">We are working on Mull project <a href="https://github.com/mull-project" class="">https://github.com/mull-project</a> which deals with<br class="">LLVM IR in the first place so it is often that we encounter errors like<br class="">the following one when we do things like parseAssemblyString(IR, Err, GlobalCtx);`:<br class=""><br class="">```<br class="">test: <string>:7237:187: error: invalid field 'variable'<br class="">!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)<br class="">```<br class=""><br class="">Quick research of recent LLVM commits reveals that stuff is being changed<br class="">significantly, example:<br class=""><br class="">commit 7b500b4bdf40cb40cb33bdcf5faf900db4930824<br class="">Author: Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>><br class="">Date: Tue Dec 20 02:09:43 2016 +0000<br class=""><br class=""> [IR] Remove the DIExpression field from DIGlobalVariable.<br class=""><br class=""> ...<br class=""><br class="">The questions are:<br class=""><br class="">1) why do Asm / LL parsers not produce warnings like:<br class=""><br class="">"LLVM IR you are using has version 3.9 which is incompatible with current<br class="">supported version 4.0.ā</div></div></div></div></blockquote><div><br class=""></div><div>Because the ASM is not portable from one version of LLVM to another. </div><div>The bitcode is intended to be supported across version.</div><div><br class=""></div><div><a href="http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility" class="">http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility</a></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class="">2) I didn't find any special version markers in LLVM IR. My guess is that<br class="">having them there would allow a developer who is changing LLVM IR format to<br class="">put deprecation / backward incompatibility checks so that higher-level<br class="">developers, like we are, see the friendly messages/warnings (see 1). It would<br class=""></div>help us a lot to see that the reason is incompatibility, not any other reasons<br class=""></div>like mistakes that we sometimes make.<br class=""><div class=""><div class=""><br class="">Is there a reason why this kind of versioning is not being done in<br class="">AsmParser/LLParser?<br class=""><br class="">Is it hard to have such functionality in place?<br class=""><br class="">Background: we develop `Mull` as in-source project inside LLVM. We often<br class="">use stable LLVM distribution from `brew` and Rust stable/nightly compilers that are <br class="">often one version behind the latest stable version of LLVM. Currently our solution<br class="">is to stick to stable version of LLVM source tree however having a more friendly<br class="">output from AsmParser/LLParser would help us a lot to understand and debug<br class="">things faster and easier.<br class=""></div></div></div></div></blockquote><div><br class=""></div></div>Iām not sure I understand exactly how you end up mix-and-matching versions of LLVM and assembly?<div class=""><br class=""></div><div class="">ā </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>