[cfe-commits] Patch for review: enhancements/fixes to -verify

Andy Gibbs andyg1001 at hotmail.co.uk
Tue Jun 12 11:15:51 PDT 2012


On Tuesday, June 12, 2012 12:12 PM, Jonathan Sauer wrote:
> Why not tell -verify whether to actually consider the #if, like for 
> example:
>
> #if <condition> // verify-evaluate
> ...
> #endif
>
> This would tell -verify to evaluate the #if condition and, if the result 
> is false,
> skip the block. The default would be for -verify to *not* evaluate #if's, 
> just as
> is currently the case.

Ok, I think this should be possible without too much modification, but it 
really depends on how the preprocessor supports comment extraction in 
skipped blocks.  I can see how I might be able to implement this in either 
of two ways:

1. Have tags "verify-evaluate-all" and "verify-evaluate-normal" which enable 
the test-case to specify regions where it should still extract comments from 
skipped blocks.  I think this should be possible, but I wonder whether the 
preprocessor might do a "fast skip" which might prevent even comments being 
extracted.  I would have to check on this.  I think this will be more 
feasible and flexible than trying to attach it to a #if directive.

2. The alternative would be to have a tag "verify-post-process" which would 
effectively cause the behaviour to revert to the old (current) behaviour for 
this file.  This is certainly possible without much work.

Is there any interest in either or both of these suggestions?  If so, I can 
look into doing it, though I would like to try and get at least the current 
proposal committed and make this a "version 2", unless the interest is very 
strong!

Cheers
Andy
 




More information about the cfe-commits mailing list