-(*===-- tools/ml/llvm.ml - LLVM Ocaml Interface ---------------------------===*
+(*===-- llvm/llvm.ml - LLVM Ocaml Interface --------------------------------===*
*
* The LLVM Compiler Infrastructure
*
- * This file was developed by Gordon Henriksen and is distributed under the
- * University of Illinois Open Source License. See LICENSE.TXT for details.
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
| Protected
end
-let ccc = 0
-let fastcc = 8
-let coldcc = 9
-let x86_stdcallcc = 64
-let x86_fastcallcc = 65
+module CallConv = struct
+ let c = 0
+ let fast = 8
+ let cold = 9
+ let x86_stdcall = 64
+ let x86_fastcall = 65
+end
module Icmp = struct
type t =
external create_module : string -> llmodule = "llvm_create_module"
external dispose_module : llmodule -> unit = "llvm_dispose_module"
+external target_triple: llmodule -> string
+ = "llvm_target_triple"
+external set_target_triple: string -> llmodule -> unit
+ = "llvm_set_target_triple"
+external data_layout: llmodule -> string
+ = "llvm_data_layout"
+external set_data_layout: string -> llmodule -> unit
+ = "llvm_set_data_layout"
external define_type_name : string -> lltype -> llmodule -> bool
= "llvm_add_type_name"
external delete_type_name : string -> llmodule -> unit
external value_is_block : llvalue -> bool = "llvm_value_is_block"
external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock"
+(*--... Operations on call sites ...........................................--*)
+external instruction_call_conv: llvalue -> int
+ = "llvm_instruction_call_conv"
+external set_instruction_call_conv: int -> llvalue -> unit
+ = "llvm_set_instruction_call_conv"
+
(*--... Operations on phi nodes ............................................--*)
external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
= "llvm_add_incoming"
(*===-- Instruction builders ----------------------------------------------===*)
+external builder: unit-> llbuilder
+ = "llvm_builder"
external builder_before : llvalue -> llbuilder = "llvm_builder_before"
external builder_at_end : llbasicblock -> llbuilder = "llvm_builder_at_end"
external position_before : llvalue -> llbuilder -> unit = "llvm_position_before"