[WinEH] Update coloring to handle nested cases cleanly
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 28 Aug 2015 01:12:35 +0000 (01:12 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 28 Aug 2015 01:12:35 +0000 (01:12 +0000)
commit0bf9bbac4562e465ea8e7bc8f428456d71b4215c
tree8f142d2f85e69968d45916866bf9a5e263fe15f8
parentbcd94e99eee9f7967f79acd7f974ae09c837abf3
[WinEH] Update coloring to handle nested cases cleanly

Summary:
Change the coloring algorithm in WinEHPrepare to visit a funclet's exits
in its parents' contexts and so properly classify the continuations of
nested funclets.

Also change the placement of cloned blocks to be deterministic and to
maintain the relative order of each funclet's blocks.

Add a lit test showing various patterns that require cloning, the last
several of which don't have CHECKs yet because they require cloning
entire funclets which is NYI.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12353

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246245 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/WinEH/wineh-cloning.ll [new file with mode: 0644]