diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2015-09-27 01:47:46 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2015-09-27 01:47:46 +0000 |
commit | 09af67aba54e6d2a05e3071c0c7ba43bde678df9 (patch) | |
tree | ff8dfefbf81e9a6ae3f2f3ded3ade5b8a54b8ed7 /llvm/test/CodeGen/WinEH/wineh-cloning.ll | |
parent | d47346d0f8f0012c556e4ce656c4222eec8d08d6 (diff) | |
download | bcm5719-llvm-09af67aba54e6d2a05e3071c0c7ba43bde678df9.tar.gz bcm5719-llvm-09af67aba54e6d2a05e3071c0c7ba43bde678df9.zip |
[EH] Create removeUnwindEdge utility
Summary:
Factor the code that rewrites invokes to calls and rewrites WinEH
terminators to their "unwind to caller" equivalents into a helper in
Utils/Local, and use it in the three places I'm aware of that need to do
this.
Reviewers: andrew.w.kaylor, majnemer, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13152
llvm-svn: 248677
Diffstat (limited to 'llvm/test/CodeGen/WinEH/wineh-cloning.ll')
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-cloning.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll index 4500f96e6f6..1ed71ef8375 100644 --- a/llvm/test/CodeGen/WinEH/wineh-cloning.ll +++ b/llvm/test/CodeGen/WinEH/wineh-cloning.ll @@ -421,3 +421,34 @@ unreachable: ; CHECK-NEXT: catchendpad unwind to caller ; CHECK: exit: ; CHECK-NEXT: ret void + +define void @test11() personality i32 (...)* @__CxxFrameHandler3 { +entry: + invoke void @f() + to label %exit unwind label %cleanup.outer +cleanup.outer: + %outer = cleanuppad [] + invoke void @f() + to label %outer.cont unwind label %cleanup.inner +outer.cont: + br label %merge +cleanup.inner: + %inner = cleanuppad [] + br label %merge +merge: + invoke void @f() + to label %unreachable unwind label %merge.end +unreachable: + unreachable +merge.end: + cleanupendpad %outer unwind to caller +exit: + ret void +} +; merge.end will get cloned for outer and inner, but is implausible +; from inner, so the invoke @f() in inner's copy of merge should be +; rewritten to call @f() +; CHECK-LABEL: define void @test11() +; CHECK: %inner = cleanuppad [] +; CHECK-NEXT: call void @f() +; CHECK-NEXT: unreachable |