From 3c4636ca9243bdf0ec29a80a5bd0fe17abfb8727 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 29 Apr 2022 03:32:13 -0500 Subject: [PATCH] Remove print statements --- src/ast/llvm.rs | 10 +--------- src/ast/typed.rs | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/ast/llvm.rs b/src/ast/llvm.rs index 793a98f..8db9f10 100644 --- a/src/ast/llvm.rs +++ b/src/ast/llvm.rs @@ -105,7 +105,6 @@ impl Expr { .map(convert_value_to_metadata_value) }) .collect::>>()?; - println!("ARGS_LLVM: {args_llvm:?}"); let call_site = builder.build_call(*func_ptr, args_llvm.as_slice(), ""); @@ -205,16 +204,12 @@ fn convert_if_else( builder.position_at_end(fail_branch); match &if_else.else_clause { Some(ElseClause::If(if_else2)) => { - println!("SUB-IF CLAUSE {if_else2:?}"); convert_if_else(context, module, builder, function, if_else2, env)?; } Some(ElseClause::Body(body)) => { - println!("STMTS {body:?}"); convert_stmts(context, module, function, builder, env, body)?; } - None => { - println!("NOTHING"); - } + None => {} } builder.position_at_end(fail_branch); builder.build_unconditional_branch(exit_block); @@ -265,7 +260,6 @@ fn convert_stmts( } else { builder.build_return(None); } - println!("Emitted return."); } Stmt::IfElse(if_else) => { @@ -343,8 +337,6 @@ pub fn convert( }, ); } - println!("ARGS {:?}", func.args); - println!("ENV {:?}", scoped_env); convert_stmts( &context, diff --git a/src/ast/typed.rs b/src/ast/typed.rs index b7833fc..88a1993 100644 --- a/src/ast/typed.rs +++ b/src/ast/typed.rs @@ -235,9 +235,6 @@ fn annotate_expr( None => bail!("Name not found"), }; - println!("ENV: {:?}", ctx.current_env); - println!("ANNOT CALL {:?} {:?} {:?}", func_name, args, func_args_ty); - ctx.constrain(ret_ty.clone(), func_ret_ty); for (arg, expected_ty) in args.iter().zip(func_args_ty.iter()) { @@ -386,7 +383,6 @@ fn substitute_in_expr_kind( ExprKind::BinOp(Box::new(left), op, Box::new(right)) } ExprKind::Call(func, args) => { - println!("CALL {:?}", (&func, &args)); let args = args .into_iter() .map(|arg| substitute_in_expr(assignments, arg)) @@ -501,19 +497,14 @@ pub fn convert(ast: Vec>) -> Result>> { .insert(arg.name.clone(), Type_::from_type(arg.ty.clone())); } - println!("Processing func {:?}", func); let (decorated_func, constraints, env2) = collect_info(scoped_env, func)?; env = *env2.parent.unwrap(); - println!("func: {:?}", decorated_func); - println!("constraints: {:?}", constraints); let assignments = unify_constraints(&constraints)?; - println!("assignments: {:?}", assignments); let typed_func = substitute_in_func(&assignments, decorated_func)?; - println!("typed: {:?}", typed_func); new_decl.push(Decl::Func(typed_func)); } }