[PATCH] D37090: Implement CFG construction for __finally.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 04:54:59 PDT 2017

I just realized that this doesn't do the right thing if the try body
contains jumps out of the try. That's rare and the CFG is mostly used for
warnings, but we should get that right anyhow I suppose. To fix this, I'd
probably add a "ActiveFinally" member, and when building a node for a
return, I'd make the return jump to that if it's active and then add an
edge to the exit node (or a containing finally) to the ActiveFinally. When
building jump nodes (continue, break, go-to) those would also go to the
ActiveFinally which in turn would go to the right place.

I don't think the code that's currently in this CL should change much so
you can look at that if you want, but I'll upload a revision with the above
mentioned changes eventually, so you can also wait for that.

On Aug 23, 2017 9:35 PM, "Nico Weber via Phabricator via cfe-commits" <
cfe-commits at lists.llvm.org> wrote:

> thakis created this revision.
> This completes CFG construction for SEH AST nodes.
> Also tweak test `g3` to explicitly check that `__leave` in an `__except`
> leaves the outer `__try`.
> https://reviews.llvm.org/D37090
> Files:
>   lib/Analysis/CFG.cpp
>   test/Sema/warn-unreachable-ms.c
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170824/11239d7f/attachment.html>

More information about the cfe-commits mailing list