diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-22 05:09:32 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-22 05:09:32 +0000 |
commit | 346064d966aacf0e32acbe60228695344d446f0f (patch) | |
tree | d942bc168b4a8f91e17acf863e1d2091ff773b6c /gcc/cp | |
parent | 99b72d8df1d8826dba9eab345e6862f6582943de (diff) | |
download | gcc-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/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 21 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/error.c | 2 | ||||
-rw-r--r-- | gcc/cp/init.c | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 32 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/cp/tree.c | 2 |
12 files changed, 44 insertions, 34 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 19c3c481343..7f85eaf9c79 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,6 +1,11 @@ 2003-09-21 Richard Henderson <rth@redhat.com> * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, + method.c, optimize.c, pt.c, semantics.c, tree.c: Revert. + +2003-09-21 Richard Henderson <rth@redhat.com> + + * 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. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ebcad8041a5..17ff0e49674 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5212,7 +5212,7 @@ finish_struct (tree t, tree attributes) /* Nadger the current location so that diagnostics point to the start of the struct, not the end. */ - input_location = TREE_LOCUS (TYPE_NAME (t)); + input_location = DECL_SOURCE_LOCATION (TYPE_NAME (t)); if (processing_template_decl) { diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 8f931aa05b1..ef38d5565d8 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -390,7 +390,7 @@ typedef enum cp_id_kind /* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or NULL_TREE if there is no binding. */ #define IDENTIFIER_VALUE(NODE) \ - (IDENTIFIER_BINDING (NODE) ? IDENTIFIER_BINDING (NODE)->value : NULL_TREE) + (IDENTIFIER_BINDING (NODE) ? IDENTIFIER_BINDING (NODE)->value : NULL) /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current class, and IDENTIFIER_CLASS_VALUE is the value binding. This is diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 376d8de10de..892affacc82 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 (TREE_FILENAME (t), "<built-in>"))) + && (!strcmp (DECL_SOURCE_FILE (t),"<built-in>"))) continue; /* Function decls tend to have longer names. */ @@ -3153,8 +3153,9 @@ duplicate_decls (tree newdecl, tree olddecl) if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE) { - copy_tree_locus (olddecl, newdecl); - copy_tree_locus (DECL_TEMPLATE_RESULT (olddecl), newdecl); + DECL_SOURCE_LOCATION (olddecl) + = DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl)) + = DECL_SOURCE_LOCATION (newdecl); } return 1; @@ -3194,13 +3195,13 @@ duplicate_decls (tree newdecl, tree olddecl) TYPE_RAISES_EXCEPTIONS (oldtype)); if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl)) - && TREE_LOCUS_SET_P (olddecl) + && DECL_SOURCE_LINE (olddecl) != 0 && 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); } } @@ -3231,7 +3232,7 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_INITIAL (olddecl) != NULL_TREE) { DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); - copy_tree_locus (newdecl, olddecl); + DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl); if (CAN_HAVE_FULL_LANG_DECL_P (newdecl) && DECL_LANG_SPECIFIC (newdecl) && DECL_LANG_SPECIFIC (olddecl)) @@ -3700,7 +3701,7 @@ pushdecl (tree x) if (TREE_CODE (x) == TYPE_DECL) { tree type = TREE_TYPE (x); - if (!TREE_LOCUS_SET_P (x)) + if (DECL_SOURCE_LINE (x) == 0) { if (TYPE_NAME (type) == 0) TYPE_NAME (type) = x; @@ -4074,7 +4075,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 = TREE_LOCUS (f); + input_location = DECL_SOURCE_LOCATION (f); if (!pushdecl_class_level (f)) is_valid = false; input_location = save_location; @@ -4519,7 +4520,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. */ - set_tree_locus (decl, input_location); + DECL_SOURCE_LOCATION (decl) = input_location; /* Record the fact that this identifier is bound to this label. */ SET_IDENTIFIER_LABEL_VALUE (id, decl); @@ -4830,7 +4831,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. */ - set_tree_locus (decl, location); + DECL_SOURCE_LOCATION (decl) = location; if (ent) { ent->names_in_scope = current_binding_level->names; diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 084cc9b1021..b1ee970464e 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2240,7 +2240,7 @@ start_static_initialization_or_destruction (tree decl, int initp) where DECL was declared so that error-messages make sense, and so that the debugger will show somewhat sensible file and line information. */ - input_location = TREE_LOCUS (decl); + input_location = DECL_SOURCE_LOCATION (decl); /* Because of: diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 74d1218af1e..a10dcf6a876 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1959,7 +1959,7 @@ location_of (tree t) else if (TREE_CODE (t) == OVERLOAD) t = OVL_FUNCTION (t); - return TREE_LOCUS (t); + return DECL_SOURCE_LOCATION (t); } /* Now the interfaces from error et al to dump_type et al. Each takes an diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 4427754ea40..ace82cdc39f 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2414,9 +2414,9 @@ create_temporary_var (tree type) decl = build_decl (VAR_DECL, NULL_TREE, type); TREE_USED (decl) = 1; DECL_ARTIFICIAL (decl) = 1; + DECL_SOURCE_LOCATION (decl) = input_location; DECL_IGNORED_P (decl) = 1; DECL_CONTEXT (decl) = current_function_decl; - set_tree_locus (decl, input_location); return decl; } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index b5d5e327770..52770042bee 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -719,7 +719,7 @@ synthesize_method (tree fndecl) where the attempt to generate the function occurs, giving the user a hint as to why we are attempting to generate the function. */ - set_tree_locus (fndecl, input_location); + DECL_SOURCE_LOCATION (fndecl) = input_location; interface_unknown = 1; start_function (NULL_TREE, fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED); diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index a817084bb82..2b7df6c5244 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -109,7 +109,7 @@ update_cloned_parm (tree parm, tree cloned_parm) /* The name may have changed from the declaration. */ DECL_NAME (cloned_parm) = DECL_NAME (parm); - copy_tree_locus (cloned_parm, parm); + DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm); } /* FN is a function that has a complete body. Clone the body as @@ -146,7 +146,7 @@ maybe_clone_body (tree fn) splay_tree decl_map; /* Update CLONE's source position information to match FN's. */ - copy_tree_locus (clone, fn); + DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn); DECL_INLINE (clone) = DECL_INLINE (fn); DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn); DECL_COMDAT (clone) = DECL_COMDAT (fn); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c1d49e7b056..12baea14a33 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -966,9 +966,10 @@ register_specialization (tree spec, tree tmpl, tree args) else if (DECL_TEMPLATE_SPECIALIZATION (fn)) { if (!duplicate_decls (spec, fn) && DECL_INITIAL (spec)) - /* Dup decl failed, but this is a new definition. Set the - line number so any errors match this new definition. */ - copy_tree_locus (fn, spec); + /* Dup decl failed, but this is a new + definition. Set the line number so any errors + match this new definition. */ + DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (spec); return fn; } @@ -1782,8 +1783,9 @@ check_explicit_specialization (tree declarator, DECL_INITIAL (DECL_TEMPLATE_RESULT (tmpl)) = NULL_TREE; if (have_def) { - copy_tree_locus (tmpl, decl); - copy_tree_locus (DECL_TEMPLATE_RESULT (tmpl), decl); + DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl); + DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (tmpl)) + = DECL_SOURCE_LOCATION (decl); } return tmpl; } @@ -4253,7 +4255,8 @@ lookup_template_class (tree d1, type_decl = create_implicit_typedef (DECL_NAME (template), t); DECL_CONTEXT (type_decl) = TYPE_CONTEXT (t); TYPE_STUB_DECL (t) = type_decl; - copy_tree_locus (type_decl, TYPE_STUB_DECL (template_type)); + DECL_SOURCE_LOCATION (type_decl) + = DECL_SOURCE_LOCATION (TYPE_STUB_DECL (template_type)); } else type_decl = TYPE_NAME (t); @@ -4709,7 +4712,7 @@ tsubst_friend_function (tree decl, tree args) tree new_friend; location_t saved_loc = input_location; - input_location = TREE_LOCUS (decl); + input_location = DECL_SOURCE_LOCATION (decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_TEMPLATE_INSTANTIATION (decl) @@ -5150,7 +5153,7 @@ instantiate_class_template (tree type) /* Set the input location to the template definition. This is needed if tsubsting causes an error. */ - input_location = TREE_LOCUS (TYPE_NAME (pattern)); + input_location = DECL_SOURCE_LOCATION (TYPE_NAME (pattern)); TYPE_HAS_CONSTRUCTOR (type) = TYPE_HAS_CONSTRUCTOR (pattern); TYPE_HAS_DESTRUCTOR (type) = TYPE_HAS_DESTRUCTOR (pattern); @@ -5299,7 +5302,7 @@ instantiate_class_template (tree type) assist in error message reporting. Since we called push_tinst_level above, we don't need to restore these. */ - input_location = TREE_LOCUS (t); + input_location = DECL_SOURCE_LOCATION (t); if (TREE_CODE (t) == TEMPLATE_DECL) processing_template_decl++; @@ -5408,7 +5411,7 @@ instantiate_class_template (tree type) implicit functions at a predictable point, and the same point that would be used for non-template classes. */ typedecl = TYPE_MAIN_DECL (type); - input_location = TREE_LOCUS (typedecl); + input_location = DECL_SOURCE_LOCATION (typedecl); unreverse_member_declarations (type); finish_struct_1 (type); @@ -5705,7 +5708,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) /* Set the filename and linenumber to improve error-reporting. */ saved_loc = input_location; - input_location = TREE_LOCUS (t); + input_location = DECL_SOURCE_LOCATION (t); switch (TREE_CODE (t)) { @@ -10771,7 +10774,7 @@ instantiate_decl (tree d, int defer_ok) else pattern_defined = ! DECL_IN_AGGR_P (code_pattern); - input_location = TREE_LOCUS (d); + input_location = DECL_SOURCE_LOCATION (d); if (pattern_defined) { @@ -10887,7 +10890,7 @@ instantiate_decl (tree d, int defer_ok) /* We already set the file and line above. Reset them now in case they changed as a result of calling regenerate_decl_from_template. */ - input_location = TREE_LOCUS (d); + input_location = DECL_SOURCE_LOCATION (d); if (TREE_CODE (d) == VAR_DECL) { @@ -11175,7 +11178,8 @@ tsubst_enum (tree tag, tree newtag, tree args) } finish_enum (newtag); - copy_tree_locus (TYPE_NAME (newtag), TYPE_NAME (tag)); + DECL_SOURCE_LOCATION (TYPE_NAME (newtag)) + = DECL_SOURCE_LOCATION (TYPE_NAME (tag)); } /* DECL is a FUNCTION_DECL that is a template specialization. Return diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ca04ddf26b6..ef42579f349 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2030,7 +2030,7 @@ begin_class_definition (tree t) } /* Update the location of the decl. */ - set_tree_locus (TYPE_NAME (t), input_location); + DECL_SOURCE_LOCATION (TYPE_NAME (t)) = input_location; if (TYPE_BEING_DEFINED (t)) { diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 6dce605dbd1..0c729d6118c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2153,7 +2153,7 @@ cp_copy_res_decl_for_inlining (tree result, && DECL_NAME (var) == NULL_TREE) { DECL_NAME (var) = DECL_NAME (nrv); - copy_tree_locus (var, nrv); + DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (nrv); DECL_ABSTRACT_ORIGIN (var) = DECL_ORIGIN (nrv); /* Don't lose initialization info. */ DECL_INITIAL (var) = DECL_INITIAL (nrv); |