Remove print statements

This commit is contained in:
Michael Zhang 2022-04-29 03:32:13 -05:00
parent 5a50faeacf
commit 3c4636ca92
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
2 changed files with 1 additions and 18 deletions

View file

@ -105,7 +105,6 @@ impl Expr<Type> {
.map(convert_value_to_metadata_value) .map(convert_value_to_metadata_value)
}) })
.collect::<Result<Vec<_>>>()?; .collect::<Result<Vec<_>>>()?;
println!("ARGS_LLVM: {args_llvm:?}");
let call_site = let call_site =
builder.build_call(*func_ptr, args_llvm.as_slice(), ""); builder.build_call(*func_ptr, args_llvm.as_slice(), "");
@ -205,16 +204,12 @@ fn convert_if_else(
builder.position_at_end(fail_branch); builder.position_at_end(fail_branch);
match &if_else.else_clause { match &if_else.else_clause {
Some(ElseClause::If(if_else2)) => { Some(ElseClause::If(if_else2)) => {
println!("SUB-IF CLAUSE {if_else2:?}");
convert_if_else(context, module, builder, function, if_else2, env)?; convert_if_else(context, module, builder, function, if_else2, env)?;
} }
Some(ElseClause::Body(body)) => { Some(ElseClause::Body(body)) => {
println!("STMTS {body:?}");
convert_stmts(context, module, function, builder, env, body)?; convert_stmts(context, module, function, builder, env, body)?;
} }
None => { None => {}
println!("NOTHING");
}
} }
builder.position_at_end(fail_branch); builder.position_at_end(fail_branch);
builder.build_unconditional_branch(exit_block); builder.build_unconditional_branch(exit_block);
@ -265,7 +260,6 @@ fn convert_stmts(
} else { } else {
builder.build_return(None); builder.build_return(None);
} }
println!("Emitted return.");
} }
Stmt::IfElse(if_else) => { Stmt::IfElse(if_else) => {
@ -343,8 +337,6 @@ pub fn convert(
}, },
); );
} }
println!("ARGS {:?}", func.args);
println!("ENV {:?}", scoped_env);
convert_stmts( convert_stmts(
&context, &context,

View file

@ -235,9 +235,6 @@ fn annotate_expr(
None => bail!("Name not found"), 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); ctx.constrain(ret_ty.clone(), func_ret_ty);
for (arg, expected_ty) in args.iter().zip(func_args_ty.iter()) { 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::BinOp(Box::new(left), op, Box::new(right))
} }
ExprKind::Call(func, args) => { ExprKind::Call(func, args) => {
println!("CALL {:?}", (&func, &args));
let args = args let args = args
.into_iter() .into_iter()
.map(|arg| substitute_in_expr(assignments, arg)) .map(|arg| substitute_in_expr(assignments, arg))
@ -501,19 +497,14 @@ pub fn convert(ast: Vec<Decl<()>>) -> Result<Vec<Decl<Type>>> {
.insert(arg.name.clone(), Type_::from_type(arg.ty.clone())); .insert(arg.name.clone(), Type_::from_type(arg.ty.clone()));
} }
println!("Processing func {:?}", func);
let (decorated_func, constraints, env2) = let (decorated_func, constraints, env2) =
collect_info(scoped_env, func)?; collect_info(scoped_env, func)?;
env = *env2.parent.unwrap(); env = *env2.parent.unwrap();
println!("func: {:?}", decorated_func);
println!("constraints: {:?}", constraints);
let assignments = unify_constraints(&constraints)?; let assignments = unify_constraints(&constraints)?;
println!("assignments: {:?}", assignments);
let typed_func = substitute_in_func(&assignments, decorated_func)?; let typed_func = substitute_in_func(&assignments, decorated_func)?;
println!("typed: {:?}", typed_func);
new_decl.push(Decl::Func(typed_func)); new_decl.push(Decl::Func(typed_func));
} }
} }