[llvm-commits] [llvm] r146439 - in /llvm/trunk: include/llvm/Bitcode/ReaderWriter.h lib/Bitcode/Writer/BitcodeVerifier.cpp

Chad Rosier mcrosier at apple.com
Mon Dec 12 16:34:17 PST 2011


On Dec 12, 2011, at 3:35 PM, Chris Lattner wrote:

> 
> On Dec 12, 2011, at 3:33 PM, Chris Lattner wrote:
> 
>> 
>> On Dec 12, 2011, at 2:57 PM, Chad Rosier wrote:
>> 
>>> Author: mcrosier
>>> Date: Mon Dec 12 16:57:31 2011
>>> New Revision: 146439
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=146439&view=rev
>>> Log:
>>> Begin sketching out a bitcode verifier pass.  Idea is to emit a .bc file and
>>> then read the file back in to verify use-list serialization/deserialization.
>> 
>> Hi Chad,
>> 
>> Can you pick a different name than 'verifier' for this?  I think it will be very confusing to people.  How about "Validator" or something else?
> 
> Actually, a more basic question: why is this a pass at all?  This doesn't follow the structure of other passes.  It seems that it should just be a free function or some utility somewhere.

Is "I just wanted to write a pass.." a valid answer?  :) j/k

Bill and I discussed making this a stand alone utility (along the lines of bcanalyzer), but we're not strictly dealing with bitcode here.  The use-list ordering problem requires interaction between clang, the BitcodeWriter and the BitcodeReader.  So, I scratched that idea.

Jakob and I discussed combining this into the standard LLVM IR verifier pass, but I'm opposed to that because that pass is run frequently (at least I understand it to be) and validating bitcode incurs a large overhead (i.e., file I/O).  I do, however, want the option of running it multiple times during compilation as this is more likely to expose ordering issues. 

I'm fine with making this a free function.  Feedback encouraged.

 Chad

> -Chris




More information about the llvm-commits mailing list