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.
a.jump(L1);
// ... your code ...
// Bind label to the current position, see `BaseEmitter::bind()`.
a.bind(L1);

Public Types

- Public Types inherited from asmjit::Operand_

Member Functions

Construction & Destruction
Overloaded Operators
Accessors
- 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.

ConstantDescription
kTypeAnonymous 

Anonymous (unnamed) label.

kTypeLocal 

Local label (always has parentId).

kTypeGlobal 

Global label (never has parentId).

kTypeExternal 

External label (references an external symbol).

kTypeCount 

Number of label types.

Constructor & Destructor Documentation

Label::Label()constexprconstexprnoexcept[1/3]

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.