Struct falcon::il::ControlFlowGraph [] [src]

pub struct ControlFlowGraph { /* fields omitted */ }

A directed graph of types Block and Edge.

Entry and Exit

A ControlFlowGraph has an optional, "Entry," and an optional, "Exit." When these are provided, certain convenience functions become available.

For example, when translating a native instruction to Falcon IL, it can be useful to consider an instruction as its own ControlFlowGraph. rep scasb is a great example of when this pattern is helpful. Instructions in a Block will have one entry, and one exit. Explicitly declaring these makes merging ControlFlowGraphs easier.

Methods

impl ControlFlowGraph
[src]

[src]

[src]

Returns the underlying graph

[src]

Sets the entry point for this ControlFlowGraph to the given Block index.

[src]

Sets the exit point for this ControlFlowGraph to the given Block index.

[src]

Get the entry Block index for this ControlFlowGraph.

[src]

Get the exit Block index for this ControlFlowGraph.

[src]

Get a Block by index.

[src]

Get a mutable reference to a Block by index.

[src]

Get every Block in this ControlFlowGraph.

[src]

Get a mutable reference to every Block in this ControlFlowGraph.

[src]

Get an Edge by its head and tail Block indices.

[src]

Get a mutable reference to an Edge by its head and tail Block indices.

[src]

Get every Edge in thie ControlFlowGraph.

[src]

Get a mutable reference to every Edge in this ControlFlowGraph.

[src]

Get every incoming edge to a block

[src]

Get every outgoing edge from a block

[src]

Sets the address for all instructions in this ControlFlowGraph.

Useful for translators to set address information.

[src]

Returns the entry block for this ControlFlowGraph

[src]

Generates a temporary scalar unique to this control flow graph.

[src]

Creates a new basic block, adds it to the graph, and returns it

[src]

Creates an unconditional edge from one block to another block

[src]

Creates a conditional edge from one block to another block

[src]

Merge Blocks.

When a Block as only one successor, and that successor has only one predecessor, we merge both into one Block.

[src]

Appends a control flow graph to this control flow graph.

In order for this to work, the entry and exit of boths graphs must be set, which should be the case for all conformant translators. You can also append to an empty ControlFlowGraph.

[src]

Inserts a control flow graph into this control flow graph, and returns the entry and exit indices for inserted graph.

Requires the graph being inserted to have entry set.

This function causes the ControlFlowGraph to become disconnected.

This function is useful for inserting multiple ControlFlowGraphs into one before adding all Edges in a subsequent pass.

Warnings

This invalidates the entry and exit of the control flow graph.

Trait Implementations

impl Clone for ControlFlowGraph
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ControlFlowGraph
[src]

[src]

Formats the value using the given formatter. Read more

impl Eq for ControlFlowGraph
[src]

impl Hash for ControlFlowGraph
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for ControlFlowGraph
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialEq for ControlFlowGraph
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl PartialOrd for ControlFlowGraph
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Display for ControlFlowGraph
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations