[WinEH] Fix cleanup state numbering
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 9 Oct 2015 00:46:08 +0000 (00:46 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 9 Oct 2015 00:46:08 +0000 (00:46 +0000)
commitd0bc09c8327b32e23726c2ec87c675e707ab502c
tree3a76e8caeecc2aaa7b75c6dd9e70e55b002ea30b
parentf10802ddc8d414d0fa9f3e264bfd7e212c22d71b
[WinEH] Fix cleanup state numbering

Summary:
 - Recurse from cleanupendpads to their cleanuppads, to make sure the
   cleanuppad is visited if it has a cleanupendpad but no cleanupret.
 - Check for and avoid double-processing cleanuppads, to allow for them to
   have multiple cleanuprets (plus cleanupendpads).
 - Update Cxx state numbering to visit toplevel cleanupendpads and to
   recurse from cleanupendpads to their preds, to ensure we number any
   funclets in inlined cleanups.  SEH state numbering already did this.

Reviewers: rnk

Subscribers: llvm-commits

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

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