[cfe-dev] Working on the rest of PR10063: destructors and the CFG are causing issues with -Wreturn-type

Ted Kremenek kremenek at apple.com
Mon Sep 12 12:17:32 PDT 2011


I'm happy with a special bit as well instead of a dedicated block.

On Sep 12, 2011, at 11:56 AM, Chandler Carruth wrote:

> On Mon, Sep 12, 2011 at 11:30 AM, Ted Kremenek <kremenek at apple.com> wrote:
> On Sep 12, 2011, at 2:22 AM, Chandler Carruth wrote:
> 
>> If this patch is OK, or after any performance tuning you'd like to see here, I think I also better understand the FIXME in the analysis file. Do you actually want to switch the CFG to have *no* successors for blocks which contain a no-return element? That seems like it would be a very clean way of modelling this and would simplify the analysis for -Wreturn-type significantly.
> 
> One possibility is to create a special empty block, "noreturn", that all blocks ending with a noreturn destructor/call jump to.  That block would then have "Exit" as its successor.  -Wreturn-type could just walk the predecessors of Exit, and skip this block.
> 
> That would definitely work.
> 
> The other idea I had was to sink an 'isNoReturn' bit into the CFGBlock itself and just mark blocks which appropriately. Then it would just walk the predecessors and skip all blocks with the bit set. It would also prevent having an extra block in the CFG. This might be no more costly than the added CFGBlock as we'd need some way to distinguish it from any other CFGBlock... I'd have to look at the implementation details of it though.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110912/8da3501b/attachment.html>


More information about the cfe-dev mailing list