[PR-2610] Adding Ocaml bindings for Switch::addCase.
[oota-llvm.git] / bindings / ocaml / llvm / llvm.mli
index 5aedefb9257f1993904e6d08c86dc021dffb12ac..a7d26def214ca6f55ee070091ac8628d02ffc333 100644 (file)
@@ -1212,13 +1212,20 @@ external build_br : llbasicblock -> llbuilder -> llvalue = "llvm_build_br"
 external build_cond_br : llvalue -> llbasicblock -> llbasicblock -> llbuilder ->
                          llvalue = "llvm_build_cond_br"
 
-(** [build_switch case elsebb b] creates an empty
+(** [build_switch case elsebb count b] creates an empty
     [switch %case, %elsebb]
-    instruction at the position specified by the instruction builder [b].
+    instruction at the position specified by the instruction builder [b] with
+    space reserved for [count] cases.
     See the method [llvm::LLVMBuilder::CreateSwitch]. *)
 external build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue
                       = "llvm_build_switch"
 
+(** [add_case sw onval bb] causes switch instruction [sw] to branch to [bb]
+    when its input matches the constant [onval].
+    See the method [llvm::SwitchInst::addCase]. **)
+external add_case : llvalue -> llvalue -> llbasicblock -> unit
+                  = "llvm_add_case"
+
 (** [build_invoke fn args tobb unwindbb name b] creates an
     [%name = invoke %fn(args) to %tobb unwind %unwindbb]
     instruction at the position specified by the instruction builder [b].