GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>.
Java and all Java-based marks are trademarks or registered trademarks
of Sun Microsystems, Inc. in the United States and other countries.
pointers to char", but strcmp() arguments are "pointers
to char", hence the following cast plus dereference */
- return strcmp(*(char **) p1, *(char **) p2);
+ return strcmp(*(const char *const*) p1, *(const char *const*) p2);
}
/* Create an array of strings, one for each source file that we've
sfname = find_sourcefile (sfname);
#ifdef USE_MAPPED_LOCATION
- line_table.maps[line_table.used-1].to_file = sfname;
+ line_table->maps[line_table->used-1].to_file = sfname;
#else
input_filename = sfname;
DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
{
tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
const char *sfname = IDENTIFIER_POINTER (source_name);
- linemap_add (&line_table, LC_ENTER, false, sfname, 0);
- input_location = linemap_line_start (&line_table, 0, 1);
+ linemap_add (line_table, LC_ENTER, false, sfname, 0);
+ input_location = linemap_line_start (line_table, 0, 1);
file_start_location = input_location;
DECL_SOURCE_LOCATION (TYPE_NAME (this_class)) = input_location;
if (main_input_filename == NULL && jcf == main_jcf)
main_input_filename = sfname;
}
#else
- input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
- if (main_input_filename == NULL && jcf == main_jcf)
- main_input_filename = input_filename;
+ 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;
if (path_name == 0)
return 0;
else
- free((char *) path_name);
+ free(CONST_CAST (char *, path_name));
}
current_jcf = jcf;
|| CLASS_FROM_CURRENTLY_COMPILED_P (type));
}
- /* If the class is from source code, then it must already be loaded. */
- class_decl = IDENTIFIER_CLASS_VALUE (name);
- if (class_decl && CLASS_FROM_SOURCE_P (TREE_TYPE (class_decl)))
- return;
-
saved = name;
/* If flag_verify_invocations is unset, we don't try to load a class
annotation_write_byte (JV_DONE_ATTR);
#ifdef USE_MAPPED_LOCATION
- linemap_add (&line_table, LC_LEAVE, false, NULL, 0);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
/* The fields of class_type_node are already in correct order. */
{
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);
+ 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;
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);
}
#ifdef USE_MAPPED_LOCATION
if (min_line != 0)
- input_location = linemap_line_start (&line_table, min_line, 1);
+ input_location = linemap_line_start (line_table, min_line, 1);
#else
if (min_line != 0)
input_line = min_line;
file_list = list;
}
else
- list = (char *) main_input_filename;
+ list = CONST_CAST (char *, main_input_filename);
while (list)
{
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);
+ 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);
/* 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);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
parse_zip_file_entries ();
}
+ else if (magic == (JCF_u4) ZIPEMPTYMAGIC)
+ {
+ /* Ignore an empty input jar. */
+ }
else
{
gcc_unreachable ();
java_parser_context_restore_global ();
java_pop_parser_context (1);
#ifdef USE_MAPPED_LOCATION
- linemap_add (&line_table, LC_LEAVE, false, NULL, 0);
+ linemap_add (line_table, LC_LEAVE, false, NULL, 0);
#endif
#endif
}