Source

TyLLVM / LLVM.mli

Full commit
type link_type =
  | Private
  | Linker_private
  | Linker_private_weak
  | Internal
  | Available_externally
  | Linkonce
  | Weak
  | Common
  | Appending
  | Extern_weak
  | Linkonce_odr
  | Weak_odr
  | Linkonce_odr_auto_hide
  | External
  | Dllimport
  | Dllexport

type data_type =
  | Int of int
  | Array of int * data_type
  | Pointer of data_type
  | Function of data_type array * data_type

type address =
  | Addrspace of int
  | Unnamed_addr
  | None_addr

type thread_local =
  | Localdynamic
  | Initialexec
  | Localexec

type context_module =
  | Global of
    (string * thread_local option *
    address * link_type option * bool *
    data_type * string option * int option)

(*
 *  Global:
 *    - identifier
 *    - may be defined as thread_local
 *    - can be marked with unnamed_address | may be declared to reside in a
 *    target-specific numbered address space
 *    - have one of types of linkage
 *    - may be defined as a global constant
 *    - may optionally be initialized (not present)
 *    - may have an explicit section to be placed in
 *    - may have an optional explicit alignment specified (power of 2)
 *)

val new_global:
  ?thread_local:thread_local option ->
  ?address: address ->
  ?link_type: link_type option ->
  ?constant: bool ->
  ?section: string option ->
  ?alignment: int option ->
  string -> data_type -> context_module

val print_context_module: context_module -> unit