[cfe-dev] -Wunreachable-code and templates

Ted Kremenek kremenek at apple.com
Tue Jan 10 07:51:55 PST 2012


On Jan 10, 2012, at 12:20 AM, David Blaikie wrote:

>>> If it is, my main concern then comes down to the following:
>>> 
>>> (1) Are there are other issues that we are not considering where the
>>> uninstantiated template doesn't faithfully provide an under approximation of
>>> the reachable code?
>> 
>> I've tested the exception case above & that seems to be always
>> reachable anyway. I'll try my hand at looking through the template
>> instnantiation code to see if there's any cases where we might end up
>> adding edges rather than removing them.
> 
> I haven't really delved into this further - is there a particular
> form/approach you'd like to see to prove this property? (that new
> edges are never added when instantiating a template (except when
> splitting an existing block in the CFG (eg: by a dependent call
> becoming noreturn - splitting the block at the call site)))

I've thought about this more, and I'm pretty sure that analyzing the uninstantiated template will be a conservative superset of the reachable control-flow of any instantiated template.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120110/d9661179/attachment.html>


More information about the cfe-dev mailing list