asmjit::Label Class Reference

Label (jump target or data location).

Label represents a location in code typically used as a jump target, but may be also a reference to some data or a static variable. Label has to be explicitly created by BaseEmitter.

Example of using labels:

// Create some emitter (for example x86::Assembler).
x86::Assembler a;
// Create Label instance.
Label L1 = a.newLabel();
// ... your code ...
// Using label.
// ... your code ...
// Bind label to the current position, see `BaseEmitter::bind()`.

Public Types

- Public Types inherited from asmjit::Operand_

Member Functions

Construction & Destruction
Overloaded Operators
- Public Member Functions inherited from asmjit::Operand
- Public Member Functions inherited from asmjit::Operand_

Additional Inherited Members

- Public Attributes inherited from asmjit::Operand_
- Static Public Member Functions inherited from asmjit::Operand_

Member Enumeration Documentation

Label::LabelType : uint32_tenum

Type of the Label.


Anonymous (unnamed) label.


Local label (always has parentId).


Global label (never has parentId).


Number of label types.

Constructor & Destructor Documentation


Creates a label operand without ID (you must set the ID to make it valid).

Label::Label(const Label& other)constexprconstexprnoexcept[2/3]

Creates a cloned label operand of other.

Label::Label(uint32_t id)constexprexplicitconstexprnoexcept[3/3]

Creates a label operand of the given id.

Member Function Documentation

void Label::reset()noexcept

Resets the label, will reset all properties and set its ID to Globals::kInvalidId.

bool Label::isValid() constconstexprconstexprnoexcept

Tests whether the label was created by CodeHolder and/or an attached emitter.

void Label::setId(uint32_t id)noexcept

Sets the label id.