[][src]Trait peepmatic_traits::TypingRules

pub trait TypingRules {
    pub fn result_type<'a, C>(
        &self,
        span: C::Span,
        typing_context: &mut C
    ) -> C::TypeVariable
    where
        C: TypingContext<'a>
;
pub fn immediates_arity(&self) -> u8;
pub fn immediate_types<'a, C>(
        &self,
        span: C::Span,
        typing_context: &mut C,
        types: &mut impl Extend<C::TypeVariable>
    )
    where
        C: TypingContext<'a>
;
pub fn parameters_arity(&self) -> u8;
pub fn parameter_types<'a, C>(
        &self,
        span: C::Span,
        typing_context: &mut C,
        types: &mut impl Extend<C::TypeVariable>
    )
    where
        C: TypingContext<'a>
;
pub fn is_reduce(&self) -> bool;
pub fn is_extend(&self) -> bool; }

The typing rules for a TOperator type.

This trait describes the types of immediates, parameters, and results of an operator type, as well as their arity.

Required methods

pub fn result_type<'a, C>(
    &self,
    span: C::Span,
    typing_context: &mut C
) -> C::TypeVariable where
    C: TypingContext<'a>, 
[src]

Get the result type of this operator.

pub fn immediates_arity(&self) -> u8[src]

Get the number of immediates this operator has.

pub fn immediate_types<'a, C>(
    &self,
    span: C::Span,
    typing_context: &mut C,
    types: &mut impl Extend<C::TypeVariable>
) where
    C: TypingContext<'a>, 
[src]

Get the types of this operator's immediates.

pub fn parameters_arity(&self) -> u8[src]

Get the number of parameters this operator has.

pub fn parameter_types<'a, C>(
    &self,
    span: C::Span,
    typing_context: &mut C,
    types: &mut impl Extend<C::TypeVariable>
) where
    C: TypingContext<'a>, 
[src]

Get the types of this operator's parameters.

pub fn is_reduce(&self) -> bool[src]

Is this a bit width reducing instruction?

E.g. Cranelift's ireduce instruction.

pub fn is_extend(&self) -> bool[src]

Is this a bit width extending instruction?

E.g. Cranelift's uextend and sextend instructions.

Loading content...

Implementors

Loading content...