X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=bindings%2Focaml%2Fllvm%2Fllvm_ocaml.c;h=ad4b36cc2bfb36bc66ff168c0d28b33c3f686101;hp=46c170b44f34f228311c30b52ee0dfeda07c11cd;hb=34b4a8426131ec2deea45a1e0174f191c63295e2;hpb=150c95eab549e1d764eab7ed05b17fe09663fc6e diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 46c170b44f3..ad4b36cc2bf 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -454,6 +454,8 @@ enum ValueKind { BlockAddress, ConstantAggregateZero, ConstantArray, + ConstantDataArray, + ConstantDataVector, ConstantExpr, ConstantFP, ConstantInt, @@ -479,6 +481,8 @@ CAMLprim value llvm_classify_value(LLVMValueRef Val) { DEFINE_CASE(Val, BlockAddress); DEFINE_CASE(Val, ConstantAggregateZero); DEFINE_CASE(Val, ConstantArray); + DEFINE_CASE(Val, ConstantDataArray); + DEFINE_CASE(Val, ConstantDataVector); DEFINE_CASE(Val, ConstantExpr); DEFINE_CASE(Val, ConstantFP); DEFINE_CASE(Val, ConstantInt); @@ -771,6 +775,12 @@ CAMLprim LLVMValueRef llvm_const_in_bounds_gep(LLVMValueRef ConstantVal, Wosize_val(Indices)); } +/* llvalue -> lltype -> is_signed:bool -> llvalue */ +CAMLprim LLVMValueRef llvm_const_intcast(LLVMValueRef CV, LLVMTypeRef T, + value IsSigned) { + return LLVMConstIntCast(CV, T, Bool_val(IsSigned)); +} + /* llvalue -> int array -> llvalue */ CAMLprim LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate, value Indices) {