asmjit::Formatter Namespace Reference

Provides formatting functionality to format operands, instructions, and nodes.

Functions

Function Documentation

Error Formatter::formatTypeId(String& sb, TypeId typeId)noexcept

Appends a formatted typeId to the output string sb.

Error Formatter::formatFeature(String& sb, Arch arch, uint32_t featureId)noexcept

Appends a formatted featureId to the output string sb.

See CpuFeatures.

Error Formatter::formatRegister(String& sb, FormatFlags formatFlags, const BaseEmitter* emitter, Arch arch, RegType regType, uint32_t regId)noexcept

Appends a formatted register to the output string sb.

Note
Emitter is optional, but it's required to format virtual registers, which won't be formatted properly if the emitter is not provided.

Error Formatter::formatLabel(String& sb, FormatFlags formatFlags, const BaseEmitter* emitter, uint32_t labelId)noexcept

Appends a formatted label to the output string sb.

Note
Emitter is optional, but it's required to format named labels properly, otherwise the formatted as it is an anonymous label.

Error Formatter::formatOperand(String& sb, FormatFlags formatFlags, const BaseEmitter* emitter, Arch arch, const Operand_& op)noexcept

Appends a formatted operand to the output string sb.

Note
Emitter is optional, but it's required to format named labels and virtual registers. See formatRegister() and formatLabel() for more details.

Error Formatter::formatDataType(String& sb, FormatFlags formatFlags, Arch arch, TypeId typeId)noexcept

Appends a formatted data-type to the output string sb.

Error Formatter::formatData(String& sb, FormatFlags formatFlags, Arch arch, TypeId typeId, const void* data, size_t itemCount, size_t repeatCount = 1)noexcept

Appends a formatted data to the output string sb.

Error Formatter::formatInstruction(String& sb, FormatFlags formatFlags, const BaseEmitter* emitter, Arch arch, const BaseInst& inst, const Operand_* operands, size_t opCount)noexcept

Appends a formatted instruction to the output string sb.

Note
Emitter is optional, but it's required to format named labels and virtual registers. See formatRegister() and formatLabel() for more details.

Error Formatter::formatNode(String& sb, const FormatOptions& formatOptions, const BaseBuilder* builder, const BaseNode* node)noexcept

Appends a formatted node to the output string sb.

The node must belong to the provided builder.

Error Formatter::formatNodeList(String& sb, const FormatOptions& formatOptions, const BaseBuilder* builder)noexcept[1/2]

Appends formatted nodes to the output string sb.

All nodes that are part of the given builder will be appended.

Error Formatter::formatNodeList(String& sb, const FormatOptions& formatOptions, const BaseBuilder* builder, const BaseNode* begin, const BaseNode* end)noexcept[2/2]

Appends formatted nodes to the output string sb.

This function works the same as formatNode(), but appends more nodes to the output string, separating each node with a newline '
' character.