diff options
author | Richard Henderson <rth@redhat.com> | 2003-09-21 22:09:32 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-09-21 22:09:32 -0700 |
commit | f31686a322301454c5ea5b997997aa7c84c57781 (patch) | |
tree | d942bc168b4a8f91e17acf863e1d2091ff773b6c /gcc/java | |
parent | 0f7fcd6a40a237b634e0f93f1206724add7354d3 (diff) | |
download | gcc-f31686a322301454c5ea5b997997aa7c84c57781.zip gcc-f31686a322301454c5ea5b997997aa7c84c57781.tar.gz gcc-f31686a322301454c5ea5b997997aa7c84c57781.tar.bz2 |
Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
From-SVN: r71641
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/class.c | 11 | ||||
-rw-r--r-- | gcc/java/decl.c | 5 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 10 | ||||
-rw-r--r-- | gcc/java/jcf-write.c | 4 | ||||
-rw-r--r-- | gcc/java/parse.y | 31 | ||||
-rw-r--r-- | gcc/java/resource.c | 3 |
7 files changed, 38 insertions, 31 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index be46849..f0a863b 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,6 +1,11 @@ 2003-09-21 Richard Henderson <rth@redhat.com> * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, + resource.c: Revert. + +2003-09-21 Richard Henderson <rth@redhat.com> + + * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y, resource.c: Update for DECL_SOURCE_LOCATION rename and change to const. 2003-09-20 Richard Henderson <rth@redhat.com> diff --git a/gcc/java/class.c b/gcc/java/class.c index 289dbfa..e3e6cc3 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1728,8 +1728,8 @@ maybe_layout_super_class (tree super_class, tree this_class) { tree this_decl = TYPE_NAME (this_class); this_wrap = build_expr_wfl (this_class, - TREE_FILENAME (this_decl), - TREE_LINENO (this_decl), 0); + DECL_SOURCE_FILE (this_decl), + DECL_SOURCE_LINE (this_decl), 0); } super_class = do_resolve_class (NULL_TREE, /* FIXME? */ super_class, NULL_TREE, this_wrap); @@ -1767,8 +1767,8 @@ layout_class (tree this_class) tree decl = TYPE_NAME (TREE_PURPOSE (current)); sprintf (buffer, "\n which inherits from `%s' (%s:%d)", IDENTIFIER_POINTER (DECL_NAME (decl)), - TREE_FILENAME (decl), - TREE_LINENO (decl)); + DECL_SOURCE_FILE (decl), + DECL_SOURCE_LINE (decl)); obstack_grow (&temporary_obstack, buffer, strlen (buffer)); } obstack_1grow (&temporary_obstack, '\0'); @@ -2059,6 +2059,7 @@ emit_register_classes (void) init_decl = build_decl (FUNCTION_DECL, init_name, init_type); SET_DECL_ASSEMBLER_NAME (init_decl, init_name); + DECL_SOURCE_LINE (init_decl) = 0; TREE_STATIC (init_decl) = 1; current_function_decl = init_decl; DECL_RESULT (init_decl) = build_decl (RESULT_DECL, NULL_TREE, @@ -2083,7 +2084,7 @@ emit_register_classes (void) for ( t = registered_class; t; t = TREE_CHAIN (t)) emit_library_call (registerClass_libfunc, 0, VOIDmode, 1, XEXP (DECL_RTL (t), 0), Pmode); - input_location = TREE_LOCUS (init_decl); + input_location = DECL_SOURCE_LOCATION (init_decl); expand_function_end (); poplevel (1, 0, 1); rest_of_compilation (init_decl); diff --git a/gcc/java/decl.c b/gcc/java/decl.c index d92bbdc..7ddf704 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1070,7 +1070,7 @@ pushdecl (tree x) /* Maybe warn if shadowing something else. */ else if (warn_shadow && !DECL_EXTERNAL (x) /* 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)) { @@ -1817,7 +1817,8 @@ java_expand_body (tree fndecl) int saved_lineno = input_line; current_function_decl = fndecl; - input_location = TREE_LOCUS (fndecl); + input_filename = DECL_SOURCE_FILE (fndecl); + input_line = DECL_SOURCE_LINE (fndecl); timevar_push (TV_EXPAND); diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index eea2a15..f47dbe0 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -145,10 +145,8 @@ set_source_filename (JCF *jcf, int index) return; } input_filename = sfname; - set_tree_file_line (TYPE_NAME (current_class), sfname, - TREE_LINENO (TYPE_NAME (current_class))); - if (current_class == main_class) - main_input_filename = input_filename; + DECL_SOURCE_FILE (TYPE_NAME (current_class)) = sfname; + if (current_class == main_class) main_input_filename = input_filename; } #define HANDLE_SOURCEFILE(INDEX) set_source_filename (jcf, INDEX) @@ -420,7 +418,7 @@ give_name_to_class (JCF *jcf, int i) tree class_name = unmangle_classname (JPOOL_UTF_DATA (jcf, j), JPOOL_UTF_LENGTH (jcf, j)); this_class = lookup_class (class_name); - input_filename = TREE_FILENAME (TYPE_NAME (this_class)); + input_filename = DECL_SOURCE_FILE (TYPE_NAME (this_class)); input_line = 0; if (main_input_filename == NULL && jcf == main_jcf) main_input_filename = input_filename; @@ -710,7 +708,7 @@ parse_class_file (void) java_layout_seen_class_methods (); - input_filename = TREE_FILENAME (TYPE_NAME (current_class)); + input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class)); input_line = 0; (*debug_hooks->start_source_file) (input_line, input_filename); init_outgoing_cpool (); diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index bc76c88..82c77b1 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -3113,7 +3113,7 @@ generate_classfile (tree clas, struct jcf_partial *state) } ptr = methods_count_ptr; UNSAFE_PUT2 (methods_count); - source_file = TREE_FILENAME (TYPE_NAME (clas)); + source_file = DECL_SOURCE_FILE (TYPE_NAME (clas)); for (s = source_file; ; s++) { char ch = *s; @@ -3299,7 +3299,7 @@ make_class_file_name (tree clas) /* Make sure we put the class file into the .java file's directory, and not into some subdirectory thereof. */ char *t; - dname = TREE_FILENAME (TYPE_NAME (clas)); + dname = DECL_SOURCE_FILE (TYPE_NAME (clas)); slash = strrchr (dname, DIR_SEPARATOR); #ifdef DIR_SEPARATOR_2 if (! slash) diff --git a/gcc/java/parse.y b/gcc/java/parse.y index de0a7d4..a5064e1 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -3208,7 +3208,7 @@ classitf_redefinition_error (const char *context, tree id, tree decl, tree cl) { parse_error_context (cl, "%s `%s' already defined in %s:%d", context, IDENTIFIER_POINTER (id), - TREE_FILENAME (decl), TREE_LINENO (decl)); + DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); /* Here we should point out where its redefined. It's a unicode. FIXME */ } @@ -3716,10 +3716,12 @@ maybe_create_class_interface_decl (tree decl, tree raw_name, decl = push_class (make_class (), qualified_name); /* Take care of the file and line business */ - set_tree_file_line (decl, EXPR_WFL_FILENAME (cl), - (flag_emit_xref - ? EXPR_WFL_LINECOL (cl) : EXPR_WFL_LINENO (cl))); - + DECL_SOURCE_FILE (decl) = EXPR_WFL_FILENAME (cl); + /* If we're emiting xrefs, store the line/col number information */ + if (flag_emit_xref) + DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (cl); + else + DECL_SOURCE_LINE (decl) = EXPR_WFL_LINENO (cl); CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) = 1; CLASS_PARSED_P (TREE_TYPE (decl)) = 1; CLASS_FROM_CURRENTLY_COMPILED_P (TREE_TYPE (decl)) = @@ -4203,7 +4205,7 @@ duplicate_declaration_error_p (tree new_field_name, tree new_type, tree cl) (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), t2, IDENTIFIER_POINTER (DECL_NAME (decl)), - TREE_FILENAME (decl), TREE_LINENO (decl)); + DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); free (t1); free (t2); return 1; @@ -4685,7 +4687,7 @@ method_header (int flags, tree type, tree mdecl, tree throws) /* If doing xref, store column and line number information instead of the line number only. */ if (flag_emit_xref) - set_tree_file_line (meth, TREE_FILENAME (meth), EXPR_WFL_LINECOL (id)); + DECL_SOURCE_LINE (meth) = EXPR_WFL_LINECOL (id); return meth; } @@ -6703,8 +6705,8 @@ lookup_cl (tree decl) cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0); } - EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (TREE_FILENAME (decl)); - EXPR_WFL_SET_LINECOL (cl_v, TREE_LINENO (decl), -1); + EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (DECL_SOURCE_FILE (decl)); + EXPR_WFL_SET_LINECOL (cl_v, DECL_SOURCE_LINE (decl), -1); line = java_get_line_col (EXPR_WFL_FILENAME (cl_v), EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v)); @@ -7284,7 +7286,7 @@ declare_local_variables (int modifier, tree type, tree vlist) if ((other = lookup_name_in_blocks (name))) { variable_redefinition_error (wfl, name, TREE_TYPE (other), - TREE_LINENO (other)); + DECL_SOURCE_LINE (other)); continue; } @@ -7304,8 +7306,7 @@ declare_local_variables (int modifier, tree type, tree vlist) /* If doing xreferencing, replace the line number with the WFL compound value */ if (flag_emit_xref) - set_tree_file_line (decl, TREE_FILENAME (decl), - EXPR_WFL_LINECOL (wfl)); + DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl); /* Don't try to use an INIT statement when an error was found */ if (init && java_error_count) @@ -7413,7 +7414,7 @@ create_artificial_method (tree class, int flags, tree type, static void start_artificial_method_body (tree mdecl) { - set_tree_file_line (mdecl, TREE_FILENAME (mdecl), 1); + DECL_SOURCE_LINE (mdecl) = 1; DECL_FUNCTION_LAST_LINE (mdecl) = 1; source_start_java_method (mdecl); enter_block (); @@ -7979,7 +7980,7 @@ start_complete_expand_method (tree mdecl) TREE_CHAIN (tem) = next; } pushdecl_force_head (DECL_ARGUMENTS (mdecl)); - input_location = TREE_LOCUS (mdecl); + input_line = DECL_SOURCE_LINE (mdecl); build_result_decl (mdecl); } @@ -10144,7 +10145,7 @@ check_deprecation (tree wfl, tree decl) to the record. */ decl = TYPE_NAME (TREE_TYPE (elt)); } - file = TREE_FILENAME (decl); + file = DECL_SOURCE_FILE (decl); /* Complain if the field is deprecated and the file it was defined in isn't compiled at the same time the file which contains its diff --git a/gcc/java/resource.c b/gcc/java/resource.c index 25b8a81..b71a670 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -114,6 +114,7 @@ write_resource_constructor (void) init_type = build_function_type (void_type_node, end_params_node); init_decl = build_decl (FUNCTION_DECL, init_name, init_type); + DECL_SOURCE_LINE (init_decl) = 0; SET_DECL_ASSEMBLER_NAME (init_decl, init_name); TREE_STATIC (init_decl) = 1; current_function_decl = init_decl; @@ -139,7 +140,7 @@ write_resource_constructor (void) Pmode); } - input_location = TREE_LOCUS (init_decl); + input_location = DECL_SOURCE_LOCATION (init_decl); expand_function_end (); poplevel (1, 0, 1); { |