<div dir="ltr"><div><div><div><div><div>Hi Mehdi,<br><br></div>Thanks for the link. I knew about it but re-reading was useful in my case :)<br><br></div>Now we are specifically careful about what versions we use to build the IR and then run it. Most common case before that was that we ran Orc JIT API from the latest source tree against .ll fixtures we built and stored before with earlier stable versions of LLVM.<br><br></div>My question was mainly about if it would make sense to LLVM developers to make the error message more explicit about the reasons of why IR is failing.<br></div><br></div>Stanislav<br><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 27, 2017 at 5:53 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><span class=""><div>On Jan 26, 2017, at 1:56 AM, Stanislav Pankevich via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-8089968479633589759Apple-interchange-newline"></span><div><div dir="ltr"><div><div><span class="">Hello,<br><br>It is likely that I missing something however I have to ask.<br><br>We are working on Mull project <a href="https://github.com/mull-project" target="_blank">https://github.com/mull-<wbr>project</a> which deals with<br>LLVM IR in the first place so it is often that we encounter errors like<br>the following one when we do things like parseAssemblyString(IR, Err, GlobalCtx);`:<br><br>```<br>test: <string>:7237:187: error: invalid field 'variable'<br>!1526 = distinct !DIGlobalVariable(name: "test_info_", linkageName: "_ZN14Hello_sup_Test10test_<wbr>info_E", scope: !0, file: !1527, line: 4, type: !1528, isLocal: false, isDefinition: true, variable: %"class.testing::TestInfo"** @_ZN14Hello_sup_Test10test_<wbr>info_E, declaration: !2817)<br>```<br><br>Quick research of recent LLVM commits reveals that stuff is being changed<br>significantly, example:<br><br>commit 7b500b4bdf40cb40cb33bdcf5faf90<wbr>0db4930824<br>Author: Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>><br>Date:   Tue Dec 20 02:09:43 2016 +0000<br><br>    [IR] Remove the DIExpression field from DIGlobalVariable.<br><br>    ...<br><br>The questions are:<br><br>1) why do Asm / LL parsers not produce warnings like:<br><br>"LLVM IR you are using has version 3.9 which is incompatible with current<br></span>supported version 4.0.”</div></div></div></div></blockquote><div><br></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></div><div><a href="http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility" target="_blank">http://llvm.org/docs/<wbr>DeveloperPolicy.html#ir-<wbr>backwards-compatibility</a></div><span class=""><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div><div><br>2) I didn't find any special version markers in LLVM IR. My guess is that<br>having them there would allow a developer who is changing LLVM IR format to<br>put deprecation / backward incompatibility checks so that higher-level<br>developers, like we are, see the friendly messages/warnings (see 1). It would<br></div>help us a lot to see that the reason is incompatibility, not any other reasons<br></div>like mistakes that we sometimes make.<br><div><div><br>Is there a reason why this kind of versioning is not being done in<br>AsmParser/LLParser?<br><br>Is it hard to have such functionality in place?<br><br>Background: we develop `Mull` as in-source project inside LLVM. We often<br>use stable LLVM distribution from `brew` and Rust stable/nightly compilers that are <br>often one version behind the latest stable version of LLVM. Currently our solution<br>is to stick to stable version of LLVM source tree however having a more friendly<br>output from AsmParser/LLParser would help us a lot to understand and debug<br>things faster and easier.<br></div></div></div></div></blockquote><div><br></div></span></div>I’m not sure I understand exactly how you end up mix-and-matching versions of LLVM and assembly?<div><br></div><div>— </div><span class="HOEnZb"><font color="#888888"><div>Mehdi</div><div><br></div></font></span></div></blockquote></div><br></div></div></div></div></div></div></div></div>