Commit 152c16a9 by Gabriel Dos Reis Committed by Gabriel Dos Reis

decl.c (check_previous_goto_1): Adjust prototype.

        * decl.c (check_previous_goto_1): Adjust prototype.
        (check_previous_goto): Adjust use.
        (check_switch_goto): Likewise.
        (use_label): Adjust.
        (check_previous_goto_1): Don't use pedwarn_with_file_and_line.
        (struct named_label_use_list): Use location_t datatype.

From-SVN: r66290
parent d3d40e23
2003-04-30 Garbiel Dos Reis <gcc@integrable-solutions.net>
* decl.c (check_previous_goto_1): Adjust prototype.
(check_previous_goto): Adjust use.
(check_switch_goto): Likewise.
(use_label): Adjust.
(check_previous_goto_1): Don't use pedwarn_with_file_and_line.
(struct named_label_use_list): Use location_t datatype.
2003-04-29 Mark Mitchell <mark@codesourcery.com> 2003-04-29 Mark Mitchell <mark@codesourcery.com>
PR c++/10551 PR c++/10551
......
...@@ -112,7 +112,7 @@ static void add_decl_to_level (tree, struct cp_binding_level *); ...@@ -112,7 +112,7 @@ static void add_decl_to_level (tree, struct cp_binding_level *);
static tree make_label_decl (tree, int); static tree make_label_decl (tree, int);
static void use_label (tree); static void use_label (tree);
static void check_previous_goto_1 (tree, struct cp_binding_level *, tree, static void check_previous_goto_1 (tree, struct cp_binding_level *, tree,
const char *, int); const location_t *);
static void check_previous_goto (struct named_label_use_list *); static void check_previous_goto (struct named_label_use_list *);
static void check_switch_goto (struct cp_binding_level *); static void check_switch_goto (struct cp_binding_level *);
static void check_previous_gotos (tree); static void check_previous_gotos (tree);
...@@ -215,8 +215,7 @@ struct named_label_use_list GTY(()) ...@@ -215,8 +215,7 @@ struct named_label_use_list GTY(())
struct cp_binding_level *binding_level; struct cp_binding_level *binding_level;
tree names_in_scope; tree names_in_scope;
tree label_decl; tree label_decl;
const char *filename_o_goto; location_t o_goto_locus;
int lineno_o_goto;
struct named_label_use_list *next; struct named_label_use_list *next;
}; };
...@@ -4626,8 +4625,8 @@ use_label (tree decl) ...@@ -4626,8 +4625,8 @@ use_label (tree decl)
new_ent->label_decl = decl; new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names; new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level; new_ent->binding_level = current_binding_level;
new_ent->lineno_o_goto = lineno; new_ent->o_goto_locus.line = lineno;
new_ent->filename_o_goto = input_filename; new_ent->o_goto_locus.file = input_filename;
new_ent->next = named_label_uses; new_ent->next = named_label_uses;
named_label_uses = new_ent; named_label_uses = new_ent;
} }
...@@ -4726,9 +4725,7 @@ decl_jump_unsafe (tree decl) ...@@ -4726,9 +4725,7 @@ decl_jump_unsafe (tree decl)
static void static void
check_previous_goto_1 (tree decl, check_previous_goto_1 (tree decl,
struct cp_binding_level* level, struct cp_binding_level* level,
tree names, tree names, const location_t *locus)
const char* file,
int line)
{ {
int identified = 0; int identified = 0;
int saw_eh = 0; int saw_eh = 0;
...@@ -4751,8 +4748,8 @@ check_previous_goto_1 (tree decl, ...@@ -4751,8 +4748,8 @@ check_previous_goto_1 (tree decl,
else else
pedwarn ("jump to case label"); pedwarn ("jump to case label");
if (file) if (locus)
pedwarn_with_file_and_line (file, line, " from here"); pedwarn ("%H from here", locus);
identified = 1; identified = 1;
} }
...@@ -4775,8 +4772,8 @@ check_previous_goto_1 (tree decl, ...@@ -4775,8 +4772,8 @@ check_previous_goto_1 (tree decl,
else else
pedwarn ("jump to case label"); pedwarn ("jump to case label");
if (file) if (locus)
pedwarn_with_file_and_line (file, line, " from here"); pedwarn ("%H from here", locus);
identified = 1; identified = 1;
} }
if (b->is_try_scope) if (b->is_try_scope)
...@@ -4792,14 +4789,13 @@ static void ...@@ -4792,14 +4789,13 @@ static void
check_previous_goto (struct named_label_use_list* use) check_previous_goto (struct named_label_use_list* use)
{ {
check_previous_goto_1 (use->label_decl, use->binding_level, check_previous_goto_1 (use->label_decl, use->binding_level,
use->names_in_scope, use->filename_o_goto, use->names_in_scope, &use->o_goto_locus);
use->lineno_o_goto);
} }
static void static void
check_switch_goto (struct cp_binding_level* level) check_switch_goto (struct cp_binding_level* level)
{ {
check_previous_goto_1 (NULL_TREE, level, level->names, NULL, 0); check_previous_goto_1 (NULL_TREE, level, level->names, NULL);
} }
/* Check that any previously seen jumps to a newly defined label DECL /* Check that any previously seen jumps to a newly defined label DECL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment