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>,