[cfe-dev] Extra join points in CFG?

Ted Kremenek kremenek at apple.com
Wed Dec 21 15:51:05 PST 2011


Thanks John.  I discovered some of the issues by looking at the generated IR; looking at CodeGen was my next planned step.

Cheers,
Ted

On Dec 21, 2011, at 3:42 PM, John McCall wrote:

> On Dec 21, 2011, at 2:51 PM, Ted Kremenek wrote:
>> Brief update: I have looked at this, and it turns out to be a bit more complicated then I anticipated.  I discovered through investigation that the way we currently model '&&' and '||' in the CFG does not properly model C++ destructors at all, and fixing that may require changing some fairly pervasive invariants.  I think we need to do this, but it will take a bit longer than I originally anticipated…
> 
> Incidentally, this kind of conditional evaluation comes up in four places
> in the language:
>  - the ternary operator ?:, in both its variants,
>  - the binary operator &&,
>  - the binary operator ||, and
>  - 'new' expressions that call a operator new declared throw()/noexcept,
>    where the initializer is not evaluated if the result of the call is null.
> 
> Grepping CodeGen for ConditionalEvaluation is a good way to find
> these places, albeit with some redundancy between the different
> code generation patterns.
> 
> John.





More information about the cfe-dev mailing list