aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-09-21 16:39:40 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-09-21 16:39:40 -0700
commit7e2af53a14ce4710e1dca754acf603db0f9d8802 (patch)
treed04ef32430711aab636f45451f9e7a3ad34ab36f /gcc/cp/decl.c
parentd6a1d39a7dbf00f373ace14470d5edb5cc4337be (diff)
downloadgcc-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/cp/decl.c')
-rw-r--r--gcc/cp/decl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 892affa..376d8de 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1787,7 +1787,7 @@ print_binding_level (struct cp_binding_level* lvl)
continue;
if (no_print_builtins
&& (TREE_CODE (t) == TYPE_DECL)
- && (!strcmp (DECL_SOURCE_FILE (t),"<built-in>")))
+ && (!strcmp (TREE_FILENAME (t), "<built-in>")))
continue;
/* Function decls tend to have longer names. */
@@ -3153,9 +3153,8 @@ duplicate_decls (tree newdecl, tree olddecl)
if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
{
- DECL_SOURCE_LOCATION (olddecl)
- = DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl))
- = DECL_SOURCE_LOCATION (newdecl);
+ copy_tree_locus (olddecl, newdecl);
+ copy_tree_locus (DECL_TEMPLATE_RESULT (olddecl), newdecl);
}
return 1;
@@ -3195,13 +3194,13 @@ duplicate_decls (tree newdecl, tree olddecl)
TYPE_RAISES_EXCEPTIONS (oldtype));
if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
- && DECL_SOURCE_LINE (olddecl) != 0
+ && TREE_LOCUS_SET_P (olddecl)
&& flag_exceptions
&& !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)),
TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 1))
{
error ("declaration of `%F' throws different exceptions",
- newdecl);
+ newdecl);
cp_error_at ("than previous declaration `%F'", olddecl);
}
}
@@ -3232,7 +3231,7 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_INITIAL (olddecl) != NULL_TREE)
{
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
- DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
+ copy_tree_locus (newdecl, olddecl);
if (CAN_HAVE_FULL_LANG_DECL_P (newdecl)
&& DECL_LANG_SPECIFIC (newdecl)
&& DECL_LANG_SPECIFIC (olddecl))
@@ -3701,7 +3700,7 @@ pushdecl (tree x)
if (TREE_CODE (x) == TYPE_DECL)
{
tree type = TREE_TYPE (x);
- if (DECL_SOURCE_LINE (x) == 0)
+ if (!TREE_LOCUS_SET_P (x))
{
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = x;
@@ -4075,7 +4074,7 @@ pushdecl_class_level (tree x)
for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f))
{
location_t save_location = input_location;
- input_location = DECL_SOURCE_LOCATION (f);
+ input_location = TREE_LOCUS (f);
if (!pushdecl_class_level (f))
is_valid = false;
input_location = save_location;
@@ -4520,7 +4519,7 @@ make_label_decl (tree id, int local_p)
/* Say where one reference is to the label, for the sake of the
error if it is not defined. */
- DECL_SOURCE_LOCATION (decl) = input_location;
+ set_tree_locus (decl, input_location);
/* Record the fact that this identifier is bound to this label. */
SET_IDENTIFIER_LABEL_VALUE (id, decl);
@@ -4831,7 +4830,7 @@ define_label (location_t location, tree name)
/* Mark label as having been defined. */
DECL_INITIAL (decl) = error_mark_node;
/* Say where in the source. */
- DECL_SOURCE_LOCATION (decl) = location;
+ set_tree_locus (decl, location);
if (ent)
{
ent->names_in_scope = current_binding_level->names;