pub struct OpcodeConstraints { /* private fields */ }
Expand description

Value type constraints for a given opcode.

The InstructionFormat determines the constraints on most operands, but Value operands and results are not determined by the format. Every Opcode has an associated OpcodeConstraints object that provides the missing details.

Implementations

Can the controlling type variable for this opcode be inferred from the designated value input operand? This also implies that this opcode is polymorphic.

Is it necessary to look at the designated value input operand in order to determine the controlling type variable, or is it good enough to use the first return type?

Most polymorphic instructions produce a single result with the type of the controlling type variable. A few polymorphic instructions either don’t produce any results, or produce results with a fixed type. These instructions return true.

Get the number of fixed result values produced by this opcode. This does not include variable_args produced by calls.

Get the number of fixed input values required by this opcode.

This does not include variable_args arguments on call and branch instructions.

The number of fixed input values is usually implied by the instruction format, but instruction formats that use a ValueList put both fixed and variable arguments in the list. This method returns the minimum number of values required in the value list.

Get the value type of result number n, having resolved the controlling type variable to ctrl_type.

Get the value type of input value number n, having resolved the controlling type variable to ctrl_type.

Unlike results, it is possible for some input values to vary freely within a specific ValueTypeSet. This is represented with the ArgumentConstraint::Free variant.

Get the typeset of allowed types for the controlling type variable in a polymorphic instruction.

Is this instruction polymorphic?

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.