From 73faf50053e83a7b44111a7ba0637ce140dac1f7 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Sat, 2 Sep 2017 09:12:25 -0400 Subject: [PATCH] tiny cleanup --- stdlib/c_generator.krak | 5 ++--- stdlib/ref_lower.krak | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stdlib/c_generator.krak b/stdlib/c_generator.krak index b1c1fc2..cfc45e8 100644 --- a/stdlib/c_generator.krak +++ b/stdlib/c_generator.krak @@ -489,9 +489,8 @@ obj c_generator (Object) { var func_name = string() var call_string = code_triple() var func_return_type = get_ast_type(node) - if (func_return_type->is_ref) { + if (func_return_type->is_ref) error("still ref in function calling") - } if (is_dot_style_method_call(node)) { func_name = generate_function(node->function_call.func->function_call.parameters[1]).one_string() @@ -557,7 +556,7 @@ obj c_generator (Object) { call_string += generate(param, enclosing_object, enclosing_func, false) } // temporary returns if we're asked for them or we need them for destruct - if (!func_return_type->is_ref && !func_return_type->is_void() && need_variable) { + if (!func_return_type->is_void() && need_variable) { var pre_call = string() // kind of ugly combo here of var temp_ident = ast_identifier_ptr(string("temporary_return") + get_id(), func_return_type, null()) diff --git a/stdlib/ref_lower.krak b/stdlib/ref_lower.krak index c9c76da..af9b1e4 100644 --- a/stdlib/ref_lower.krak +++ b/stdlib/ref_lower.krak @@ -78,9 +78,7 @@ fun ref_lower(name_ast_map: *map,*ast_node>>, ast_to_ }) remove_ref_type_set.for_each(fun(p: pair) { var t = p.second - /*println("before" + p.first + ": " + t->to_string())*/ remove_ref(t) - /*println("after" + p.first + ": " + t->to_string())*/ }) modify_reference_use_set.for_each(fun(p: pair<*ast_node, *ast_node>) { // if we haven't modified it's indirection yet @@ -97,4 +95,3 @@ fun ref_lower(name_ast_map: *map,*ast_node>>, ast_to_ r->return_statement.return_value = make_operator_call("&", vector(r->return_statement.return_value)); }) } -