Improve debug output

This commit is contained in:
Richard Feldman 2020-06-25 01:25:33 -04:00
parent 9faf47e5cd
commit 46c43da1de
2 changed files with 4 additions and 2 deletions

View file

@ -107,7 +107,7 @@ macro_rules! assert_llvm_evals_to {
fpm.run_on(&fn_val); fpm.run_on(&fn_val);
} else { } else {
eprintln!( eprintln!(
"Function {:?} failed LLVM verification in NON-OPTIMIZED build. Its content was:", fn_val.get_name().to_str().unwrap() "\n\nFunction {:?} failed LLVM verification in NON-OPTIMIZED build. Its content was:\n", fn_val.get_name().to_str().unwrap()
); );
fn_val.print_to_stderr(); fn_val.print_to_stderr();
@ -279,7 +279,7 @@ macro_rules! assert_opt_evals_to {
fpm.run_on(&fn_val); fpm.run_on(&fn_val);
} else { } else {
eprintln!( eprintln!(
"Function {:?} failed LLVM verification in OPTIMIZED build. Its content was:", fn_val.get_name().to_str().unwrap() "\n\nFunction {:?} failed LLVM verification in OPTIMIZED build. Its content was:\n", fn_val.get_name().to_str().unwrap()
); );
fn_val.print_to_stderr(); fn_val.print_to_stderr();

View file

@ -59,6 +59,8 @@ impl<'a> Layout<'a> {
) -> Result<Self, LayoutProblem> { ) -> Result<Self, LayoutProblem> {
use roc_types::subs::Content::*; use roc_types::subs::Content::*;
eprint!("content: ");
match content.dbg(subs) { match content.dbg(subs) {
FlexVar(_) | RigidVar(_) => Err(LayoutProblem::UnresolvedTypeVar), FlexVar(_) | RigidVar(_) => Err(LayoutProblem::UnresolvedTypeVar),
Structure(flat_type) => layout_from_flat_type(arena, flat_type, subs, pointer_size), Structure(flat_type) => layout_from_flat_type(arena, flat_type, subs, pointer_size),