On Oct 28, 2013, at 11:41 AM, Ted Kremenek <[email protected]> wrote:

> On Oct 25, 2013, at 4:42 PM, Richard Trieu <[email protected]> wrote:
> 
>> If you check out -Wlogical-not-parentheses and 
>> -Wtautological-compare-out-of-range, they are in lib/Sema/SemaChecking.cpp.  
>> Why did you use a CFG approach instead?
> 
> Hi Richard,
> 
> I told Anders that modifying the CFG builder would be an interesting approach 
> for two reasons:
> 
> (1) The CFG is used for a variety of dataflow analyses, thus folding this 
> “smarts” into the CFG builder seems to have dividends for other uses.
> 
> (2) The CFG builder already does some branch pruning by doing some simply 
> analysis of expressions at branches.  This seemed like a natural enhancement.
> 
> I did consider this to take a similar approach to -Wlogical-not-parentheses, 
> but thought this would be a more promising direction to explore.
> 
> Flipping the question around, do you think it would be interesting to 
> consider the opposite approach and move the logic to 
> -Wlogical-not-parentheses, etc., into the CFG builder, for the same reasons I 
> have given above?
> 
> Ted

Further, there is a very natural relationship between *all* of these warnings 
and -Wunreachable-code (a warning we’d one day like to fully productize), which 
is built directly on top of the CFG.  Bringing the underlying pieces closer 
together seems like a promising direction to explore.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to