diff options
author | Richard Henderson <rth@redhat.com> | 2003-09-21 16:39:40 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-09-21 16:39:40 -0700 |
commit | 7e2af53a14ce4710e1dca754acf603db0f9d8802 (patch) | |
tree | d04ef32430711aab636f45451f9e7a3ad34ab36f /gcc/c-decl.c | |
parent | d6a1d39a7dbf00f373ace14470d5edb5cc4337be (diff) | |
download | gcc-7e2af53a14ce4710e1dca754acf603db0f9d8802.zip gcc-7e2af53a14ce4710e1dca754acf603db0f9d8802.tar.gz gcc-7e2af53a14ce4710e1dca754acf603db0f9d8802.tar.bz2 |
tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
(TREE_FILENAME, TREE_LINENO): Likewise.
(set_tree_locus, copy_tree_locus, set_tree_file_line): New.
(TREE_LOCUS_SET_P): New.
* c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.
ada/
* trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
change to const.
cp/
* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
DECL_SOURCE_LOCATION rename and change to const.
f/
* com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
change to const.
java/
* class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.
treelang/
* treetree.c: Update for DECL_SOURCE_LOCATION rename and
change to const.
From-SVN: r71636
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index db35f9a..f58f560 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -905,8 +905,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level, return 0; } } - else if (TREE_CODE (olddecl) == FUNCTION_DECL - && DECL_SOURCE_LINE (olddecl) == 0) + else if (TREE_CODE (olddecl) == FUNCTION_DECL && !TREE_LOCUS_SET_P (olddecl)) { /* A function declaration for a predeclared function that isn't actually built in. */ @@ -1175,7 +1174,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 && DECL_SOURCE_LINE (olddecl) != 0 + if (errmsg == 0 && warn_redundant_decls && TREE_LOCUS_SET_P (olddecl) /* Don't warn about a function declaration followed by a definition. */ && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0 @@ -1272,10 +1271,7 @@ 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) - { - DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl); - DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl); - } + copy_tree_locus (newdecl, olddecl); /* Merge the unused-warning information. */ if (DECL_IN_SYSTEM_HEADER (olddecl)) @@ -1525,7 +1521,7 @@ warn_if_shadowing (tree x, tree old) /* Shadow warnings not wanted? */ || !warn_shadow /* No shadow warnings for internally generated vars. */ - || DECL_SOURCE_LINE (x) == 0 + || !TREE_LOCUS_SET_P (x) /* No shadow warnings for vars made for inlining. */ || DECL_FROM_INLINE (x) /* Don't warn about the parm names in function declarator @@ -1593,7 +1589,7 @@ warn_if_shadowing (tree x, tree old) static void clone_underlying_type (tree x) { - if (DECL_SOURCE_LINE (x) == 0) + if (!TREE_LOCUS_SET_P (x)) { if (TYPE_NAME (TREE_TYPE (x)) == 0) TYPE_NAME (TREE_TYPE (x)) = x; @@ -1948,7 +1944,7 @@ make_label (tree name, location_t location) DECL_CONTEXT (label) = current_function_decl; DECL_MODE (label) = VOIDmode; - DECL_SOURCE_LOCATION (label) = location; + set_tree_locus (label, location); return label; } @@ -1995,7 +1991,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)) - DECL_SOURCE_LOCATION (label) = input_location; + set_tree_locus (label, input_location); return label; } @@ -2074,7 +2070,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. */ - DECL_SOURCE_LOCATION (label) = location; + set_tree_locus (label, location); } else { @@ -5462,7 +5458,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 = DECL_SOURCE_LOCATION (old_decl); + current_function_prototype_locus = TREE_LOCUS (old_decl); } /* Optionally warn of old-fashioned def with no previous prototype. */ @@ -5755,7 +5751,7 @@ store_parm_decls_oldstyle (void) { decl = build_decl (PARM_DECL, TREE_VALUE (parm), integer_type_node); DECL_ARG_TYPE (decl) = TREE_TYPE (decl); - DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (fndecl); + copy_tree_locus (decl, fndecl); pushdecl (decl); if (flag_isoc99) |