aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index c3fe524..3350191 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -1,6 +1,6 @@
/* Parser for Java(TM) .class files.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -327,14 +327,7 @@ set_source_filename (JCF *jcf, int index)
&& strcmp (sfname, old_filename + old_len - new_len) == 0
&& (old_filename[old_len - new_len - 1] == '/'
|| old_filename[old_len - new_len - 1] == '\\'))
- {
-#ifndef USE_MAPPED_LOCATION
- input_filename = find_sourcefile (input_filename);
- DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
- file_start_location = input_location;
-#endif
- return;
- }
+ return;
}
if (strchr (sfname, '/') == NULL && strchr (sfname, '\\') == NULL)
{
@@ -364,13 +357,7 @@ set_source_filename (JCF *jcf, int index)
}
sfname = find_sourcefile (sfname);
-#ifdef USE_MAPPED_LOCATION
line_table->maps[line_table->used-1].to_file = sfname;
-#else
- input_filename = sfname;
- DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
- file_start_location = input_location;
-#endif
if (current_class == main_class) main_input_filename = sfname;
}
@@ -1205,7 +1192,6 @@ give_name_to_class (JCF *jcf, int i)
tree class_name = unmangle_classname ((const char *) JPOOL_UTF_DATA (jcf, j),
JPOOL_UTF_LENGTH (jcf, j));
this_class = lookup_class (class_name);
-#ifdef USE_MAPPED_LOCATION
{
tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
const char *sfname = IDENTIFIER_POINTER (source_name);
@@ -1216,14 +1202,6 @@ give_name_to_class (JCF *jcf, int i)
if (main_input_filename == NULL && jcf == main_jcf)
main_input_filename = sfname;
}
-#else
- if (! DECL_ARTIFICIAL (TYPE_NAME (this_class)))
- {
- input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
- if (main_input_filename == NULL && jcf == main_jcf)
- main_input_filename = input_filename;
- }
-#endif
jcf->cpool.data[i].t = this_class;
JPOOL_TAG (jcf, i) = CONSTANT_ResolvedClass;
@@ -1496,9 +1474,7 @@ jcf_parse (JCF* jcf)
if (TYPE_REFLECTION_DATA (current_class))
annotation_write_byte (JV_DONE_ATTR);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
/* The fields of class_type_node are already in correct order. */
if (current_class != class_type_node && current_class != object_type_node)
@@ -1531,13 +1507,8 @@ static void
duplicate_class_warning (const char *filename)
{
location_t warn_loc;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_RENAME, 0, filename, 0);
warn_loc = linemap_line_start (line_table, 0, 1);
-#else
- warn_loc.file = filename;
- warn_loc.line = 0;
-#endif
warning (0, "%Hduplicate class will only be compiled once", &warn_loc);
}
@@ -1586,13 +1557,11 @@ parse_class_file (void)
java_layout_seen_class_methods ();
input_location = DECL_SOURCE_LOCATION (TYPE_NAME (current_class));
-#ifdef USE_MAPPED_LOCATION
{
/* Re-enter the current file. */
expanded_location loc = expand_location (input_location);
linemap_add (line_table, LC_ENTER, 0, loc.file, loc.line);
}
-#endif
file_start_location = input_location;
(*debug_hooks->start_source_file) (input_line, input_filename);
@@ -1657,13 +1626,8 @@ parse_class_file (void)
if (min_line == 0 || line < min_line)
min_line = line;
}
-#ifdef USE_MAPPED_LOCATION
if (min_line != 0)
input_location = linemap_line_start (line_table, min_line, 1);
-#else
- if (min_line != 0)
- input_line = min_line;
-#endif
}
else
{
@@ -1934,18 +1898,14 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
JCF_ZERO (main_jcf);
main_jcf->read_state = finput;
main_jcf->filbuf = jcf_filbuf_from_stdio;
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_ENTER, false, filename, 0);
input_location = linemap_line_start (line_table, 0, 1);
-#endif
if (open_in_zip (main_jcf, filename, NULL, 0) < 0)
fatal_error ("bad zip/jar file %s", filename);
localToFile = SeenZipFiles;
/* Register all the classes defined there. */
process_zip_dir (main_jcf->read_state);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
-#endif
parse_zip_file_entries ();
}
else if (magic == (JCF_u4) ZIPEMPTYMAGIC)
@@ -1962,10 +1922,8 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
parse_source_file_1 (real_file, filename, finput);
java_parser_context_restore_global ();
java_pop_parser_context (1);
-#ifdef USE_MAPPED_LOCATION
linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
-#endif
}
}