cairo_lang_compiler

Function compile_prepared_db

Source
pub fn compile_prepared_db(
    db: &RootDatabase,
    main_crate_ids: Vec<CrateId>,
    compiler_config: CompilerConfig<'_>,
) -> Result<SierraProgramWithDebug>
Expand description

Runs Cairo compiler.

Similar to compile_prepared_db_program, but this function returns all the raw debug information.

§Arguments

  • db - Preloaded compilation database.
  • main_crate_ids - CrateIds to compile. Do not include dependencies here, only pass top-level crates in order to eliminate unused code. Use CrateLongId::Real(name).intern(db) in order to obtain CrateId from its name.
  • compiler_config - The compiler configuration.

§Returns

  • Ok(SierraProgramWithDebug) - The compiled program with debug info.
  • Err(anyhow::Error) - Compilation failed.