cairo_lang_sierra_generator/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! Lowering from the semantic model down to Sierra. See [cairo_lang_semantic] and
//! [cairo_lang_sierra].

use db::{SierraGenGroup, SierraGeneratorTypeLongId};

mod ap_change;
mod ap_tracking;
mod block_generator;
pub mod canonical_id_replacer;
pub mod db;
pub mod executables;
mod expr_generator_context;
mod extra_sierra_info;
mod function_generator;
#[cfg(any(feature = "testing", test))]
pub mod function_generator_test_utils;
mod id_allocator;
mod lifetime;
mod local_variables;
mod next_statement_index_fetch;
pub mod pre_sierra;
pub mod program_generator;
pub mod replace_ids;
mod resolve_labels;
mod specialization_context;
pub mod statements_code_locations;
pub mod statements_functions;
pub mod statements_locations;
mod store_variables;
#[cfg(any(feature = "testing", test))]
pub mod test_utils;
mod types;
mod utils;

impl<'a>
    cairo_lang_utils::LookupIntern<
        'a,
        dyn SierraGenGroup + 'a,
        cairo_lang_sierra::program::ConcreteLibfuncLongId,
    > for cairo_lang_sierra::ids::ConcreteLibfuncId
{
    fn lookup_intern(
        &self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> cairo_lang_sierra::program::ConcreteLibfuncLongId {
        SierraGenGroup::lookup_intern_concrete_lib_func(db.upcast(), self.clone())
    }
}

impl<'a>
    cairo_lang_utils::LookupIntern<
        'a,
        dyn SierraGenGroup + 'a,
        cairo_lang_lowering::ids::FunctionId,
    > for cairo_lang_sierra::ids::FunctionId
{
    fn lookup_intern(
        &self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> cairo_lang_lowering::ids::FunctionId {
        SierraGenGroup::lookup_intern_sierra_function(db.upcast(), self.clone())
    }
}

impl<'a> cairo_lang_utils::LookupIntern<'a, dyn SierraGenGroup + 'a, SierraGeneratorTypeLongId>
    for cairo_lang_sierra::ids::ConcreteTypeId
{
    fn lookup_intern(
        &self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> SierraGeneratorTypeLongId {
        SierraGenGroup::lookup_intern_concrete_type(db.upcast(), self.clone())
    }
}

impl<'a>
    cairo_lang_utils::Intern<'a, dyn SierraGenGroup + 'a, cairo_lang_sierra::ids::ConcreteLibfuncId>
    for cairo_lang_sierra::program::ConcreteLibfuncLongId
{
    fn intern(
        self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> cairo_lang_sierra::ids::ConcreteLibfuncId {
        SierraGenGroup::intern_concrete_lib_func(db.upcast(), self)
    }
}

impl<'a> cairo_lang_utils::Intern<'a, dyn SierraGenGroup + 'a, cairo_lang_sierra::ids::FunctionId>
    for cairo_lang_lowering::ids::FunctionId
{
    fn intern(
        self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> cairo_lang_sierra::ids::FunctionId {
        SierraGenGroup::intern_sierra_function(db.upcast(), self)
    }
}

impl<'a>
    cairo_lang_utils::Intern<'a, dyn SierraGenGroup + 'a, cairo_lang_sierra::ids::ConcreteTypeId>
    for SierraGeneratorTypeLongId
{
    fn intern(
        self,
        db: &(impl cairo_lang_utils::Upcast<dyn SierraGenGroup + 'a> + ?Sized),
    ) -> cairo_lang_sierra::ids::ConcreteTypeId {
        SierraGenGroup::intern_concrete_type(db.upcast(), self)
    }
}