# Module Llvm_target.TargetMachine

    module TargetMachine: sig .. end

    type t

    val create : triple:string ->
           ?cpu:string ->
           ?features:string ->
           ?level:Llvm_target.CodeGenOptLevel.t ->
           ?reloc_mode:Llvm_target.RelocMode.t ->
           ?code_model:Llvm_target.CodeModel.t ->
           Llvm_target.Target.t -> t

Creates a new target machine. See `llvm::Target::createTargetMachine`.

    val target : t -> Llvm_target.Target.t

Returns the Target used in a TargetMachine

    val triple : t -> string

Returns the triple used while creating this target machine. See `llvm::TargetMachine::getTriple`.

    val cpu : t -> string

Returns the CPU used while creating this target machine. See `llvm::TargetMachine::getCPU`.

    val data_layout : t -> Llvm_target.DataLayout.t

Returns the data layout of this target machine.

    val features : t -> string

Returns the feature string used while creating this target machine. See `llvm::TargetMachine::getFeatureString`.

    val set_verbose_asm : bool -> t -> unit

Sets the assembly verbosity of this target machine. See `llvm::TargetMachine::setAsmVerbosity`.

    val set_fast_isel : bool -> t -> unit

Enable fast-path instruction selection. See `llvm::TargetMachine::setFastISel`.

    val set_global_isel : bool -> t -> unit

Enable global instruction selection. See `llvm::TargetMachine::setGlobalISel`.

    val set_global_isel_abort : ?mode:Llvm_target.GlobalISelAbortMode.t ->
           t -> unit

Set abort behaviour when global instruction selection fails to lower/select an instruction. See `llvm::TargetMachine::setGlobalISelAbort`.

    val set_machine_outliner : bool -> t -> unit

Enable the MachineOutliner pass. See `llvm::TargetMachine::setMachineOutliner`.

    val emit_to_file : Llvm.llmodule ->
           Llvm_target.CodeGenFileType.t ->
           string -> t -> unit

Emits assembly or object data for the given module to the given file or raise `Error`.

    val emit_to_memory_buffer : Llvm.llmodule ->
           Llvm_target.CodeGenFileType.t ->
           t -> Llvm.llmemorybuffer

Emits assembly or object data for the given module to a fresh memory buffer or raise `Error`.