diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-25 14:25:49 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-25 14:25:49 +0000 |
commit | 2fe5752e3a7c345cdb59e869278d36af33c13fa4 (patch) | |
tree | df68ca4b788599e14cbadaf19b704672393efccd /lib/IR/Core.cpp | |
parent | 69156b4c20249e7800cc09e0eef0beb3d15ac1ad (diff) |
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r-- | lib/IR/Core.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index e0e729d534bd4..0eb88a9675751 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -2257,7 +2257,14 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn, } LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - unsigned NumClauses, const char *Name) { + LLVMValueRef PersFn, unsigned NumClauses, + const char *Name) { + // The personality used to live on the landingpad instruction, but now it + // lives on the parent function. For compatibility, take the provided + // personality and put it on the parent function. + if (PersFn) + unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( + cast<Function>(unwrap(PersFn))); return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); } |