ret void
lpad: ; preds = %entry
- %eh_ptr = call i8* @llvm.eh.exception()
+ %exn = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ cleanup
+ %eh_ptr = extractvalue {i8*, i32} %exn, 0
store i8* %eh_ptr, i8** %eh_exception
- %eh_ptr1 = load i8** %eh_exception
- %eh_select2 = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr1, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 0)
+ %eh_select2 = extractvalue {i8*, i32} %exn, 1
store i32 %eh_select2, i32* %eh_selector
br label %ppad
declare void @_Z3barv()
-declare i8* @llvm.eh.exception() nounwind readonly
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
-
declare i32 @llvm.eh.typeid.for(i8*) nounwind
declare i32 @__gxx_personality_sj0(...)
declare i8* @__cxa_allocate_exception(i32)
-declare i8* @llvm.eh.exception() nounwind readonly
-
declare i32 @__gxx_personality_sj0(...)
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
-
declare i32 @llvm.eh.typeid.for(i8*) nounwind
declare void @_Unwind_SjLj_Resume(i8*)
ret i32 %conv
lpad: ; preds = %entry
- %exn = tail call i8* @llvm.eh.exception() nounwind ; <i8*> [#uses=4]
- %eh.selector = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i8* bitcast (%0* @_ZTI1A to i8*), i8* null) nounwind ; <i32> [#uses=1]
+ %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ catch i8* bitcast (%0* @_ZTI1A to i8*)
+ catch i8* null
+ %exn = extractvalue { i8*, i32 } %exn.ptr, 0
+ %eh.selector = extractvalue { i8*, i32 } %exn.ptr, 1
%2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%0* @_ZTI1A to i8*)) nounwind ; <i32> [#uses=1]
%3 = icmp eq i32 %eh.selector, %2 ; <i1> [#uses=1]
br i1 %3, label %try.cont, label %eh.resume
ret void
lpad: ; preds = %bb
- %eh_ptr = call i8* @llvm.eh.exception() ; <i8*> [#uses=1]
- store i8* %eh_ptr, i8** %eh_exception
+ %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ cleanup
+ %exn = extractvalue { i8*, i32 } %eh_ptr, 0
+ store i8* %exn, i8** %eh_exception
%eh_ptr13 = load i8** %eh_exception ; <i8*> [#uses=1]
- %eh_select14 = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr13, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 1)
+ %eh_select14 = extractvalue { i8*, i32 } %eh_ptr, 1
store i32 %eh_select14, i32* %eh_selector
br label %ppad
declare arm_apcscc void @_ZSt9terminatev() noreturn nounwind
-declare i8* @llvm.eh.exception() nounwind readonly
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
-
declare arm_apcscc void @_Unwind_SjLj_Resume(i8*)
declare arm_apcscc void @func3()
br label %for.cond
lpad:
- %exn = tail call i8* @llvm.eh.exception() nounwind
- %eh.selector = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i8* null) nounwind
+ %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
lpad26:
- %exn27 = tail call i8* @llvm.eh.exception() nounwind
- %eh.selector28 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn27, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i8* null) nounwind
+ %exn27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
ret void
lpad44:
- %exn45 = tail call i8* @llvm.eh.exception() nounwind
- %eh.selector46 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn45, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i8* null) nounwind
+ %exn45 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
eh.resume:
- %exn.slot.0 = phi i8* [ %exn27, %lpad26 ], [ %exn, %lpad ], [ %exn45, %lpad44 ]
- tail call void @_Unwind_SjLj_Resume_or_Rethrow(i8* %exn.slot.0) noreturn
- unreachable
+ %exn.slot.0 = phi { i8*, i32 } [ %exn27, %lpad26 ], [ %exn, %lpad ], [ %exn45, %lpad44 ]
+ resume { i8*, i32 } %exn.slot.0
terminate.lpad:
- %exn51 = tail call i8* @llvm.eh.exception() nounwind
- %eh.selector52 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn51, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i8* null) nounwind
+ %exn51 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ catch i8* null
tail call void @_ZSt9terminatev() noreturn nounwind
unreachable
}
declare void @foo()
-declare i8* @llvm.eh.exception() nounwind readonly
-
declare i32 @__gxx_personality_sj0(...)
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
-
declare void @_Unwind_SjLj_Resume_or_Rethrow(i8*)
declare void @_ZSt9terminatev()
declare void @func()
-declare i8* @llvm.eh.exception() nounwind readonly
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
-
-declare void @llvm.eh.resume(i8*, i32)
-
declare i32 @__gxx_personality_sj0(...)
define void @test0() {
ret void
lpad:
- %exn = call i8* @llvm.eh.exception()
- %sel = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 0)
- call void @llvm.eh.resume(i8* %exn, i32 %sel) noreturn
- unreachable
+ %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ cleanup
+ resume { i8*, i32 } %exn
}
; CHECK: __Unwind_SjLj_Resume
ret void
lpad:
- %exn = call i8* @llvm.eh.exception() nounwind
- %eh.selector = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null) nounwind
+ %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ catch i8* null
ret void
}
declare i32 @foo()
-declare i8* @llvm.eh.exception() nounwind readonly
-
declare i32 @__gxx_personality_v0(...)
-
-declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind