diff options
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 91a42d91814..07854c48d6b 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -661,6 +661,7 @@ primary: last_expr_type = void_type_node; $$ = build1 (STMT_EXPR, last_expr_type, $1); TREE_SIDE_EFFECTS ($$) = 1; + annotate_with_locus ($$, input_location); } | compstmt_primary_start error ')' { @@ -2130,7 +2131,7 @@ simple_if: if_prefix: /* We must build the IF_STMT node before parsing its - condition so that STMT_LINENO refers to the line + condition so that EXPR_LOCUS refers to the line containing the "if", and not the line containing the close-parenthesis. @@ -2194,12 +2195,8 @@ lineno_stmt: save_location stmt { if ($2) { - STMT_LINENO ($2) = $1.line; - /* ??? We currently have no way of recording - the filename for a statement. This probably - matters little in practice at the moment, - but I suspect that problems will occur when - doing inlining at the tree level. */ + SET_EXPR_LOCUS ($2, NULL); + annotate_with_locus ($2, $1); } } ; @@ -2208,7 +2205,8 @@ lineno_label: save_location label { if ($2) { - STMT_LINENO ($2) = $1.line; + SET_EXPR_LOCUS ($2, NULL); + annotate_with_locus ($2, $1); } } ; @@ -2237,7 +2235,7 @@ select_or_iter_stmt: | simple_if ELSE error { c_expand_end_cond (); } /* We must build the WHILE_STMT node before parsing its - condition so that STMT_LINENO refers to the line + condition so that EXPR_LOCUS refers to the line containing the "while", and not the line containing the close-parenthesis. |