[−][src]Struct moore_svlog::GlobalContext
The central data structure of the compiler. It stores references to various arenas and tables that store the results of the various computations that have been performed.
Fields
sess: &'gcx Session
The global compiler session.
arena: &'gcx GlobalArenas<'gcx>
The arena that owns all references.
Implementations
impl<'gcx> GlobalContext<'gcx>
[src]
pub fn new(sess: &'gcx Session, arena: &'gcx GlobalArenas<'gcx>) -> Self
[src]
Create a new global context.
pub fn add_root_nodes(&self, ast: impl Iterator<Item = &'gcx Root<'gcx>>)
[src]
Add root AST nodes to the context for processing.
Use the find_global_item
function afterwards to look up the id of
modules that were added.
pub fn find_module(&self, name: Name) -> Option<NodeId>
[src]
Find a module in the AST.
pub fn modules(&self) -> impl Iterator<Item = (Name, NodeId)>
[src]
Get an iterator over all modules in the AST.
pub fn find_package(&self, name: Name) -> Option<NodeId>
[src]
Find a package in the AST.
pub fn imports(&self) -> impl Iterator<Item = NodeId>
[src]
Get an iterator over all root imports in the AST.
Trait Implementations
impl<'gcx> BaseContext<'gcx> for GlobalContext<'gcx>
[src]
fn gcx(&self) -> &GlobalContext<'gcx>
[src]
fn sess(&self) -> &'gcx Session
[src]
fn arena(&self) -> &'gcx GlobalArenas<'gcx>
[src]
fn tables(&self) -> &GlobalTables<'gcx>
[src]
fn unimp<T: HasSpan + HasDesc, R>(&self, node: &T) -> Result<R>
[src]
fn unimp_msg<T: HasSpan + HasDesc, R>(
&self,
msg: impl Into<String>,
node: &T
) -> Result<R>
[src]
&self,
msg: impl Into<String>,
node: &T
) -> Result<R>
fn alloc_id(&self, span: Span) -> NodeId
[src]
fn span(&self, node_id: NodeId) -> Span
[src]
fn set_ast(&self, node_id: NodeId, ast: AstNode<'gcx>)
[src]
fn map_ast(&self, ast: AstNode<'gcx>) -> NodeId
[src]
fn map_ast_with_parent(&self, ast: AstNode<'gcx>, parent: NodeId) -> NodeId
[src]
fn ast_of(&self, node_id: NodeId) -> Result<AstNode<'gcx>>
[src]
fn intern_hir(&self, id: NodeId, hir: HirNode<'gcx>)
[src]
fn intern_hir_with_parent(&self, id: NodeId, hir: HirNode<'gcx>, parent: NodeId)
[src]
fn interned_hir(&self, id: NodeId) -> HirNode<'gcx>
[src]
fn get_interned_hir(&self, id: NodeId) -> Option<HirNode<'gcx>>
[src]
fn intern_type(&self, ty: TypeKind<'gcx>) -> Type<'gcx>
[src]
fn intern_value(&self, value: ValueData<'gcx>) -> Value<'gcx>
[src]
fn mkty_void(&self) -> Type<'gcx>
[src]
fn mkty_time(&self) -> Type<'gcx>
[src]
fn mkty_bit(&self) -> Type<'gcx>
[src]
fn mkty_logic(&self) -> Type<'gcx>
[src]
fn mkty_named(&self, name: Spanned<Name>, binding: NodeEnvId) -> Type<'gcx>
[src]
fn mkty_int(&self, width: usize) -> Type<'gcx>
[src]
fn mkty_integer(&self, width: usize) -> Type<'gcx>
[src]
fn mkty_struct(&self, def_id: NodeId) -> Type<'gcx>
[src]
fn mkty_packed_array(&self, size: usize, elem_ty: Type<'gcx>) -> Type<'gcx>
[src]
fn intern_param_env(&self, env: ParamEnvData<'gcx>) -> ParamEnv
[src]
fn param_env_data(&self, env: ParamEnv) -> &'gcx ParamEnvData<'gcx>
[src]
fn default_param_env(&self) -> ParamEnv
[src]
fn add_param_env_context(&self, env: ParamEnv, context: NodeId)
[src]
fn param_env_contexts(&self, env: ParamEnv) -> Vec<NodeId>
[src]
fn set_parent(&self, node_id: NodeId, parent_id: NodeId)
[src]
fn parent_node_id(&self, node_id: NodeId) -> Option<NodeId>
[src]
fn is_parent_of(&self, parent_id: NodeId, child_id: NodeId) -> bool
[src]
fn resolve_upwards_or_error(
&self,
name: Spanned<Name>,
start_at: NodeId
) -> Result<NodeId>
[src]
&self,
name: Spanned<Name>,
start_at: NodeId
) -> Result<NodeId>
fn resolve_downwards_or_error(
&self,
name: Spanned<Name>,
start_at: NodeId
) -> Result<NodeId>
[src]
&self,
name: Spanned<Name>,
start_at: NodeId
) -> Result<NodeId>
fn set_lowering_hint(&self, node_id: NodeId, hint: Hint)
[src]
fn lowering_hint(&self, node_id: NodeId) -> Option<Hint>
[src]
fn constant_int_value_of(
&self,
node_id: NodeId,
env: ParamEnv
) -> Result<&'gcx BigInt>
[src]
&self,
node_id: NodeId,
env: ParamEnv
) -> Result<&'gcx BigInt>
impl<'gcx> Context<'gcx> for GlobalContext<'gcx>
[src]
fn hir_of(&self, node_id: NodeId) -> Result<HirNode<'a>>
[src]
fn param_env(&self, src: ParamEnvSource<'a>) -> Result<ParamEnv>
[src]
fn type_of(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>>
[src]
fn map_to_type(&self, node_id: NodeId, env: ParamEnv) -> Result<Type<'a>>
[src]
fn cast_type(&self, node_id: NodeId, env: ParamEnv) -> Option<CastType<'a>>
[src]
fn self_determined_type(
&self,
node_id: NodeId,
env: ParamEnv
) -> Option<Type<'a>>
[src]
&self,
node_id: NodeId,
env: ParamEnv
) -> Option<Type<'a>>
fn need_self_determined_type(&self, node_id: NodeId, env: ParamEnv) -> Type<'a>
[src]
fn operation_type(&self, node_id: NodeId, env: ParamEnv) -> Option<Type<'a>>
[src]
fn need_operation_type(&self, node_id: NodeId, env: ParamEnv) -> Type<'a>
[src]
fn type_context(
&self,
node_id: NodeId,
env: ParamEnv
) -> Option<TypeContext<'a>>
[src]
&self,
node_id: NodeId,
env: ParamEnv
) -> Option<TypeContext<'a>>
fn need_type_context(&self, node_id: NodeId, env: ParamEnv) -> TypeContext<'a>
[src]
fn local_rib(&self, node_id: NodeId) -> Result<&'a Rib>
[src]
fn hierarchical_rib(&self, node_id: NodeId) -> Result<&'a Rib>
[src]
fn resolve_upwards(
&self,
name: Name,
start_at: NodeId
) -> Result<Option<NodeId>>
[src]
&self,
name: Name,
start_at: NodeId
) -> Result<Option<NodeId>>
fn resolve_downwards(
&self,
name: Name,
start_at: NodeId
) -> Result<Option<NodeId>>
[src]
&self,
name: Name,
start_at: NodeId
) -> Result<Option<NodeId>>
fn resolve_node(&self, node_id: NodeId, env: ParamEnv) -> Result<NodeId>
[src]
fn constant_value_of(&self, node_id: NodeId, env: ParamEnv) -> Result<Value<'a>>
[src]
fn is_constant(&self, node_id: NodeId) -> Result<bool>
[src]
fn type_default_value(&self, ty: Type<'a>) -> Value<'a>
[src]
fn accessed_nodes(&self, node_id: NodeId) -> Result<Arc<AccessTable>>
[src]
fn port_mapping(&self, src: PortMappingSource<'a>) -> Result<Arc<PortMapping>>
[src]
fn struct_def(&self, node_id: NodeId) -> Result<Arc<StructDef>>
[src]
fn resolve_field_access(
&self,
node_id: NodeId,
env: ParamEnv
) -> Result<(NodeId, usize, NodeId)>
[src]
&self,
node_id: NodeId,
env: ParamEnv
) -> Result<(NodeId, usize, NodeId)>
fn mir_lvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Lvalue<'a>
[src]
fn mir_rvalue(&self, expr_id: NodeId, env: ParamEnv) -> &'a Rvalue<'a>
[src]
fn const_mir_rvalue(&self, mir: Ref<'a, Rvalue<'a>>) -> Value<'a>
[src]
fn inst_details(&self, inst: NodeEnvId) -> Result<Arc<InstDetails<'a>>>
[src]
fn inst_target_details(
&self,
inst: NodeEnvId
) -> Result<Arc<InstTargetDetails<'a>>>
[src]
&self,
inst: NodeEnvId
) -> Result<Arc<InstTargetDetails<'a>>>
impl<'_> DiagEmitter for GlobalContext<'_>
[src]
fn emit(&self, diag: DiagBuilder2)
[src]
Auto Trait Implementations
impl<'gcx> !RefUnwindSafe for GlobalContext<'gcx>
impl<'gcx> !Send for GlobalContext<'gcx>
impl<'gcx> !Sync for GlobalContext<'gcx>
impl<'gcx> Unpin for GlobalContext<'gcx>
impl<'gcx> !UnwindSafe for GlobalContext<'gcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,