summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 05:09:32 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 05:09:32 +0000
commit346064d966aacf0e32acbe60228695344d446f0f (patch)
treed942bc168b4a8f91e17acf863e1d2091ff773b6c /gcc/c-decl.c
parent99b72d8df1d8826dba9eab345e6862f6582943de (diff)
downloadgcc-346064d966aacf0e32acbe60228695344d446f0f.tar.gz
Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f58f5601d9e..db35f9a9ea9 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -905,7 +905,8 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
return 0;
}
}
- else if (TREE_CODE (olddecl) == FUNCTION_DECL && !TREE_LOCUS_SET_P (olddecl))
+ else if (TREE_CODE (olddecl) == FUNCTION_DECL
+ && DECL_SOURCE_LINE (olddecl) == 0)
{
/* A function declaration for a predeclared function
that isn't actually built in. */
@@ -1174,7 +1175,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
}
/* Optionally warn about more than one declaration for the same name. */
- if (errmsg == 0 && warn_redundant_decls && TREE_LOCUS_SET_P (olddecl)
+ if (errmsg == 0 && warn_redundant_decls && DECL_SOURCE_LINE (olddecl) != 0
/* Don't warn about a function declaration
followed by a definition. */
&& !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0
@@ -1271,7 +1272,10 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
information so that meaningful diagnostics can be given. */
if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0
&& ! different_binding_level)
- copy_tree_locus (newdecl, olddecl);
+ {
+ DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl);
+ DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
+ }
/* Merge the unused-warning information. */
if (DECL_IN_SYSTEM_HEADER (olddecl))
@@ -1521,7 +1525,7 @@ warn_if_shadowing (tree x, tree old)
/* Shadow warnings not wanted? */
|| !warn_shadow
/* No shadow warnings for internally generated vars. */
- || !TREE_LOCUS_SET_P (x)
+ || DECL_SOURCE_LINE (x) == 0
/* No shadow warnings for vars made for inlining. */
|| DECL_FROM_INLINE (x)
/* Don't warn about the parm names in function declarator
@@ -1589,7 +1593,7 @@ warn_if_shadowing (tree x, tree old)
static void
clone_underlying_type (tree x)
{
- if (!TREE_LOCUS_SET_P (x))
+ if (DECL_SOURCE_LINE (x) == 0)
{
if (TYPE_NAME (TREE_TYPE (x)) == 0)
TYPE_NAME (TREE_TYPE (x)) = x;
@@ -1944,7 +1948,7 @@ make_label (tree name, location_t location)
DECL_CONTEXT (label) = current_function_decl;
DECL_MODE (label) = VOIDmode;
- set_tree_locus (label, location);
+ DECL_SOURCE_LOCATION (label) = location;
return label;
}
@@ -1991,7 +1995,7 @@ lookup_label (tree name)
location to point here, for better diagnostics if it
turns out not to have been defined. */
if (!TREE_USED (label))
- set_tree_locus (label, input_location);
+ DECL_SOURCE_LOCATION (label) = input_location;
return label;
}
@@ -2070,7 +2074,7 @@ define_label (location_t location, tree name)
/* The label has been used or declared already in this function,
but not defined. Update its location to point to this
definition. */
- set_tree_locus (label, location);
+ DECL_SOURCE_LOCATION (label) = location;
}
else
{
@@ -5458,7 +5462,7 @@ start_function (tree declspecs, tree declarator, tree attributes)
&& TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0)
{
TREE_TYPE (decl1) = TREE_TYPE (old_decl);
- current_function_prototype_locus = TREE_LOCUS (old_decl);
+ current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl);
}
/* Optionally warn of old-fashioned def with no previous prototype. */
@@ -5751,7 +5755,7 @@ store_parm_decls_oldstyle (void)
{
decl = build_decl (PARM_DECL, TREE_VALUE (parm), integer_type_node);
DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
- copy_tree_locus (decl, fndecl);
+ DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (fndecl);
pushdecl (decl);
if (flag_isoc99)