aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-11-14 18:31:57 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-11-14 18:31:57 +0000
commita01e283ff5fd5bd1d0f8b274b01fe30fd98f82e8 (patch)
treeab17fafcf018fef0789d31b899c5a21afc6ead17 /gcc/ada/trans.c
parentd76575caa512ad195c9f0f0993152618dbb8768f (diff)
downloadgcc-a01e283ff5fd5bd1d0f8b274b01fe30fd98f82e8.zip
gcc-a01e283ff5fd5bd1d0f8b274b01fe30fd98f82e8.tar.gz
gcc-a01e283ff5fd5bd1d0f8b274b01fe30fd98f82e8.tar.bz2
trans.c (call_to_gnu): Always set the source location on the call expression.
* trans.c (call_to_gnu): Always set the source location on the call expression. If the function returns-by-target, also set it on the address expression. From-SVN: r130184
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r--gcc/ada/trans.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 65d45b0..cd3c6a6 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -2311,6 +2311,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_subprog_call = build_call_list (TREE_TYPE (gnu_subprog_type),
gnu_subprog_addr,
nreverse (gnu_actual_list));
+ set_expr_location_from_node (gnu_subprog_call, gnat_node);
/* If we return by passing a target, the result is the target after the
call. We must not emit the call directly here because this might be
@@ -2336,6 +2337,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
tree gnu_target_address
= build_unary_op (ADDR_EXPR, NULL_TREE, gnu_target);
+ set_expr_location_from_node (gnu_target_address, gnat_node);
gnu_result
= build2 (COMPOUND_EXPR, TREE_TYPE (gnu_target_address),
@@ -2491,10 +2493,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
}
}
else
- {
- set_expr_location_from_node (gnu_subprog_call, gnat_node);
- append_to_statement_list (gnu_subprog_call, &gnu_before_list);
- }
+ append_to_statement_list (gnu_subprog_call, &gnu_before_list);
append_to_statement_list (gnu_after_list, &gnu_before_list);
return gnu_before_list;