Improve IR debug printing for dev backends

This commit is contained in:
Brian Carroll 2021-11-21 20:39:49 +00:00
parent 2db18890d2
commit ee1c4478da
2 changed files with 32 additions and 12 deletions

View file

@ -5,6 +5,9 @@ use roc_can::builtins::builtin_defs_map;
use roc_collections::all::MutMap;
use tempfile::tempdir;
#[allow(unused_imports)]
use roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS;
#[allow(dead_code)]
fn promote_expr_to_module(src: &str) -> String {
let mut buffer = String::from("app \"test\" provides [ main ] to \"./platform\"\n\nmain =\n");
@ -77,7 +80,14 @@ pub fn helper(
// while you're working on the dev backend!
{
// println!("=========== Procedures ==========");
// println!("{:?}", procedures);
// if PRETTY_PRINT_IR_SYMBOLS {
// println!("");
// for proc in procedures.values() {
// println!("{}", proc.to_pretty(200));
// }
// } else {
// println!("{:?}", procedures.values());
// }
// println!("=================================\n");
// println!("=========== Interns ==========");

View file

@ -17,6 +17,9 @@ use roc_gen_wasm::wasm_module::{
};
use roc_gen_wasm::MEMORY_NAME;
#[allow(unused_imports)]
use roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS;
const TEST_WRAPPER_NAME: &str = "test_wrapper";
std::thread_local! {
@ -83,9 +86,16 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
// You can comment and uncomment this block out to get more useful information
// while you're working on the wasm backend!
// {
{
// println!("=========== Procedures ==========");
// println!("{:?}", procedures);
// if PRETTY_PRINT_IR_SYMBOLS {
// println!("");
// for proc in procedures.values() {
// println!("{}", proc.to_pretty(200));
// }
// } else {
// println!("{:?}", procedures.values());
// }
// println!("=================================\n");
// println!("=========== Interns ==========");
@ -95,7 +105,7 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
// println!("=========== Exposed ==========");
// println!("{:?}", exposed_to_host);
// println!("=================================\n");
// }
}
debug_assert_eq!(exposed_to_host.len(), 1);