This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH [mainline]: Get rid of xxx_with_file_and_line
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: 30 Apr 2003 15:50:07 +0200
- Subject: C++ PATCH [mainline]: Get rid of xxx_with_file_and_line
- Organization: Integrable Solutions
I thought I killed the last use of the diagnostic function
xxx_with_file_and_line functions in the C++ front-end... Well, it is
done with this patch.
Booststrapped and regtested on an i686-pc-linux-gnu.
-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.3352
diff -p -r1.3352 ChangeLog
*** ChangeLog 29 Apr 2003 22:15:33 -0000 1.3352
--- ChangeLog 30 Apr 2003 13:44:45 -0000
***************
*** 1,3 ****
--- 1,12 ----
+ 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>
PR c++/10551
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1045
diff -p -r1.1045 decl.c
*** decl.c 29 Apr 2003 18:26:47 -0000 1.1045
--- decl.c 30 Apr 2003 13:44:46 -0000
*************** static void add_decl_to_level (tree, str
*** 112,118 ****
static tree make_label_decl (tree, int);
static void use_label (tree);
static void check_previous_goto_1 (tree, struct cp_binding_level *, tree,
! const char *, int);
static void check_previous_goto (struct named_label_use_list *);
static void check_switch_goto (struct cp_binding_level *);
static void check_previous_gotos (tree);
--- 112,118 ----
static tree make_label_decl (tree, int);
static void use_label (tree);
static void check_previous_goto_1 (tree, struct cp_binding_level *, tree,
! const location_t *);
static void check_previous_goto (struct named_label_use_list *);
static void check_switch_goto (struct cp_binding_level *);
static void check_previous_gotos (tree);
*************** struct named_label_use_list GTY(())
*** 215,222 ****
struct cp_binding_level *binding_level;
tree names_in_scope;
tree label_decl;
! const char *filename_o_goto;
! int lineno_o_goto;
struct named_label_use_list *next;
};
--- 215,221 ----
struct cp_binding_level *binding_level;
tree names_in_scope;
tree label_decl;
! location_t o_goto_locus;
struct named_label_use_list *next;
};
*************** use_label (tree decl)
*** 4626,4633 ****
new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level;
! new_ent->lineno_o_goto = lineno;
! new_ent->filename_o_goto = input_filename;
new_ent->next = named_label_uses;
named_label_uses = new_ent;
}
--- 4625,4632 ----
new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level;
! new_ent->o_goto_locus.line = lineno;
! new_ent->o_goto_locus.file = input_filename;
new_ent->next = named_label_uses;
named_label_uses = new_ent;
}
*************** decl_jump_unsafe (tree decl)
*** 4726,4734 ****
static void
check_previous_goto_1 (tree decl,
struct cp_binding_level* level,
! tree names,
! const char* file,
! int line)
{
int identified = 0;
int saw_eh = 0;
--- 4725,4731 ----
static void
check_previous_goto_1 (tree decl,
struct cp_binding_level* level,
! tree names, const location_t *locus)
{
int identified = 0;
int saw_eh = 0;
*************** check_previous_goto_1 (tree decl,
*** 4751,4758 ****
else
pedwarn ("jump to case label");
! if (file)
! pedwarn_with_file_and_line (file, line, " from here");
identified = 1;
}
--- 4748,4755 ----
else
pedwarn ("jump to case label");
! if (locus)
! pedwarn ("%H from here", locus);
identified = 1;
}
*************** check_previous_goto_1 (tree decl,
*** 4775,4782 ****
else
pedwarn ("jump to case label");
! if (file)
! pedwarn_with_file_and_line (file, line, " from here");
identified = 1;
}
if (b->is_try_scope)
--- 4772,4779 ----
else
pedwarn ("jump to case label");
! if (locus)
! pedwarn ("%H from here", locus);
identified = 1;
}
if (b->is_try_scope)
*************** static void
*** 4792,4805 ****
check_previous_goto (struct named_label_use_list* use)
{
check_previous_goto_1 (use->label_decl, use->binding_level,
! use->names_in_scope, use->filename_o_goto,
! use->lineno_o_goto);
}
static void
check_switch_goto (struct cp_binding_level* level)
{
! check_previous_goto_1 (NULL_TREE, level, level->names, NULL, 0);
}
/* Check that any previously seen jumps to a newly defined label DECL
--- 4789,4801 ----
check_previous_goto (struct named_label_use_list* use)
{
check_previous_goto_1 (use->label_decl, use->binding_level,
! use->names_in_scope, &use->o_goto_locus);
}
static void
check_switch_goto (struct cp_binding_level* level)
{
! check_previous_goto_1 (NULL_TREE, level, level->names, NULL);
}
/* Check that any previously seen jumps to a newly defined label DECL