llvm.org GIT mirror llvm / c8ac229
[OCaml] (PR16318) Add missing argument to Llvm.const_intcast git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194065 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 6 years ago
4 changed file(s) with 17 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
528528 = "LLVMConstTruncOrBitCast"
529529 external const_pointercast : llvalue -> lltype -> llvalue
530530 = "LLVMConstPointerCast"
531 external const_intcast : llvalue -> lltype -> llvalue = "LLVMConstIntCast"
531 external const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
532 = "llvm_const_intcast"
532533 external const_fpcast : llvalue -> lltype -> llvalue = "LLVMConstFPCast"
533534 external const_select : llvalue -> llvalue -> llvalue -> llvalue
534535 = "LLVMConstSelect"
11171117 See the method [llvm::ConstantExpr::getPointerCast]. *)
11181118 val const_pointercast : llvalue -> lltype -> llvalue
11191119
1120 (** [const_intcast c ty] returns a constant zext, bitcast, or trunc for integer
1121 -> integer casts of constant [c] to type [ty].
1122 See the method [llvm::ConstantExpr::getIntCast]. *)
1123 val const_intcast : llvalue -> lltype -> llvalue
1120 (** [const_intcast c ty ~is_signed] returns a constant sext/zext, bitcast,
1121 or trunc for integer -> integer casts of constant [c] to type [ty].
1122 When converting a narrower value to a wider one, whether sext or zext
1123 will be used is controlled by [is_signed].
1124 See the method [llvm::ConstantExpr::getIntegerCast]. *)
1125 val const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
11241126
11251127 (** [const_fpcast c ty] returns a constant fpext, bitcast, or fptrunc for fp ->
11261128 fp casts of constant [c] to type [ty].
770770 Wosize_val(Indices));
771771 }
772772
773 /* llvalue -> lltype -> is_signed:bool -> llvalue */
774 CAMLprim LLVMValueRef llvm_const_intcast(LLVMValueRef CV, LLVMTypeRef T,
775 value IsSigned) {
776 return LLVMConstIntCast(CV, T, Bool_val(IsSigned));
777 }
778
773779 /* llvalue -> int array -> llvalue */
774780 CAMLprim LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate,
775781 value Indices) {
285285 * CHECK: const_ptrtoint{{.*}}ptrtoint
286286 * CHECK: const_inttoptr{{.*}}inttoptr
287287 * CHECK: const_bitcast{{.*}}bitcast
288 * CHECK: const_intcast{{.*}}zext
288289 *)
289290 let i128_type = integer_type context 128 in
290291 ignore (define_global "const_trunc" (const_trunc (const_add foldbomb five)
304305 ignore (define_global "const_inttoptr" (const_inttoptr (const_add foldbomb five)
305306 void_ptr) m);
306307 ignore (define_global "const_bitcast" (const_bitcast ffoldbomb i64_type) m);
308 ignore (define_global "const_intcast"
309 (const_intcast foldbomb i128_type ~is_signed:false) m);
307310
308311 group "misc constants";
309312 (* CHECK: const_size_of{{.*}}getelementptr{{.*}}null