diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 0d446d6640c..9def5158299 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -434,6 +434,10 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn, LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef); LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); +/* Add a case to the switch instruction */ +void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, + LLVMBasicBlockRef Dest); + /* Arithmetic */ LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index fe414279064..8722785bd39 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -813,6 +813,11 @@ LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B) { return wrap(unwrap(B)->CreateUnreachable()); } +void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, + LLVMBasicBlockRef Dest) { + unwrap(Switch)->addCase(unwrap(OnVal), unwrap(Dest)); +} + /*--.. Arithmetic ..........................................................--*/ LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,