Re: [PATCH] D37090: Implement CFG construction for __finally.

2017-08-25 Thread Nico Weber via cfe-commits
On Thu, Aug 24, 2017 at 1:04 PM, Reid Kleckner via Phabricator via cfe-commits wrote: > rnk added a comment. > > Re: jumps out of __try, I wonder if you can tie __finally into whatever > the CFG does for C++ destructors. > Given $ cat test.cc struct C { C();

[PATCH] D37090: Implement CFG construction for __finally.

2017-08-24 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. Re: jumps out of __try, I wonder if you can tie __finally into whatever the CFG does for C++ destructors. Comment at: test/Sema/warn-unreachable-ms.c:49 __try { - f(); + throw 1; } __except (1) { Nice. Would any

Re: [PATCH] D37090: Implement CFG construction for __finally.

2017-08-24 Thread Nico Weber via cfe-commits
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

[PATCH] D37090: Implement CFG construction for __finally.

2017-08-23 Thread Nico Weber via Phabricator via cfe-commits
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 Index: