aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-07-01 09:00:45 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-07-01 09:00:45 +0000
commit5b030314afd5f84d30e79594db48bb76da28e36a (patch)
tree1ab2a373f3e8ac65651f191c54f58b1023039ddc /gcc/cp
parentc9bdad35171f64bcabad635254fa9f3dfc05a376 (diff)
downloadgcc-5b030314afd5f84d30e79594db48bb76da28e36a.zip
gcc-5b030314afd5f84d30e79594db48bb76da28e36a.tar.gz
gcc-5b030314afd5f84d30e79594db48bb76da28e36a.tar.bz2
c-tree.h (define_label): Replace filename and lineno arguments with a location_t.
* c-tree.h (define_label): Replace filename and lineno arguments with a location_t. * c-decl.c (poplevel): Adjust define_label call. (pop_label_level): Likewise. (define_label): Replace filename and lineno arguments with a location_t. (store_parm_decls): Use DECL_SOURCE_LOCATION. * c-parse.in (label): Adjust define_label call. * cp/cp-tree.h (define_label): Replace filename and lineno arguments with a location_t. * cp/decl.c (pop_label): Adjust define_label call. (define_label): Replace filename and lineno arguments with a location_t. * cp/semantics.c (finish_label): Adjust define_label call. * java/decl.c (poplevel): Adjust define_label call. From-SVN: r68766
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c11
-rw-r--r--gcc/cp/semantics.c2
4 files changed, 18 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 45a879d..3b96014 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (define_label): Replace filename and lineno
+ arguments with a location_t.
+ * decl.c (pop_label): Adjust define_label call.
+ (define_label): Replace filename and lineno arguments with a
+ location_t.
+ * semantics.c (finish_label): Adjust define_label call.
+
2003-07-01 Mark Mitchell <mark@codesourcery.com>
PR c++/9559
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cb0bdfc..aec80b3 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3650,7 +3650,7 @@ extern tree push_using_directive (tree);
extern bool push_class_level_binding (tree, tree);
extern tree implicitly_declare (tree);
extern tree declare_local_label (tree);
-extern tree define_label (const char *, int, tree);
+extern tree define_label (location_t, tree);
extern void check_goto (tree);
extern void define_case_label (void);
extern tree namespace_binding (tree, tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 67babc2..24e8f78 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1175,9 +1175,13 @@ pop_label (tree label, tree old_value)
{
if (DECL_INITIAL (label) == NULL_TREE)
{
+ location_t location;
+
cp_error_at ("label `%D' used but not defined", label);
+ location.file = input_filename;
+ location.line = 0;
/* Avoid crashing later. */
- define_label (input_filename, 1, DECL_NAME (label));
+ define_label (location, DECL_NAME (label));
}
else if (warn_unused_label && !TREE_USED (label))
cp_warning_at ("label `%D' defined but not used", label);
@@ -4939,7 +4943,7 @@ check_goto (tree decl)
Otherwise return 0. */
tree
-define_label (const char* filename, int line, tree name)
+define_label (location_t location, tree name)
{
tree decl = lookup_label (name);
struct named_label_list *ent;
@@ -4968,8 +4972,7 @@ define_label (const char* filename, int line, tree name)
/* Mark label as having been defined. */
DECL_INITIAL (decl) = error_mark_node;
/* Say where in the source. */
- DECL_SOURCE_FILE (decl) = filename;
- DECL_SOURCE_LINE (decl) = line;
+ DECL_SOURCE_LOCATION (decl) = location;
if (ent)
{
ent->names_in_scope = current_binding_level->names;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index aaf8be4..a42443b 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1136,7 +1136,7 @@ finish_asm_stmt (tree cv_qualifier,
tree
finish_label_stmt (tree name)
{
- tree decl = define_label (input_filename, input_line, name);
+ tree decl = define_label (input_location, name);
return add_stmt (build_stmt (LABEL_STMT, decl));
}