Module Asm_targets.Asm_label
A label in a specific section within the assembly stream. They may be either numeric or textual. (Numeric ones are converted to textual ones by this module.) The argument to String should not include any platform-specific prefix (such as "L", ".L", etc).
Label's numeric or textual names are unique within the assembly stream for a single compilation unit, even across sections. Asm_label keeps track of the section a label belongs to, and doesn't check uniqueness.
Note: Labels are not symbols in the usual sense---they are a construct in the assembler's metalanguage and not accessible in the object file---although on macOS the terminology for labels appears to be "assembler local symbols".
val create : Asm_targets.Asm_section.t -> Asm_targets.Asm_label.tCreate a fresh integer-valued label (using the new_label function passed to initialize, below).
val create_int : Asm_targets.Asm_section.t -> int -> Asm_targets.Asm_label.tCreate an integer-valued label. The int must be positive.
val create_string :
Asm_targets.Asm_section.t ->
string ->
Asm_targets.Asm_label.tCreate a textual label. The supplied name must not require escaping.
val create_string_unchecked :
Asm_targets.Asm_section.t ->
string ->
Asm_targets.Asm_label.tCreate a textual label. Argument string is not checked, so use with caution.
val create_label_for_local_symbol :
Asm_targets.Asm_section.t ->
Asm_targets.Asm_symbol.t ->
Asm_targets.Asm_label.tCreate a special label for a local symbol.
val encode : Asm_targets.Asm_label.t -> stringConvert a label to the corresponding textual form, suitable for direct emission into an assembly file. This may be useful e.g. when emitting an instruction referencing a label.
To be called by the emitter at the very start of code generation. new_label should always be Cmm.new_label. Needed to avoid a circular dependency.
val section : Asm_targets.Asm_label.t -> Asm_targets.Asm_section.tWhich section a label is in.
include Identifiable.S with type t := Asm_targets.Asm_label.t
module T : Identifiable.Thing with type t = Asm_targets.Asm_label.tinclude Identifiable.Thing with type t := Asm_targets.Asm_label.T.t
include Stdlib.Hashtbl.HashedType with type t := Asm_targets.Asm_label.T.t
val equal : Asm_targets.Asm_label.T.t -> Asm_targets.Asm_label.T.t -> boolThe equality predicate used to compare keys.
val hash : Asm_targets.Asm_label.T.t -> intA hashing function on keys. It must be such that if two keys are equal according to equal, then they have identical hash values as computed by hash. Examples: suitable (equal, hash) pairs for arbitrary key types include
- (
(=),hash) for comparing objects by structure (provided objects do not contain floats) - (
(fun x y -> compare x y = 0),hash) for comparing objects by structure and handlingStdlib.nancorrectly - (
(==),hash) for comparing objects by physical equality (e.g. for mutable or cyclic objects).
include Stdlib.Map.OrderedType with type t := Asm_targets.Asm_label.T.t
val compare : Asm_targets.Asm_label.T.t -> Asm_targets.Asm_label.T.t -> intA total ordering function over the keys. This is a two-argument function f such that f e1 e2 is zero if the keys e1 and e2 are equal, f e1 e2 is strictly negative if e1 is smaller than e2, and f e1 e2 is strictly positive if e1 is greater than e2. Example: a suitable ordering function is the generic structural comparison function Stdlib.compare.
val output : Stdlib.out_channel -> Asm_targets.Asm_label.T.t -> unitval print : Stdlib.Format.formatter -> Asm_targets.Asm_label.T.t -> unitmodule Set : Identifiable.Set with module T := Asm_targets.Asm_label.Tmodule Map : Identifiable.Map with module T := Asm_targets.Asm_label.Tmodule Tbl : Identifiable.Tbl with module T := Asm_targets.Asm_label.Tval for_section : Asm_targets.Asm_section.t -> Asm_targets.Asm_label.tRetrieve a distinguished label that is suitable for identifying the start of the given section within a given compilation unit's assembly file. This function supports only DWARF sections. To support more, additional sections and labels have to be emitted in Asm_directives.debug_header.
val for_dwarf_section :
Asm_targets.Asm_section.dwarf_section ->
Asm_targets.Asm_label.tLike for_section, but for DWARF sections only.