diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-09-12 12:42:06 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2020-09-12 12:42:06 +0200 |
commit | b440715089382938b9729d20f5dcaf646e6372fd (patch) | |
tree | 5b01e766b5b0fd6b5b5c66619668198a17d70359 /gcc/ada/gcc-interface/trans.c | |
parent | 4965be0b3388557643114c1ec20bd206f0bda1df (diff) | |
download | gcc-b440715089382938b9729d20f5dcaf646e6372fd.zip gcc-b440715089382938b9729d20f5dcaf646e6372fd.tar.gz gcc-b440715089382938b9729d20f5dcaf646e6372fd.tar.bz2 |
Minor tweak to line debug info
This prevents the SLOC of the expression for a tag from being present
in the line debug info every time it is referenced for coverage purposes.
gcc/ada/ChangeLog:
* gcc-interface/trans.c (gnat_to_gnu) <N_Object_Declaration>: Clear
the SLOC of the expression of a tag.
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index e3d71bc..aa4393c 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6476,6 +6476,7 @@ gnat_to_gnu (Node_Id gnat_node) gnu_expr = gnat_to_gnu (Expression (gnat_node)); + /* First deal with erroneous expressions. */ if (TREE_CODE (gnu_expr) == ERROR_MARK) { /* If this is a named number for which we cannot manipulate @@ -6485,6 +6486,11 @@ gnat_to_gnu (Node_Id gnat_node) else if (type_annotate_only) gnu_expr = NULL_TREE; } + + /* Then a special case: we do not want the SLOC of the expression + of the tag to pop up every time it is referenced somewhere. */ + else if (EXPR_P (gnu_expr) && Is_Tag (gnat_temp)) + SET_EXPR_LOCATION (gnu_expr, UNKNOWN_LOCATION); } else gnu_expr = NULL_TREE; |