cairo_lang_sierra_generator::db

Trait SierraGenGroup

Source
pub trait SierraGenGroup:
    Database
    + HasQueryGroup<SierraGenDatabase>
    + LoweringGroup
    + Upcast<dyn LoweringGroup> {
Show 21 methods // Required methods fn intern_label_id(&self, id: LabelLongId) -> LabelId; fn lookup_intern_label_id(&self, key: LabelId) -> LabelLongId; fn intern_concrete_lib_func( &self, id: ConcreteLibfuncLongId, ) -> ConcreteLibfuncId; fn lookup_intern_concrete_lib_func( &self, key: ConcreteLibfuncId, ) -> ConcreteLibfuncLongId; fn intern_concrete_type( &self, id: SierraGeneratorTypeLongId, ) -> ConcreteTypeId; fn lookup_intern_concrete_type( &self, key: ConcreteTypeId, ) -> SierraGeneratorTypeLongId; fn intern_sierra_function(&self, id: FunctionId) -> FunctionId; fn lookup_intern_sierra_function(&self, key: FunctionId) -> FunctionId; fn get_concrete_type_id(&self, type_id: TypeId) -> Maybe<ConcreteTypeId>; fn get_index_enum_type_id( &self, index_count: usize, ) -> Maybe<ConcreteTypeId>; fn get_concrete_long_type_id( &self, type_id: TypeId, ) -> Maybe<Arc<ConcreteTypeLongId>>; fn is_self_referential(&self, type_id: TypeId) -> Maybe<bool>; fn type_dependencies(&self, type_id: TypeId) -> Maybe<Arc<[TypeId]>>; fn has_in_deps(&self, type_id: TypeId, needle: TypeId) -> Maybe<bool>; fn get_function_signature( &self, function_id: FunctionId, ) -> Maybe<Arc<FunctionSignature>>; fn get_type_info( &self, concrete_type_id: ConcreteTypeId, ) -> Maybe<Arc<TypeInfo>>; fn priv_function_with_body_sierra_data( &self, function_id: ConcreteFunctionWithBodyId, ) -> SierraFunctionWithBodyData; fn function_with_body_sierra( &self, function_id: ConcreteFunctionWithBodyId, ) -> Maybe<Arc<Function>>; fn get_ap_change( &self, function_id: ConcreteFunctionWithBodyId, ) -> Maybe<SierraApChange>; fn get_sierra_program_for_functions( &self, requested_function_ids: Vec<ConcreteFunctionWithBodyId>, ) -> Maybe<Arc<SierraProgramWithDebug>>; fn get_sierra_program( &self, requested_crate_ids: Vec<CrateId>, ) -> Maybe<Arc<SierraProgramWithDebug>>;
}

Required Methods§

Source

fn intern_label_id(&self, id: LabelLongId) -> LabelId

Source

fn lookup_intern_label_id(&self, key: LabelId) -> LabelLongId

Source

fn intern_concrete_lib_func( &self, id: ConcreteLibfuncLongId, ) -> ConcreteLibfuncId

Source

fn lookup_intern_concrete_lib_func( &self, key: ConcreteLibfuncId, ) -> ConcreteLibfuncLongId

Source

fn intern_concrete_type(&self, id: SierraGeneratorTypeLongId) -> ConcreteTypeId

Source

fn lookup_intern_concrete_type( &self, key: ConcreteTypeId, ) -> SierraGeneratorTypeLongId

Source

fn intern_sierra_function(&self, id: FunctionId) -> FunctionId

Creates a Sierra function id for a function id of the semantic model.

Source

fn lookup_intern_sierra_function(&self, key: FunctionId) -> FunctionId

Source

fn get_concrete_type_id(&self, type_id: TypeId) -> Maybe<ConcreteTypeId>

Returns the matching sierra concrete type id for a given semantic type id.

Source

fn get_index_enum_type_id(&self, index_count: usize) -> Maybe<ConcreteTypeId>

Returns the ConcreteTypeId of the index enum type with the given index count.

Source

fn get_concrete_long_type_id( &self, type_id: TypeId, ) -> Maybe<Arc<ConcreteTypeLongId>>

Returns the matching sierra concrete type long id for a given semantic type id.

Source

fn is_self_referential(&self, type_id: TypeId) -> Maybe<bool>

Returns if the semantic id has a circular definition.

Source

fn type_dependencies(&self, type_id: TypeId) -> Maybe<Arc<[TypeId]>>

Returns the semantic type ids the type is directly dependent on.

A type depends on another type if it contains or may contain it, as a field or by holding a reference to it.

Source

fn has_in_deps(&self, type_id: TypeId, needle: TypeId) -> Maybe<bool>

Source

fn get_function_signature( &self, function_id: FunctionId, ) -> Maybe<Arc<FunctionSignature>>

Returns the cairo_lang_sierra::program::FunctionSignature object for the given function id.

Source

fn get_type_info( &self, concrete_type_id: ConcreteTypeId, ) -> Maybe<Arc<TypeInfo>>

Returns the cairo_lang_sierra::extensions::types::TypeInfo object for the given type id.

Source

fn priv_function_with_body_sierra_data( &self, function_id: ConcreteFunctionWithBodyId, ) -> SierraFunctionWithBodyData

Private query to compute Sierra data about a function with body.

Source

fn function_with_body_sierra( &self, function_id: ConcreteFunctionWithBodyId, ) -> Maybe<Arc<Function>>

Returns the Sierra code (as pre_sierra::Function) for a given function with body.

Source

fn get_ap_change( &self, function_id: ConcreteFunctionWithBodyId, ) -> Maybe<SierraApChange>

Returns the ap change of a given function if it is known at compile time or SierraApChange::Unknown otherwise.

Source

fn get_sierra_program_for_functions( &self, requested_function_ids: Vec<ConcreteFunctionWithBodyId>, ) -> Maybe<Arc<SierraProgramWithDebug>>

Returns the SierraProgramWithDebug object of the requested functions.

Source

fn get_sierra_program( &self, requested_crate_ids: Vec<CrateId>, ) -> Maybe<Arc<SierraProgramWithDebug>>

Returns the SierraProgramWithDebug object of the requested crates.

Trait Implementations§

Source§

impl DebugWithDb<dyn SierraGenGroup> for SierraProgramWithDebug

Implementation for a debug print of a Sierra program with all locations. The print is a valid textual Sierra program.

Source§

fn fmt(&self, f: &mut Formatter<'_>, db: &dyn SierraGenGroup) -> Result

Source§

fn debug<'me, 'db>(&'me self, db: &'me Db) -> DebugWith<'me, Db>
where Self: Sized + 'me,

Source§

fn into_debug<'me, 'db>(self, db: &'me Db) -> DebugWith<'me, Db>
where Self: Sized + 'me,

Source§

impl<'a> Intern<'a, dyn SierraGenGroup + 'a, ConcreteLibfuncId> for ConcreteLibfuncLongId

Source§

fn intern( self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> ConcreteLibfuncId

Source§

impl<'a> Intern<'a, dyn SierraGenGroup + 'a, ConcreteTypeId> for SierraGeneratorTypeLongId

Source§

fn intern( self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> ConcreteTypeId

Source§

impl<'a> Intern<'a, dyn SierraGenGroup + 'a, FunctionId> for FunctionId

Source§

fn intern( self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> FunctionId

Source§

impl<'a> Intern<'a, dyn SierraGenGroup + 'a, LabelId> for LabelLongId

Source§

fn intern(self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized)) -> LabelId

Source§

impl<'a> LookupIntern<'a, dyn SierraGenGroup + 'a, ConcreteLibfuncLongId> for ConcreteLibfuncId

Source§

fn lookup_intern( &self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> ConcreteLibfuncLongId

Source§

impl<'a> LookupIntern<'a, dyn SierraGenGroup + 'a, FunctionId> for FunctionId

Source§

fn lookup_intern( &self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> FunctionId

Source§

impl<'a> LookupIntern<'a, dyn SierraGenGroup + 'a, LabelLongId> for LabelId

Source§

fn lookup_intern( &self, db: &(impl Upcast<dyn SierraGenGroup + 'a> + ?Sized), ) -> LabelLongId

Source§

impl<'a> LookupIntern<'a, dyn SierraGenGroup + 'a, SierraGeneratorTypeLongId> for ConcreteTypeId

Implementors§

Source§

impl<DB> SierraGenGroup for DB
where DB: LoweringGroup + Upcast<dyn LoweringGroup> + Database + HasQueryGroup<SierraGenDatabase>,