Hi, Types were recently removed from metadata in the IR, which means older LLVM IR code with metadata won't compile. Was this intentional? Is there a practical way to maintain compatibility with older LLVM IR? Thanks, Tom
Backwards compatibility with the LLVM IR textual format is not guaranteed, while bitcode compatibility is. You can probably load up that old IR by assembling it with an old llvm-as and loading the bitcode in new clang. http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility That said, if it's just a matter of skipping over the 'metadata' token, it would be nice to let old IR assemble. On Fri, Dec 19, 2014 at 10:59 AM, Tom Stellard <tom at stellard.net> wrote:> > Hi, > > Types were recently removed from metadata in the IR, which means older > LLVM IR code with metadata won't compile. Was this intentional? > Is there a practical way to maintain compatibility with older LLVM IR? > > Thanks, > Tom > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141219/6112f0a5/attachment.html>
I'm assuming you're referring to http://llvm.org/viewvc/llvm-project?view=revision&revision=224257 - certainly deliberate. +Duncan for more info. On Fri, Dec 19, 2014 at 10:59 AM, Tom Stellard <tom at stellard.net> wrote:> > Hi, > > Types were recently removed from metadata in the IR, which means older > LLVM IR code with metadata won't compile. Was this intentional? > Is there a practical way to maintain compatibility with older LLVM IR? > > Thanks, > Tom > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141219/0e1405d7/attachment.html>
> On Fri, Dec 19, 2014 at 10:59 AM, Tom Stellard <tom at stellard.net> wrote: > Hi, > > Types were recently removed from metadata in the IR, which means older > LLVM IR code with metadata won't compile. Was this intentional? > Is there a practical way to maintain compatibility with older LLVM IR? > > Thanks, > TomAs Reid said, there's no backwards compatibility for assembly. However, I did share an upgrade script (as mentioned in r224257) that should help you update out-of-tree testcases (or other IR). Have a look at the attachment to PR21532. Warning: Reid noticed that the `sed -E` flag I'm using there doesn't seem to be portable. You might have to fiddle with the regexes (please share if you do).> On 2014-Dec-19, at 11:40, Reid Kleckner <rnk at google.com> wrote: > > That said, if it's just a matter of skipping over the 'metadata' token, it would be nice to let old IR assemble.It's a little harder than that, since it's a `Type` token, but in theory it's probably doable. However, I think this would set a bad precedent. There's nowhere else (that I know of) where we accept two versions of assembly. The LLParser is relatively easy to work with because it doesn't have that kind of historical baggage.