aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
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/java
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/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/class.c11
-rw-r--r--gcc/java/decl.c5
-rw-r--r--gcc/java/jcf-parse.c10
-rw-r--r--gcc/java/jcf-write.c4
-rw-r--r--gcc/java/parse.y31
-rw-r--r--gcc/java/resource.c3
7 files changed, 36 insertions, 33 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a14c1db..be46849 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+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>
* check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index e3e6cc3..289dbfa 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,
- DECL_SOURCE_FILE (this_decl),
- DECL_SOURCE_LINE (this_decl), 0);
+ TREE_FILENAME (this_decl),
+ TREE_LINENO (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)),
- DECL_SOURCE_FILE (decl),
- DECL_SOURCE_LINE (decl));
+ TREE_FILENAME (decl),
+ TREE_LINENO (decl));
obstack_grow (&temporary_obstack, buffer, strlen (buffer));
}
obstack_1grow (&temporary_obstack, '\0');
@@ -2059,7 +2059,6 @@ 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,
@@ -2084,7 +2083,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 = DECL_SOURCE_LOCATION (init_decl);
+ input_location = TREE_LOCUS (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 7ddf704..d92bbdc 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. */
- && DECL_SOURCE_LINE (x) != 0
+ && TREE_LOCUS_SET_P (x)
/* No shadow warnings for vars made for inlining. */
&& ! DECL_FROM_INLINE (x))
{
@@ -1817,8 +1817,7 @@ java_expand_body (tree fndecl)
int saved_lineno = input_line;
current_function_decl = fndecl;
- input_filename = DECL_SOURCE_FILE (fndecl);
- input_line = DECL_SOURCE_LINE (fndecl);
+ input_location = TREE_LOCUS (fndecl);
timevar_push (TV_EXPAND);
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index f47dbe0..eea2a15 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -145,8 +145,10 @@ set_source_filename (JCF *jcf, int index)
return;
}
input_filename = sfname;
- DECL_SOURCE_FILE (TYPE_NAME (current_class)) = sfname;
- if (current_class == main_class) main_input_filename = input_filename;
+ 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;
}
#define HANDLE_SOURCEFILE(INDEX) set_source_filename (jcf, INDEX)
@@ -418,7 +420,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 = DECL_SOURCE_FILE (TYPE_NAME (this_class));
+ input_filename = TREE_FILENAME (TYPE_NAME (this_class));
input_line = 0;
if (main_input_filename == NULL && jcf == main_jcf)
main_input_filename = input_filename;
@@ -708,7 +710,7 @@ parse_class_file (void)
java_layout_seen_class_methods ();
- input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class));
+ input_filename = TREE_FILENAME (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 82c77b1..bc76c88 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 = DECL_SOURCE_FILE (TYPE_NAME (clas));
+ source_file = TREE_FILENAME (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 = DECL_SOURCE_FILE (TYPE_NAME (clas));
+ dname = TREE_FILENAME (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 a5064e1..de0a7d4 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),
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ TREE_FILENAME (decl), TREE_LINENO (decl));
/* Here we should point out where its redefined. It's a unicode. FIXME */
}
@@ -3716,12 +3716,10 @@ 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 */
- 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);
+ set_tree_file_line (decl, EXPR_WFL_FILENAME (cl),
+ (flag_emit_xref
+ ? EXPR_WFL_LINECOL (cl) : 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)) =
@@ -4205,7 +4203,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)),
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ TREE_FILENAME (decl), TREE_LINENO (decl));
free (t1);
free (t2);
return 1;
@@ -4687,7 +4685,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)
- DECL_SOURCE_LINE (meth) = EXPR_WFL_LINECOL (id);
+ set_tree_file_line (meth, TREE_FILENAME (meth), EXPR_WFL_LINECOL (id));
return meth;
}
@@ -6705,8 +6703,8 @@ lookup_cl (tree decl)
cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0);
}
- EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (DECL_SOURCE_FILE (decl));
- EXPR_WFL_SET_LINECOL (cl_v, DECL_SOURCE_LINE (decl), -1);
+ EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (TREE_FILENAME (decl));
+ EXPR_WFL_SET_LINECOL (cl_v, TREE_LINENO (decl), -1);
line = java_get_line_col (EXPR_WFL_FILENAME (cl_v),
EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v));
@@ -7286,7 +7284,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),
- DECL_SOURCE_LINE (other));
+ TREE_LINENO (other));
continue;
}
@@ -7306,7 +7304,8 @@ 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)
- DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl);
+ set_tree_file_line (decl, TREE_FILENAME (decl),
+ EXPR_WFL_LINECOL (wfl));
/* Don't try to use an INIT statement when an error was found */
if (init && java_error_count)
@@ -7414,7 +7413,7 @@ create_artificial_method (tree class, int flags, tree type,
static void
start_artificial_method_body (tree mdecl)
{
- DECL_SOURCE_LINE (mdecl) = 1;
+ set_tree_file_line (mdecl, TREE_FILENAME (mdecl), 1);
DECL_FUNCTION_LAST_LINE (mdecl) = 1;
source_start_java_method (mdecl);
enter_block ();
@@ -7980,7 +7979,7 @@ start_complete_expand_method (tree mdecl)
TREE_CHAIN (tem) = next;
}
pushdecl_force_head (DECL_ARGUMENTS (mdecl));
- input_line = DECL_SOURCE_LINE (mdecl);
+ input_location = TREE_LOCUS (mdecl);
build_result_decl (mdecl);
}
@@ -10145,7 +10144,7 @@ check_deprecation (tree wfl, tree decl)
to the record. */
decl = TYPE_NAME (TREE_TYPE (elt));
}
- file = DECL_SOURCE_FILE (decl);
+ file = TREE_FILENAME (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 b71a670..25b8a81 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -114,7 +114,6 @@ 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;
@@ -140,7 +139,7 @@ write_resource_constructor (void)
Pmode);
}
- input_location = DECL_SOURCE_LOCATION (init_decl);
+ input_location = TREE_LOCUS (init_decl);
expand_function_end ();
poplevel (1, 0, 1);
{