From: Justin Seyster Date: Wed, 30 Jun 2010 22:03:24 +0000 (-0400) Subject: Make it always possible to capture function return values. X-Git-Tag: release-v1.0~97 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=df962d213935d8748413a6f550fc8b8e3d26930b;p=interaspect.git Make it always possible to capture function return values. op_get_return_value() can now capture the return value for function calls that do not directly store the return value (previous it would crash). --- diff --git a/src/aop-pc-fun-call.c b/src/aop-pc-fun-call.c index ff5c846..36cae9f 100644 --- a/src/aop-pc-fun-call.c +++ b/src/aop-pc-fun-call.c @@ -177,17 +177,13 @@ op_get_return_value (struct aop_dynval *dv) we can grab its return value. */ if (gimple_call_lhs(stmt) == NULL) { - /* - tree new_lhs = create_tmp_var(gimple_call_return_type(stmt), - "aop_result"); - add_referenced_var(new_lhs); - new_lhs = make_ssa_name(new_lhs, stmt); - gimple_call_set_lhs(stmt, new_lhs); - update_stmt(stmt); - */ + tree new_lhs = create_tmp_var (gimple_call_return_type(stmt), + "aop_return"); + gimple_call_set_lhs (stmt, new_lhs); + update_stmt (stmt); } + return_value = stabilize_reference (gimple_call_lhs (stmt)); - debug_gimple_stmt (stmt); return return_value; }