diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2020-09-19 07:32:35 -0700 |
---|---|---|
committer | Sandra Loosemore <sandra@codesourcery.com> | 2020-09-19 13:54:16 -0700 |
commit | 3696a50beeb73f4ded8a584e76ee16f0bde109b9 (patch) | |
tree | 547aae764865eb453ea15100d01ddd72cae15773 /gcc/objc | |
parent | a85e5696a31cac8c14dde14f031e76480205f8a0 (diff) | |
download | gcc-3696a50beeb73f4ded8a584e76ee16f0bde109b9.zip gcc-3696a50beeb73f4ded8a584e76ee16f0bde109b9.tar.gz gcc-3696a50beeb73f4ded8a584e76ee16f0bde109b9.tar.bz2 |
Change C front end to emit structured loop and switch tree nodes.
2020-08-12 Sandra Loosemore <sandra@codesourcery.com>
gcc/c
* c-decl.c (c_break_label, c_cont_label): Delete, and replace
with...
(in_statement): New.
(start_function): Adjust for above change.
(c_push_function_context, c_pop_function_context): Likewise.
* c-lang.h (struct language_function): Likewise.
* c-objc-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
* c-parser.c (objc_foreach_break_label, objc_foreach_continue_label):
New.
(c_parser_statement_after_labels): Adjust calls to c_finish_bc_stmt.
(c_parser_switch_statement): Adjust break/switch context handling
and calls to renamed functions.
(c_parser_while_statement): Adjust break/switch context handling and
build a WHILE_STMT.
(c_parser_do_statement): Ditto, with DO_STMT respectively.
(c_parser_for_statement): Ditto, with FOR_STMT respectively.
(c_parser_omp_for_loop): Adjust break/switch context handling.
* c-tree.h (c_break_label, c_cont_label): Delete.
(IN_SWITCH_STMT, IN_ITERATION_STMT): Define.
(IN_OMP_BLOCK, IN_OMP_FOR, IN_OBJC_FOREACH): Define.
(in_statement, switch_statement_break_seen_p): Declare.
(c_start_case, c_finish_case): Renamed to...
(c_start_switch, c_finish_switch).
(c_finish_bc_stmt): Adjust arguments.
* c-typeck.c (build_function_call_vec): Don't try to print
statements with %qE format.
(struct c_switch): Rename switch_expr field to switch_stmt.
Add break_stmt_seen_p field.
(c_start_case): Rename to c_start_switch. Build a SWITCH_STMT
instead of a SWITCH_EXPR. Update for changes to struct c_switch.
(do_case): Update for changes to struct c_switch.
(c_finish_case): Rename to c_finish_switch. Update for changes to
struct c_switch and change of representation from SWITCH_EXPR to
SWITCH_STMT.
(c_finish_loop): Delete.
(c_finish_bc_stmt): Update to reflect changes to break/continue
state representation. Build a BREAK_STMT or CONTINUE_STMT instead
of a GOTO_EXPR except for objc foreach loops.
gcc/objc
* objc-act.c (objc_start_method_definition): Update to reflect
changes to break/continue state bookkeeping in C front end.
gcc/testsuite/
* gcc.dg/gomp/block-7.c: Update expected error message wording.
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/objc-act.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 54af1cf..31a2cf3 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -2050,10 +2050,8 @@ objc_start_method_definition (bool is_class_method, tree decl, tree attributes, return false; #ifndef OBJCPLUS - /* Indicate no valid break/continue context by setting these variables - to some non-null, non-label value. We'll notice and emit the proper - error message in c_finish_bc_stmt. */ - c_break_label = c_cont_label = size_zero_node; + /* Indicate no valid break/continue context. */ + in_statement = 0; #endif if (attributes) |