Skip to content

Commit

Permalink
chore: add comment and replace non-standard is_opcode_supporteds
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed May 16, 2023
1 parent 92d2da7 commit c472187
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion crates/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ impl Driver {
let program = monomorphize(main_function, &self.context.def_interner);

let np_language = self.language.clone();
// TODO: use proper `is_opcode_supported` implementation.
let is_opcode_supported = acvm::default_is_opcode_supported(np_language.clone());

let circuit_abi = if options.experimental_ssa {
Expand Down Expand Up @@ -320,6 +321,7 @@ impl Driver {

impl Default for Driver {
fn default() -> Self {
Self::new(&Language::R1CS, Box::new(|opcode| matches!(opcode, Opcode::Arithmetic(_))))
#[allow(deprecated)]
Self::new(&Language::R1CS, Box::new(acvm::default_is_opcode_supported(Language::R1CS)))
}
}
7 changes: 4 additions & 3 deletions crates/noirc_driver/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use acvm::acir::circuit::Opcode;
use acvm::Language;
use noirc_driver::{CompileOptions, Driver};
use noirc_frontend::graph::{CrateType, LOCAL_CRATE};
fn main() {
Expand All @@ -7,8 +7,9 @@ fn main() {
const ROOT_DIR_MAIN: &str = "example_real_project/main.nr";

let mut driver = Driver::new(
&acvm::Language::R1CS,
Box::new(|opcode| matches!(opcode, Opcode::Arithmetic(_))),
&Language::R1CS,
#[allow(deprecated)]
Box::new(acvm::default_is_opcode_supported(Language::R1CS)),
);

// Add local crate to dep graph
Expand Down

0 comments on commit c472187

Please sign in to comment.