Revert r258580 and r258581.
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 1 Feb 2016 03:29:38 +0000 (03:29 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 1 Feb 2016 03:29:38 +0000 (03:29 +0000)
commit784d4a455b42272c27a28e152d4c9f9e51293aa4
treec442a6bde753d5a1220d8e68be0e0b3cb62afa7e
parent0dd4a9a9f44975d6f9ad301925dc89552a78eb0c
Revert r258580 and r258581.

Those commits created an artificial edge from a cleanup to a synthesized
catchswitch in order to get the MSVC personality routine to execute
cleanups which don't cleanupret and are not wrapped by a catchswitch.

This worked well enough but is not a complete solution in situations
where there the cleanup infinite loops.

However, the real deal breaker behind this approach comes about from a
degenerate case where the cleanup is post-dominated by unreachable *and*
throws an exception.  This ends poorly because the catchswitch will
inadvertently catch the exception.

Because of this we should go back to our previous behavior of not
executing certain cleanups (identical behavior with the Itanium ABI
implementation in clang, GCC and ICC).

N.B. I think this could be salvaged by making the catchpad rethrow the
exception and properly transforming throwing calls in the cleanup into
invokes.

llvm-svn: 259338
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/test/CodeGen/WinEH/wineh-cleanuppad-nounwind.ll [deleted file]
llvm/test/CodeGen/WinEH/wineh-cloning.ll
llvm/test/CodeGen/WinEH/wineh-demotion.ll
llvm/test/CodeGen/WinEH/wineh-no-demotion.ll