mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[OCaml] PR19859: Add functions to query and modify branches.
Patch by Gabriel Radanne <drupyog@zoho.com>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220818 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1451,6 +1451,43 @@ CAMLprim value llvm_set_volatile(value IsVolatile,
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
|
||||
/*--.. Operations on terminators ...........................................--*/
|
||||
|
||||
/* llvalue -> int -> llbasicblock */
|
||||
CAMLprim LLVMBasicBlockRef llvm_successor(LLVMValueRef V, value I) {
|
||||
return LLVMGetSuccessor(V, Int_val(I));
|
||||
}
|
||||
|
||||
/* llvalue -> int -> llvalue -> unit */
|
||||
CAMLprim value llvm_set_successor(LLVMValueRef U, value I, LLVMBasicBlockRef B) {
|
||||
LLVMSetSuccessor(U, Int_val(I), B);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* llvalue -> int */
|
||||
CAMLprim value llvm_num_successors(LLVMValueRef V) {
|
||||
return Val_int(LLVMGetNumSuccessors(V));
|
||||
}
|
||||
|
||||
/*--.. Operations on branch ................................................--*/
|
||||
|
||||
/* llvalue -> llvalue */
|
||||
CAMLprim LLVMValueRef llvm_condition(LLVMValueRef V) {
|
||||
return LLVMGetCondition(V);
|
||||
}
|
||||
|
||||
/* llvalue -> llvalue -> unit */
|
||||
CAMLprim value llvm_set_condition(LLVMValueRef B, LLVMValueRef C) {
|
||||
LLVMSetCondition(B, C);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* llvalue -> bool */
|
||||
CAMLprim value llvm_is_conditional(LLVMValueRef V) {
|
||||
return Val_bool(LLVMIsConditional(V));
|
||||
}
|
||||
|
||||
/*--... Operations on phi nodes ............................................--*/
|
||||
|
||||
/* (llvalue * llbasicblock) -> llvalue -> unit */
|
||||
|
||||
Reference in New Issue
Block a user