Skip to content

Commit d8ee40e

Browse files
Use parallel compilaition in cairo-execute. (#7859)
1 parent edd7ff4 commit d8ee40e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/cairo-lang-executable/src/compile.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::sync::Arc;
44
use anyhow::{Context, Result};
55
use cairo_lang_compiler::db::RootDatabase;
66
use cairo_lang_compiler::diagnostics::DiagnosticsReporter;
7+
use cairo_lang_compiler::get_sierra_program_for_functions;
78
use cairo_lang_compiler::project::setup_project;
89
use cairo_lang_debug::debug::DebugWithDb;
910
use cairo_lang_filesystem::cfg::{Cfg, CfgSet};
@@ -12,7 +13,6 @@ use cairo_lang_lowering::ids::ConcreteFunctionWithBodyId;
1213
use cairo_lang_runnable_utils::builder::{
1314
CasmProgramWrapperInfo, EntryCodeConfig, RunnableBuilder,
1415
};
15-
use cairo_lang_sierra_generator::db::SierraGenGroup;
1616
use cairo_lang_sierra_generator::executables::find_executable_function_ids;
1717
use cairo_lang_sierra_generator::program_generator::SierraProgramWithDebug;
1818
use cairo_lang_sierra_to_casm::compiler::CairoProgram;
@@ -179,12 +179,11 @@ pub fn originating_function_path(db: &RootDatabase, wrapper: ConcreteFunctionWit
179179
pub fn compile_executable_function_in_prepared_db(
180180
db: &RootDatabase,
181181
executable: ConcreteFunctionWithBodyId,
182-
mut diagnostics_reporter: DiagnosticsReporter<'_>,
182+
diagnostics_reporter: DiagnosticsReporter<'_>,
183183
config: ExecutableConfig,
184184
) -> Result<CompiledFunction> {
185-
diagnostics_reporter.ensure(db)?;
186185
let SierraProgramWithDebug { program: sierra_program, debug_info } = Arc::unwrap_or_clone(
187-
db.get_sierra_program_for_functions(vec![executable])
186+
get_sierra_program_for_functions(db, vec![executable], diagnostics_reporter)
188187
.ok()
189188
.with_context(|| "Compilation failed without any diagnostics.")?,
190189
);

0 commit comments

Comments
 (0)