[][src]Trait moore_svlog::Context

pub trait Context<'a>: GetQueryTable<HirOfQuery<'a>> + GetQueryTable<ParamEnvQuery<'a>> + GetQueryTable<TypeOfQuery<'a>> + GetQueryTable<MapToTypeQuery<'a>> + GetQueryTable<SelfDeterminedTypeQuery<'a>> + GetQueryTable<NeedSelfDeterminedTypeQuery<'a>> + GetQueryTable<OperationTypeQuery<'a>> + GetQueryTable<NeedOperationTypeQuery<'a>> + GetQueryTable<TypeContextQuery<'a>> + GetQueryTable<NeedTypeContextQuery<'a>> + GetQueryTable<LocalRibQuery<'a>> + GetQueryTable<HierarchicalRibQuery<'a>> + GetQueryTable<ResolveUpwardsQuery<'a>> + GetQueryTable<ResolveDownwardsQuery<'a>> + GetQueryTable<ResolveNodeQuery<'a>> + GetQueryTable<ConstantValueOfQuery<'a>> + GetQueryTable<IsConstantQuery<'a>> + GetQueryTable<TypeDefaultValueQuery<'a>> + GetQueryTable<AccessedNodesQuery<'a>> + GetQueryTable<PortMappingQuery<'a>> + GetQueryTable<StructDefQuery<'a>> + GetQueryTable<ResolveFieldAccessQuery<'a>> + GetQueryTable<MirLvalueQuery<'a>> + GetQueryTable<MirRvalueQuery<'a>> + BaseContext<'a> {
    fn hir_of(&self, node_id: NodeId) -> Result<HirNode<'a>> { ... }
fn param_env(&self, src: ParamEnvSource<'a>) -> Result<ParamEnv> { ... }
fn type_of(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>> { ... }
fn map_to_type(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>> { ... }
fn self_determined_type(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> Option<Type<'a>> { ... }
fn need_self_determined_type(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> Type<'a> { ... }
fn operation_type(&self, node_id: NodeId, env: ParamEnv) -> Option<Type<'a>> { ... }
fn need_operation_type(&self, node_id: NodeId, env: ParamEnv) -> Type<'a> { ... }
fn type_context(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> Option<TypeContext<'a>> { ... }
fn need_type_context(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> TypeContext<'a> { ... }
fn local_rib(&self, node_id: NodeId) -> Result<&'a Rib> { ... }
fn hierarchical_rib(&self, node_id: NodeId) -> Result<&'a Rib> { ... }
fn resolve_upwards(
        &self,
        name: Name,
        start_at: NodeId
    ) -> Result<Option<NodeId>> { ... }
fn resolve_downwards(
        &self,
        name: Name,
        start_at: NodeId
    ) -> Result<Option<NodeId>> { ... }
fn resolve_node(&self, node_id: NodeId, env: ParamEnv) -> Result<NodeId> { ... }
fn constant_value_of(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> Result<Value<'a>> { ... }
fn is_constant(&self, node_id: NodeId) -> Result<bool> { ... }
fn type_default_value(&self, ty: Type<'a>) -> Value<'a> { ... }
fn accessed_nodes(&self, node_id: NodeId) -> Result<Arc<AccessTable>> { ... }
fn port_mapping(
        &self,
        src: PortMappingSource<'a>
    ) -> Result<Arc<PortMapping>> { ... }
fn struct_def(&self, node_id: NodeId) -> Result<Arc<StructDef>> { ... }
fn resolve_field_access(
        &self,
        node_id: NodeId,
        env: ParamEnv
    ) -> Result<(NodeId, usize, NodeId)> { ... }
fn mir_lvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Lvalue<'a> { ... }
fn mir_rvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Rvalue<'a> { ... } }

A collection of compiler queries.

Provided methods

fn hir_of(&self, node_id: NodeId) -> Result<HirNode<'a>>

Lower an AST node to HIR.

fn param_env(&self, src: ParamEnvSource<'a>) -> Result<ParamEnv>

Compute the parameter bindings for an instantiation.

fn type_of(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>>

Determine the type of a node.

fn map_to_type(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>>

Convert a node to a type.

fn self_determined_type(
    &self,
    node_id: NodeId,
    env: ParamEnv
) -> Option<Type<'a>>

Get the self-determined type of a node.

fn need_self_determined_type(&self, node_id: NodeId, env: ParamEnv) -> Type<'a>

Require a node to have a self-determined type.

Emits an error if the node has no self-determined type.

fn operation_type(&self, node_id: NodeId, env: ParamEnv) -> Option<Type<'a>>

Get the operation type of an expression.

fn need_operation_type(&self, node_id: NodeId, env: ParamEnv) -> Type<'a>

Require a node to have an operation type.

Emits an error if the node has no operation type.

fn type_context(
    &self,
    node_id: NodeId,
    env: ParamEnv
) -> Option<TypeContext<'a>>

Get the type context of a node.

fn need_type_context(&self, node_id: NodeId, env: ParamEnv) -> TypeContext<'a>

Require a node to have a type context.

Emits an error if the node has no type context.

fn local_rib(&self, node_id: NodeId) -> Result<&'a Rib>

Determine the local rib that applies to a node.

fn hierarchical_rib(&self, node_id: NodeId) -> Result<&'a Rib>

Determine the hierarchical rib of a node.

fn resolve_upwards(
    &self,
    name: Name,
    start_at: NodeId
) -> Result<Option<NodeId>>

Resolve a name upwards through the ribs.

fn resolve_downwards(
    &self,
    name: Name,
    start_at: NodeId
) -> Result<Option<NodeId>>

Resolve a name downwards through the ribs.

fn resolve_node(&self, node_id: NodeId, env: ParamEnv) -> Result<NodeId>

Resolve a node to its target.

fn constant_value_of(&self, node_id: NodeId, env: ParamEnv) -> Result<Value<'a>>

Determine the constant value of a node.

fn is_constant(&self, node_id: NodeId) -> Result<bool>

Check if a node has a constant value.

fn type_default_value(&self, ty: Type<'a>) -> Value<'a>

Determine the default value of a type.

fn accessed_nodes(&self, node_id: NodeId) -> Result<Arc<AccessTable>>

Determine the nodes accessed by another node.

fn port_mapping(&self, src: PortMappingSource<'a>) -> Result<Arc<PortMapping>>

Compute the port assignments for an instantiation.

fn struct_def(&self, node_id: NodeId) -> Result<Arc<StructDef>>

Obtain the details of a struct definition.

fn resolve_field_access(
    &self,
    node_id: NodeId,
    env: ParamEnv
) -> Result<(NodeId, usize, NodeId)>

Resolve the field name in a field access expression.

Returns the node id of the corresponding struct definition, the index of the field that is actually being accessed, and the node id of the field definition.

fn mir_lvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Lvalue<'a>

Lower an expression to an lvalue in the MIR.

fn mir_rvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Rvalue<'a>

Lower an expression to an rvalue in the MIR.

Loading content...

Implementors

impl<'gcx> Context<'gcx> for GlobalContext<'gcx>[src]

Loading content...