[llvm-commits] [llvm] r45481 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp
Gordon Henriksen
gordonhenriksen at mac.com
Mon Dec 31 21:50:58 PST 2007
Author: gordon
Date: Mon Dec 31 23:50:53 2007
New Revision: 45481
URL: http://llvm.org/viewvc/llvm-project?rev=45481&view=rev
Log:
Adding C bindings for SwitchInst::addCase.
Patch by Bryan O'Sullivan!
Modified:
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/lib/VMCore/Core.cpp
Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=45481&r1=45480&r2=45481&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Mon Dec 31 23:50:53 2007
@@ -434,6 +434,10 @@
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);
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=45481&r1=45480&r2=45481&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Mon Dec 31 23:50:53 2007
@@ -813,6 +813,11 @@
return wrap(unwrap(B)->CreateUnreachable());
}
+void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
+ LLVMBasicBlockRef Dest) {
+ unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest));
+}
+
/*--.. Arithmetic ..........................................................--*/
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS,
More information about the llvm-commits
mailing list