[LLVMdev] [PATCH] -emit-bitcode-version

Joe Abbey jabbey at arxan.com
Thu Nov 8 07:09:53 PST 2012

On Nov 8, 2012, at 3:31 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi Joe,
>> We have a tool which reads in bitcode, processes it, and re-emits it.  We use
>> this tool as a flexible way to integrate our tool into the Xcode, Android NDK,
>> Chromium, and Linux build process.
>> The problem we face is that bitcode changes, and when it does… future versions
>> can read it, but past versions are left in the lurch.  For instance LLVM 3.2svn
>> can BitcodeReader from LLVM 3.1, but LLVM 3.1 can't BitcodeReader LLVM 3.2
>> (after r165739.)   There was an element of this patch which would have helped
>> enable bitcode compatibility (use-abs-operands), but alas it was not committed.
> can't you use a combination of llvm-dis (from LLVM 3.2) and llvm-as (from LLVM
> 3.1) to convert the bitcode?
> Ciao, Duncan.

I could for my immediate headache.  My concern is that there will be future updates to the bitcode representation that may not work in this flow.  That's impossible to predict, and llvm-dis -> .ll -> llvm-as is one path which certainly seems attractive.  By providing an internal switch to emit bitcode, I think we save a step and have a method for future proofing.

I'll be talking about this in a lightning talk, perhaps others have thoughts on this.


More information about the llvm-dev mailing list