Struct cretonne_codegen::ir::function::Function [] [src]

pub struct Function {
    pub name: ExternalName,
    pub signature: Signature,
    pub stack_slots: StackSlots,
    pub global_vars: PrimaryMap<GlobalVar, GlobalVarData>,
    pub heaps: PrimaryMap<Heap, HeapData>,
    pub jump_tables: JumpTables,
    pub dfg: DataFlowGraph,
    pub layout: Layout,
    pub encodings: InstEncodings,
    pub locations: ValueLocations,
    pub offsets: EbbOffsets,
    pub srclocs: SourceLocs,
}

A function.

Functions can be cloned, but it is not a very fast operation. The clone will have all the same entity numbers as the original.

Fields

Name of this function. Mostly used by .cton files.

Signature of this function.

Stack slots allocated in this function.

Global variables referenced.

Heaps referenced.

Jump tables used in this function.

Data flow graph containing the primary definition of all instructions, EBBs and values.

Layout of EBBs and instructions in the function body.

Encoding recipe and bits for the legal instructions. Illegal instructions have the Encoding::default() value.

Location assigned to every value.

Code offsets of the EBB headers.

This information is only transiently available after the binemit::relax_branches function computes it, and it can easily be recomputed by calling that function. It is not included in the textual IR format.

Source locations.

Track the original source location for each instruction. The source locations are not interpreted by Cretonne, only preserved.

Methods

impl Function
[src]

[src]

Create a function with the given name and signature.

[src]

Clear all data structures in this function.

[src]

Create a new empty, anonymous function with a SystemV calling convention.

[src]

Creates a jump table in the function, to be used by br_table instructions.

[src]

Inserts an entry in a previously declared jump table.

[src]

Creates a stack slot in the function, to be used by stack_load, stack_store and stack_addr instructions.

[src]

Adds a signature which can later be used to declare an external function import.

[src]

Declare an external function import.

[src]

Declares a global variable accessible to the function.

[src]

Declares a heap accessible to the function.

[src]

Return an object that can display this function with correct ISA-specific annotations.

[src]

Find a presumed unique special-purpose function parameter value.

Returns the value of the last purpose parameter, or None if no such parameter exists.

Important traits for InstOffsetIter<'a>
[src]

Get an iterator over the instructions in ebb, including offsets and encoded instruction sizes.

The iterator returns (offset, inst, size) tuples, where offset if the offset in bytes from the beginning of the function to the instruction, and size is the size of the instruction in bytes, or 0 for unencoded instructions.

This function can only be used after the code layout has been computed by the binemit::relax_branches() function.

[src]

Wrapper around encode which assigns inst the resulting encoding.

[src]

Wrapper around TargetIsa::encode for encoding an existing instruction in the Function.

Trait Implementations

impl Clone for Function
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Function
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for Function
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Function

impl Sync for Function