diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-07-01 09:00:45 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-07-01 09:00:45 +0000 |
commit | 5b030314afd5f84d30e79594db48bb76da28e36a (patch) | |
tree | 1ab2a373f3e8ac65651f191c54f58b1023039ddc /gcc/c-decl.c | |
parent | c9bdad35171f64bcabad635254fa9f3dfc05a376 (diff) | |
download | gcc-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/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 70d31fe..557438b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -607,8 +607,7 @@ poplevel (int keep, int reverse, int functionbody) { error_with_decl (label, "label `%s' used but not defined"); /* Avoid crashing later. */ - define_label (input_filename, input_line, - DECL_NAME (label)); + define_label (input_location, DECL_NAME (label)); } else if (warn_unused_label && !TREE_USED (label)) warning_with_decl (label, "label `%s' defined but not used"); @@ -699,8 +698,7 @@ pop_label_level (void) error_with_decl (TREE_VALUE (link), "label `%s' used but not defined"); /* Avoid crashing later. */ - define_label (input_filename, input_line, - DECL_NAME (TREE_VALUE (link))); + define_label (input_location, DECL_NAME (TREE_VALUE (link))); } else if (warn_unused_label && !TREE_USED (TREE_VALUE (link))) warning_with_decl (TREE_VALUE (link), @@ -2055,12 +2053,9 @@ shadow_label (tree name) Otherwise return 0. */ tree -define_label (const char* filename, int line, tree name) +define_label (location_t location, tree name) { - location_t locus; tree decl = lookup_label (name); - locus.file = filename; - locus.line = line; /* If label with this name is known from an outer context, shadow it. */ if (decl != 0 && DECL_CONTEXT (decl) != current_function_decl) @@ -2072,11 +2067,11 @@ define_label (const char* filename, int line, tree name) if (warn_traditional && !in_system_header && lookup_name (name)) warning ("%Htraditional C lacks a separate namespace for labels, " - "identifier `%s' conflicts", &locus, IDENTIFIER_POINTER (name)); + "identifier `%s' conflicts", &location, IDENTIFIER_POINTER (name)); if (DECL_INITIAL (decl) != 0) { - error ("%Hduplicate label `%s'", &locus, IDENTIFIER_POINTER (name)); + error ("%Hduplicate label `%s'", &location, IDENTIFIER_POINTER (name)); return 0; } else @@ -2084,7 +2079,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_LOCATION (decl) = locus; + DECL_SOURCE_LOCATION (decl) = location; return decl; } } @@ -5879,8 +5874,7 @@ store_parm_decls (void) found = build_decl (PARM_DECL, TREE_VALUE (parm), integer_type_node); DECL_ARG_TYPE (found) = TREE_TYPE (found); - DECL_SOURCE_LINE (found) = DECL_SOURCE_LINE (fndecl); - DECL_SOURCE_FILE (found) = DECL_SOURCE_FILE (fndecl); + DECL_SOURCE_LOCATION (found) = DECL_SOURCE_LOCATION (fndecl); if (flag_isoc99) pedwarn_with_decl (found, "type of `%s' defaults to `int'"); else if (extra_warnings) |