llvm.org GIT mirror llvm / 41585aa
Merge r242372 to 3.7 so that it goes out in 3.7.1 It restores the signature of LLVMBuildLandingPad in the C API back to what it was in 3.6 and earlier. The 3.7.0 release should have had this but it did not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@247191 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
4 changed file(s) with 12 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
17271727 func (b Builder) CreateLandingPad(t Type, personality Value, nclauses int, name string) (l Value) {
17281728 cname := C.CString(name)
17291729 defer C.free(unsafe.Pointer(cname))
1730 l.C = C.LLVMBuildLandingPad(b.C, t.C, C.unsigned(nclauses), cname)
1730 l.C = C.LLVMBuildLandingPad(b.C, t.C, nil, C.unsigned(nclauses), cname)
17311731 return l
17321732 }
17331733
17441744 CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn,
17451745 value NumClauses, value Name,
17461746 value B) {
1747 return LLVMBuildLandingPad(Builder_val(B), Ty, Int_val(NumClauses),
1747 return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses),
17481748 String_val(Name));
17491749 }
17501750
26742674 LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
26752675 const char *Name);
26762676 LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
2677 unsigned NumClauses, const char *Name);
2677 LLVMValueRef PersFn, unsigned NumClauses,
2678 const char *Name);
26782679 LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn);
26792680 LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
26802681
22562256 }
22572257
22582258 LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
2259 unsigned NumClauses, const char *Name) {
2259 LLVMValueRef PersFn, unsigned NumClauses,
2260 const char *Name) {
2261 // The personality used to live on the landingpad instruction, but now it
2262 // lives on the parent function. For compatibility, take the provided
2263 // personality and put it on the parent function.
2264 if (PersFn)
2265 unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn(
2266 cast(unwrap(PersFn)));
22602267 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
22612268 }
22622269