This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Adjust source location on boolean inversions
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 10 Oct 2010 14:21:51 +0200
- Subject: [Ada] Adjust source location on boolean inversions
This yields more precise debug info for complex conditional expressions.
Tested on i586-suse-linux, applied on the mainline.
2010-10-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_Not_In>: Use
invert_truthvalue_loc instead of invert_truthvalue.
* gcc-interface/utils2.c (build_binary_op) <NE_EXPR>: Likewise.
(build_unary_op) <TRUTH_NOT_EXPR>: Likewise.
--
Eric Botcazou
Index: gcc-interface/utils2.c
===================================================================
--- gcc-interface/utils2.c (revision 165234)
+++ gcc-interface/utils2.c (working copy)
@@ -791,7 +791,7 @@ build_binary_op (enum tree_code op_code,
result = compare_arrays (result_type, left_operand, right_operand);
if (op_code == NE_EXPR)
- result = invert_truthvalue (result);
+ result = invert_truthvalue_loc (EXPR_LOCATION (result), result);
else
gcc_assert (op_code == EQ_EXPR);
@@ -1018,7 +1018,7 @@ build_unary_op (enum tree_code op_code,
#ifdef ENABLE_CHECKING
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
- result = invert_truthvalue (operand);
+ result = invert_truthvalue_loc (EXPR_LOCATION (operand), operand);
break;
case ATTR_ADDR_EXPR:
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 165250)
+++ gcc-interface/trans.c (working copy)
@@ -4496,7 +4496,8 @@ gnat_to_gnu (Node_Id gnat_node)
}
if (kind == N_Not_In)
- gnu_result = invert_truthvalue (gnu_result);
+ gnu_result
+ = invert_truthvalue_loc (EXPR_LOCATION (gnu_result), gnu_result);
}
break;