aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-27 20:18:04 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-27 20:18:04 +0000
commit772fe17a6d07304ae2e6b3052bbb24ebb751f0f3 (patch)
tree650bbc3bc584177420dee94b9fdb338ca8109bb9 /lib/VMCore/Core.cpp
parent7e1547ebf726a40e7ed3dbe89a77e1b946a8e2d0 (diff)
Merge the contents from exception-handling-rewrite to the mainline.
This adds the new instructions 'landingpad' and 'resume'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r--lib/VMCore/Core.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index 3c93736ce1..6664afc188 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -1683,10 +1683,21 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn,
Name));
}
+LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
+ LLVMValueRef PersFn, unsigned NumClauses,
+ const char *Name) {
+ return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), unwrap(PersFn),
+ NumClauses, Name));
+}
+
LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef B) {
return wrap(unwrap(B)->CreateUnwind());
}
+LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn) {
+ return wrap(unwrap(B)->CreateResume(unwrap(Exn)));
+}
+
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B) {
return wrap(unwrap(B)->CreateUnreachable());
}
@@ -1700,6 +1711,17 @@ void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest) {
unwrap<IndirectBrInst>(IndirectBr)->addDestination(unwrap(Dest));
}
+void LLVMAddClause(LLVMValueRef LandingPad, LLVMLandingPadClauseTy ClauseTy,
+ LLVMValueRef ClauseVal) {
+ unwrap<LandingPadInst>(LandingPad)->
+ addClause(static_cast<LandingPadInst::ClauseType>(ClauseTy),
+ unwrap(ClauseVal));
+}
+
+void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val) {
+ unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
+}
+
/*--.. Arithmetic ..........................................................--*/
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,