Trait disassemble::Instruction [] [src]

pub trait Instruction: Debug {
    fn address(&self) -> Address;
    fn comment(&self) -> Option<String>;
    fn is_call(&self) -> bool;
    fn is_local_conditional_jump(&self) -> bool;
    fn is_local_jump(&self) -> bool;
    fn is_return(&self) -> bool;
    fn target_address(&self) -> Option<Address>;

    fn is_block_terminator(&self) -> bool { ... }
}

An assembly instruction, bytecode operation, VM operation, etc.

This trait will be implemented for a variety of backends and provides the general means by which the rest of the code in this library can be re-used.

This is intended to be fairly generic and is how other parts of this library query information that is specific to a given platform and body of generated code.

Required Methods

fn address(&self) -> Address

The address of this Instruction.

The address of an instruction must be unique within a function.

fn comment(&self) -> Option<String>

Any associated comment text for this instruction.

fn is_call(&self) -> bool

Does this instruction represent a call?

fn is_local_conditional_jump(&self) -> bool

Does this instruction represent a local conditional jump?

fn is_local_jump(&self) -> bool

Does this instruction represent a local conditional or unconditional jump?

fn is_return(&self) -> bool

Does this instruction represent a function return?

fn target_address(&self) -> Option<Address>

If this is a call or local jump, what is the target address?

Provided Methods

fn is_block_terminator(&self) -> bool

Does this instruction terminate a BasicBlock?

This is used when constructing a [control flow graph] to help break a sequence of instructions into basic blocks.

Implementors