diff options
| author | John McCall <rjmccall@apple.com> | 2011-05-28 07:45:59 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-05-28 07:45:59 +0000 |
| commit | 046c47e970369dbe3e74ad4a992e7ab0512939bc (patch) | |
| tree | f785721a28290a309aeb6b23e2089da6e73ad126 /llvm/test | |
| parent | 375dcc9ec9d6000b3c6436b2fbe66b876251f1cf (diff) | |
| download | bcm5719-llvm-046c47e970369dbe3e74ad4a992e7ab0512939bc.tar.gz bcm5719-llvm-046c47e970369dbe3e74ad4a992e7ab0512939bc.zip | |
Implement and document the llvm.eh.resume intrinsic, which is
transformed by the inliner into a branch to the enclosing landing pad
(when inlined through an invoke). If not so optimized, it is lowered
DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume
as appropriate). Its chief advantage is that it takes both the
exception value and the selector value as arguments, meaning that there
is zero effort in recovering these; however, the frontend is required
to pass these down, which is not actually particularly difficult.
Also document the behavior of landing pads a bit better, and make it
clearer that it's okay that personality functions don't always land at
landing pads. This is just a fact of life. Don't write optimizations that
rely on pushing things over an unwind edge.
llvm-svn: 132253
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/Inline/inline_invoke.ll | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/llvm/test/Transforms/Inline/inline_invoke.ll b/llvm/test/Transforms/Inline/inline_invoke.ll index bd955e3bc95..93d4ef346c2 100644 --- a/llvm/test/Transforms/Inline/inline_invoke.ll +++ b/llvm/test/Transforms/Inline/inline_invoke.ll @@ -18,7 +18,7 @@ declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind declare i32 @llvm.eh.typeid.for(i8*) nounwind -declare void @_Unwind_Resume(i8*) +declare void @llvm.eh.resume(i8*, i32) declare i32 @__gxx_personality_v0(...) @@ -51,7 +51,7 @@ lpad: to label %invoke.cont2 unwind label %terminate.lpad invoke.cont2: - call void @_Unwind_Resume(i8* %exn) noreturn + call void @llvm.eh.resume(i8* %exn, i32 %eh.selector) noreturn unreachable terminate.lpad: @@ -82,22 +82,27 @@ catch: br label %ret eh.resume: - call void @_Unwind_Resume(i8* %exn) noreturn + call void @llvm.eh.resume(i8* %exn, i32 %eh.selector) noreturn unreachable } -; CHECK: define void @test0_out() -; CHECK: [[A:%.*]] = alloca %struct.A, -; CHECK: [[B:%.*]] = alloca %struct.A, -; CHECK: invoke void @_ZN1AC1Ev(%struct.A* [[A]]) -; CHECK: invoke void @_ZN1AC1Ev(%struct.A* [[B]]) -; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[B]]) -; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[A]]) -; CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* {{%.*}}, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i32 0, i8* bitcast (i8** @_ZTIi to i8*)) +; CHECK: define void @test0_out() +; CHECK: [[A:%.*]] = alloca %struct.A, +; CHECK: [[B:%.*]] = alloca %struct.A, +; CHECK: invoke void @_ZN1AC1Ev(%struct.A* [[A]]) +; CHECK: invoke void @_ZN1AC1Ev(%struct.A* [[B]]) +; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[B]]) +; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[A]]) +; CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* {{%.*}}, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i32 0, i8* bitcast (i8** @_ZTIi to i8*)) ; CHECK-NEXT: invoke void @_ZN1AD1Ev(%struct.A* [[A]]) ; CHECK-NEXT: to label %[[LBL:[^\s]+]] unwind ; CHECK: [[LBL]]: ; CHECK-NEXT: br label %[[LPAD:[^\s]+]] -; CHECK: [[LPAD]]: -; CHECK-NEXT: call i8* @llvm.eh.exception() +; CHECK: ret void +; CHECK: call i8* @llvm.eh.exception() ; CHECK-NEXT: call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* {{%.*}}, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* bitcast (i8** @_ZTIi to i8*)) +; CHECK-NEXT: br label %[[LPAD]] +; CHECK: [[LPAD]]: +; CHECK-NEXT: phi i8* [ +; CHECK-NEXT: phi i32 [ +; CHECK-NEXT: call i32 @llvm.eh.typeid.for(
\ No newline at end of file |

