Split cache between Python and Erg modules

This commit is contained in:
Shunsuke Shibayama 2022-09-26 14:03:06 +09:00
parent 5916096cc4
commit 5aae4a69a5
22 changed files with 521 additions and 258 deletions

View file

@ -103,8 +103,14 @@ impl Runnable for Compiler {
fn new(cfg: ErgConfig) -> Self {
let mod_cache = SharedModuleCache::new();
let py_mod_cache = SharedModuleCache::new();
Self {
builder: HIRBuilder::new_with_cache(cfg.copy(), "<module>", mod_cache.clone()),
builder: HIRBuilder::new_with_cache(
cfg.copy(),
"<module>",
mod_cache.clone(),
py_mod_cache,
),
code_generator: CodeGenerator::new(cfg.copy()),
mod_cache,
cfg,