Re: [PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-23 Thread Nico Weber via cfe-commits
On Wed, Aug 23, 2017 at 12:11 PM, Reid Kleckner via Phabricator via cfe-commits wrote: > rnk added inline comments. > > > > Comment at: test/Sema/warn-unreachable-ms.c:42 > + } > +} > > rnk wrote: > > rnk wrote: > > > Can we add a

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-23 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: test/Sema/warn-unreachable-ms.c:42 + } +} rnk wrote: > rnk wrote: > > Can we add a test to exercise that this builds the right CFG? > > ``` > > __try { > > __try { > > f(); > > } __except(1) { > > __leave; //

Re: [PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-23 Thread Nico Weber via cfe-commits
On Tue, Aug 22, 2017 at 9:23 PM, Reid Kleckner via Phabricator via cfe-commits wrote: > rnk accepted this revision. > rnk added a comment. > This revision is now accepted and ready to land. > 311561, thanks! > Looks good! > > > > > Comment at:

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-22 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. Looks good! Comment at: test/Sema/warn-unreachable-ms.c:42 + } +} rnk wrote: > Can we add a test to exercise that this builds the right CFG? > ``` > __try { >

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-22 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 112261. thakis added a comment. add test from rnk https://reviews.llvm.org/D36914 Files: lib/Analysis/CFG.cpp test/Sema/warn-unreachable-ms.c Index: test/Sema/warn-unreachable-ms.c === ---

Re: [PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-22 Thread Nico Weber via cfe-commits
On Tue, Aug 22, 2017 at 5:56 PM, Reid Kleckner via Phabricator via cfe-commits wrote: > rnk added a comment. > > Looks functionally correct > > > > > Comment at: test/Sema/warn-unreachable-ms.c:42 > + } > +} > > Can we add a test to

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-22 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. Looks functionally correct Comment at: test/Sema/warn-unreachable-ms.c:42 + } +} Can we add a test to exercise that this builds the right CFG? ``` __try { __try { f(); } __except(1) { __leave; // should exit outer try }

Re: [PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-22 Thread Nico Weber via cfe-commits
rnk: ping :-) On Mon, Aug 21, 2017 at 1:43 PM, Nico Weber via Phabricator via cfe-commits wrote: > thakis added inline comments. > > > > Comment at: lib/Analysis/CFG.cpp:448 > +BuildOpts(buildOpts), switchExclusivelyCovered(false), > +

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-21 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 112015. thakis edited the summary of this revision. thakis added a comment. Just use TryTerminatedBlock https://reviews.llvm.org/D36914 Files: lib/Analysis/CFG.cpp test/Sema/warn-unreachable-ms.c Index: test/Sema/warn-unreachable-ms.c

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-21 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: lib/Analysis/CFG.cpp:448 +BuildOpts(buildOpts), switchExclusivelyCovered(false), +switchCond(nullptr), cachedEntry(nullptr), lastLookup(nullptr) {} (this is now a no-op and only a clang-formatting of

Re: [PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-21 Thread Nico Weber via cfe-commits
On Mon, Aug 21, 2017 at 12:41 PM, Reid Kleckner via Phabricator via cfe-commits wrote: > rnk added a comment. > > > Don't add any EH edges to the CFG for SEH. In practice, > BuildOpts.AddEHEdges is always false in practice from what I can tell, and > with SEH every

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-21 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. > Don't add any EH edges to the CFG for SEH. In practice, BuildOpts.AddEHEdges > is always false in practice from what I can tell, and with SEH every single > stmt would have to get an EH edge. Since we can't mix C++ EH and SEH, do you think it would be better to reuse the

[PATCH] D36914: Implement CFG construction for __try / __except / __leave.

2017-08-18 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision. This makes -Wunreachable-code work for programs containing SEH (except for __finally, which is still missing for now). __try is modeled like try (but simpler since it can only have a single __except or __finally), __except is fairly similar to catch (but simpler,