mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 23:31:21 +08:00
gimple-parser.c (c_parser_gimple_compound_statement): Improve error recovery.
2016-12-20 Richard Biener <rguenther@suse.de> c/ * gimple-parser.c (c_parser_gimple_compound_statement): Improve error recovery. (c_parser_gimple_statement): Only build assigns for non-error stmts. (c_parser_gimple_postfix_expression_after): Improve error recovery. From-SVN: r243823
This commit is contained in:
parent
a676a9a8c5
commit
aa90531ea4
@ -1,3 +1,11 @@
|
||||
2016-12-20 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* gimple-parser.c (c_parser_gimple_compound_statement): Improve
|
||||
error recovery.
|
||||
(c_parser_gimple_statement): Only build assigns for non-error
|
||||
stmts.
|
||||
(c_parser_gimple_postfix_expression_after): Improve error recovery.
|
||||
|
||||
2016-12-14 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
* c-parser.c: Include omp-general.h and omp-offload.h instead of
|
||||
|
@ -215,7 +215,7 @@ c_parser_gimple_compound_statement (c_parser *parser, gimple_seq *seq)
|
||||
expr_stmt:
|
||||
c_parser_gimple_statement (parser, seq);
|
||||
if (! c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
|
||||
return return_p;
|
||||
c_parser_skip_until_found (parser, CPP_SEMICOLON, NULL);
|
||||
}
|
||||
}
|
||||
c_parser_consume_token (parser);
|
||||
@ -327,9 +327,12 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq)
|
||||
case CPP_NOT:
|
||||
case CPP_MULT: /* pointer deref */
|
||||
rhs = c_parser_gimple_unary_expression (parser);
|
||||
assign = gimple_build_assign (lhs.value, rhs.value);
|
||||
gimple_set_location (assign, loc);
|
||||
gimple_seq_add_stmt (seq, assign);
|
||||
if (rhs.value != error_mark_node)
|
||||
{
|
||||
assign = gimple_build_assign (lhs.value, rhs.value);
|
||||
gimple_set_location (assign, loc);
|
||||
gimple_seq_add_stmt (seq, assign);
|
||||
}
|
||||
return;
|
||||
|
||||
default:;
|
||||
@ -385,10 +388,13 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq)
|
||||
&& lookup_name (c_parser_peek_token (parser)->value))
|
||||
{
|
||||
rhs = c_parser_gimple_unary_expression (parser);
|
||||
gimple *call = gimple_build_call_from_tree (rhs.value);
|
||||
gimple_call_set_lhs (call, lhs.value);
|
||||
gimple_seq_add_stmt (seq, call);
|
||||
gimple_set_location (call, loc);
|
||||
if (rhs.value != error_mark_node)
|
||||
{
|
||||
gimple *call = gimple_build_call_from_tree (rhs.value);
|
||||
gimple_call_set_lhs (call, lhs.value);
|
||||
gimple_seq_add_stmt (seq, call);
|
||||
gimple_set_location (call, loc);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -802,7 +808,10 @@ c_parser_gimple_postfix_expression_after_primary (c_parser *parser,
|
||||
tree idx = c_parser_gimple_unary_expression (parser).value;
|
||||
|
||||
if (! c_parser_require (parser, CPP_CLOSE_SQUARE, "expected %<]%>"))
|
||||
break;
|
||||
{
|
||||
c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
start = expr.get_start ();
|
||||
finish = c_parser_tokens_buf (parser, 0)->location;
|
||||
|
Loading…
x
Reference in New Issue
Block a user