/* Parser for Java(TM) .class files.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
#include "javaop.h"
#include "java-tree.h"
#include "diagnostic-core.h"
-#include "toplev.h"
#include "parse.h"
#include "ggc.h"
#include "debug.h"
-#include "assert.h"
#include "cgraph.h"
#include "vecprim.h"
#include "bitmap.h"
+#include "target.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
if (fsource_filename
&& filenames == 0
&& strlen (fsource_filename) > strlen (".java")
- && strcmp ((fsource_filename
- + strlen (fsource_filename)
- - strlen (".java")),
+ && filename_cmp ((fsource_filename
+ + strlen (fsource_filename)
+ - strlen (".java")),
".java") != 0)
{
/* fsource_filename isn't a .java file but a list of filenames
/* Use the current input_filename (derived from the class name)
if it has a directory prefix, but otherwise matches sfname. */
if (old_len > new_len
- && strcmp (sfname, old_filename + old_len - new_len) == 0
+ && filename_cmp (sfname, old_filename + old_len - new_len) == 0
&& (old_filename[old_len - new_len - 1] == '/'
|| old_filename[old_len - new_len - 1] == '\\'))
return;
}
sfname = find_sourcefile (sfname);
- line_table->maps[line_table->used-1].to_file = sfname;
+ ORDINARY_MAP_FILE_NAME (LINEMAPS_LAST_ORDINARY_MAP (line_table)) = sfname;
if (current_class == main_class) main_input_filename = sfname;
}
from the input class file into the output file. We don't decode the
data at all, merely rewriting constant indexes whenever we come
across them: this is necessary because the constant pool in the
- output file isn't the same as the constant pool in in the input.
+ output file isn't the same as the constant pool in the input.
The main advantage of this technique is that the resulting
annotation data is pointer-free, so it doesn't have to be relocated
case CONSTANT_Long:
index = handle_long_constant (jcf, cpool, CONSTANT_Long, index,
- WORDS_BIG_ENDIAN);
+ targetm.words_big_endian ());
break;
case CONSTANT_Double:
index = handle_long_constant (jcf, cpool, CONSTANT_Double, index,
- FLOAT_WORDS_BIG_ENDIAN);
+ targetm.float_words_big_endian ());
break;
case CONSTANT_Float:
hi = JPOOL_UINT (jcf, index);
lo = JPOOL_UINT (jcf, index+1);
- if (FLOAT_WORDS_BIG_ENDIAN)
+ if (targetm.float_words_big_endian ())
buf[0] = hi, buf[1] = lo;
else
buf[0] = lo, buf[1] = hi;
void
-java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
+java_parse_file (void)
{
int filename_count = 0;
location_t save_location = input_location;
int avail = 2000;
finput = fopen (main_input_filename, "r");
if (finput == NULL)
- fatal_error ("can't open %s: %m", input_filename);
+ fatal_error ("can%'t open %s: %m", input_filename);
list = XNEWVEC (char, avail);
next = list;
for (;;)
next = list + count;
avail = avail - count;
}
- /* Subtract to to guarantee space for final '\0'. */
+ /* Subtract one to guarantee space for final '\0'. */
count = fread (next, 1, avail - 1, finput);
if (count == 0)
{
list = next;
}
- if (file_list != NULL)
- free (file_list);
+ free (file_list);
if (filename_count == 0)
warning (0, "no input file specified");
const char *resource_filename;
/* Only one resource file may be compiled at a time. */
- assert (VEC_length (tree, all_translation_units) == 1);
+ gcc_assert (VEC_length (tree, all_translation_units) == 1);
resource_filename
= IDENTIFIER_POINTER
/* Close previous descriptor, if any */
if (finput && fclose (finput))
- fatal_error ("can't close input file %s: %m", main_input_filename);
+ fatal_error ("can%'t close input file %s: %m", main_input_filename);
finput = fopen (filename, "rb");
if (finput == NULL)
- fatal_error ("can't open %s: %m", filename);
+ fatal_error ("can%'t open %s: %m", filename);
#ifdef IO_BUFFER_SIZE
setvbuf (finput, xmalloc (IO_BUFFER_SIZE),