Skip to content

Commit

Permalink
Cfg away debug::print_module when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 31, 2019
1 parent 3bb7745 commit 640edfd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub fn module_imports<'a>(
}

/// List module exports with their types
#[cfg(any(feature = "test", watt_debug))]
pub fn module_exports<'a>(
module: &'a ast::Module,
) -> impl Iterator<Item = (&'a str, types::Extern)> + 'a {
Expand Down
5 changes: 2 additions & 3 deletions src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ fn _proc_macro(fun: &str, inputs: Vec<TokenStream>, wasm: &[u8]) -> TokenStream

let cursor = Cursor::new(wasm);
let module = decode_module(cursor).unwrap();
if cfg!(watt_debug) {
crate::debug::print_module(&module);
}
#[cfg(watt_debug)]
crate::debug::print_module(&module);

let mut store = init_store();
let extern_vals = import::extern_vals(&module, &mut store);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ mod exec;
mod import;
mod sym;

#[cfg(not(jit))]
#[cfg(all(watt_debug, not(jit)))]
mod debug;

use proc_macro::TokenStream;
Expand Down

0 comments on commit 640edfd

Please sign in to comment.