IndexBuilderasmjit::BaseNode

asmjit::BaseNode Class Reference [¶]

Inheritance diagram for asmjit::BaseNode:
asmjit::AlignNode asmjit::CommentNode asmjit::EmbedDataNode asmjit::EmbedLabelDeltaNode asmjit::EmbedLabelNode asmjit::InstNode asmjit::LabelNode asmjit::SectionNode asmjit::SentinelNode

Base node.

Every node represents a building-block used by BaseBuilder. It can be instruction, data, label, comment, directive, or any other high-level representation that can be transformed to the building blocks mentioned. Every class that inherits BaseBuilder can define its own high-level nodes that can be later lowered to basic nodes like instructions.

Classes

Member Functions

Construction & Destruction

Accessors

BaseNode::BaseNode(
NodeType node_type,
)explicitnoexcept[¶]

Creates a new BaseNode - always use BaseBuilder to allocate nodes.

template<typename T>
T* BaseNode::as()nodiscardnoexcept[1/2][¶]

Casts this node to T*.

template<typename T>
const T* BaseNode::as() constnodiscardnoexcept[2/2][¶]

Casts this node to const T*.

BaseNode* BaseNode::prev() constnodiscardnoexcept[¶]

Returns previous node or nullptr if this node is either first or not part of Builder/Compiler node-list.

BaseNode* BaseNode::next() constnodiscardnoexcept[¶]

Returns next node or nullptr if this node is either last or not part of Builder/Compiler node-list.

NodeType BaseNode::type() constnodiscardnoexcept[¶]

Returns the type of the node, see NodeType.

void BaseNode::_set_type()noexcept[¶]

Sets the type of the node, see NodeType (internal).

Remarks

You should never set a type of a node to anything else than the initial value. This function is only provided for users that use custom nodes and need to change the type either during construction or later.

bool BaseNode::is_inst() constnodiscardnoexcept[¶]

Tests whether this node is either InstNode or extends it.

bool BaseNode::is_section() constnodiscardnoexcept[¶]

Tests whether this node is SectionNode.

bool BaseNode::is_label() constnodiscardnoexcept[¶]

Tests whether this node is either LabelNode or extends it.

bool BaseNode::is_align() constnodiscardnoexcept[¶]

Tests whether this node is AlignNode.

bool BaseNode::is_embed_data() constnodiscardnoexcept[¶]

Tests whether this node is EmbedDataNode.

bool BaseNode::is_embed_label() constnodiscardnoexcept[¶]

Tests whether this node is EmbedLabelNode.

bool BaseNode::is_embed_label_delta() constnodiscardnoexcept[¶]

Tests whether this node is EmbedLabelDeltaNode.

bool BaseNode::is_const_pool() constnodiscardnoexcept[¶]

Tests whether this node is ConstPoolNode.

bool BaseNode::is_comment() constnodiscardnoexcept[¶]

Tests whether this node is CommentNode.

bool BaseNode::is_sentinel() constnodiscardnoexcept[¶]

Tests whether this node is SentinelNode.

bool BaseNode::is_func() constnodiscardnoexcept[¶]

Tests whether this node is FuncNode.

bool BaseNode::is_func_ret() constnodiscardnoexcept[¶]

Tests whether this node is FuncRetNode.

bool BaseNode::is_invoke() constnodiscardnoexcept[¶]

Tests whether this node is InvokeNode.

NodeFlags BaseNode::flags() constnodiscardnoexcept[¶]

Returns the node flags.

bool BaseNode::has_flag() constnodiscardnoexcept[¶]

Tests whether the node has the given flag set.

void BaseNode::_assign_flags()noexcept[¶]

Replaces node flags with flags.

void BaseNode::_add_flags()noexcept[¶]

Adds the given flags to node flags.

void BaseNode::_clear_flags()noexcept[¶]

Clears the given flags from node flags.

bool BaseNode::is_code() constnodiscardnoexcept[¶]

Tests whether the node is code that can be executed.

bool BaseNode::is_data() constnodiscardnoexcept[¶]

Tests whether the node is data that cannot be executed.

bool BaseNode::is_informative() constnodiscardnoexcept[¶]

Tests whether the node is informative only (is never encoded like comment, etc...).

bool BaseNode::is_removable() constnodiscardnoexcept[¶]

Tests whether the node is removable if it's in an unreachable code block.

bool BaseNode::has_no_effect() constnodiscardnoexcept[¶]

Tests whether the node has no effect when executed (label, .align, nop, ...).

bool BaseNode::is_active() constnodiscardnoexcept[¶]

Tests whether the node is part of the code.

bool BaseNode::has_position() constnodiscardnoexcept[¶]

Tests whether the node has a position assigned.

Remarks

Returns true if node position is non-zero.

NodePosition BaseNode::position() constnodiscardnoexcept[¶]

Returns node position.

void BaseNode::set_position()noexcept[¶]

Sets node position.

Node position is a 32-bit unsigned integer that is used by Compiler to track where the node is relatively to the start of the function. It doesn't describe a byte position in a binary, instead it's just a pseudo position used by liveness analysis and other tools around Compiler.

If you don't use Compiler then you may use position() and set_position() freely for your own purposes if the 32-bit value limit is okay for you.

bool BaseNode::has_pass_data() constnodiscardnoexcept[¶]

Tests whether the node has an associated pass data.

template<typename T>
T* BaseNode::pass_data() constnodiscardnoexcept[¶]

Returns the node pass data - data used during processing & transformations.

template<typename T>
void BaseNode::set_pass_data(
T* data
)noexcept[¶]

Sets the node pass data to data.

void BaseNode::reset_pass_data()noexcept[¶]

Resets the node pass data to nullptr.

bool BaseNode::has_inline_comment() constnodiscardnoexcept[¶]

Tests whether the node has an inline comment/annotation.

const char* BaseNode::inline_comment() constnodiscardnoexcept[¶]

Returns an inline comment/annotation string.

void BaseNode::set_inline_comment(
const char* s
)noexcept[¶]

Sets an inline comment/annotation string to s.

void BaseNode::reset_inline_comment()noexcept[¶]

Resets an inline comment/annotation string to nullptr.

BaseNode* BaseNode::_prev[¶]

Previous node.

BaseNode* BaseNode::_next[¶]

Next node.

BaseNode* BaseNode::_links[2][¶]

Links (an alternative view of previous and next nodes).

NodeType BaseNode::_node_type[¶]

Node type.

NodeFlags BaseNode::_node_flags[¶]

Node flags.

AnyData BaseNode::_any[¶]

Data useful by any node type.

AlignData BaseNode::_align_data[¶]

Data specific to AlignNode.

InstData BaseNode::_inst[¶]

Data specific to InstNode.

EmbedData BaseNode::_embed[¶]

Data specific to EmbedDataNode.

SentinelData BaseNode::_sentinel[¶]

Data specific to SentinelNode.

union {... } BaseNode[¶]

Data that can have different meaning depending on NodeType.

NodePosition BaseNode::_position[¶]

Node position in code (should be unique).

void* BaseNode::_pass_data[¶]

Data used exclusively by the current Pass.

const char* BaseNode::_inline_comment[¶]

Inline comment/annotation or nullptr if not used.