package bap-core-theory

  1. Overview
  2. Docs

Information about the compiler.

A compiler is a translator that was used to translate the code in this unit from the source to the target representation.

  • since 2.2.0
include Base.Comparable.S with type t = compiler
include Base.Comparisons.S with type t = compiler
include Base.Comparisons.Infix with type t = compiler
type t = compiler
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int

compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.

val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool

between t ~low ~high means low <= t <= high

val clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
type comparator_witness
include Core_kernel.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader

This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.

val bin_shape_t : Bin_prot.Shape.t
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
include Core_kernel.Pretty_printer.S with type t := t
val pp : Base.Formatter.t -> t -> unit
val create : ?specs:(string * string) list -> ?version:string list -> ?options:string list -> string -> compiler

declare name declares a compiler.

The compiler here represents more of a process that compiled the unit rather than a specific program, thus it includes the configuration parameters and command-line options.

val name : compiler -> string

name compiler returns the compiler name.

  • since 2.5.0
val version : compiler -> string list

version the compiler version.

The least specific (aka major) version comes first in the list, with more detailed versions added after. The exact meaning of the version consituents is specific to the compiler.

val options : compiler -> string list

options the list of options that were used to compile the unit.

Options are specified as a list of command-line options with possible repetitions. The meaning of the options is specific to the compiler.

Note, that options are the options passed to the compiler when this compilation unit was compiled from the source, not the options of the compiler itsef, for the latter see specs.

specs the configuration of the compiler.

A key-value storage of the configuration parameters of the compiler itself.

val to_string : compiler -> string

is the textual representation of the compiler descriptor