+2005-02-11 Per Bothner <per@bothner.com>
+
+ PR java/15543
+ * parse-scan.y (input_location): Remove variable.
+ (main_input_filename): New - replaces input_filename, which isn't
+ settable if USE_MAPPED_LOCATION.
+ * lex.c (java_init_lex): Wrap some more places in #ifndef JC1-LITE,
+ so we don't reference input_location or wfl_operator in that case.
+ * jv-scan.c (expand_location): Remove - no longer used.
+ (main): Set main_input_filename rather than input_filename.
+
2005-02-09 Richard Henderson <rth@redhat.com>
* builtins.c (initialize_builtins): Call build_common_builtin_nodes.
exit (0);
}
-#ifdef USE_MAPPED_LOCATION
-/* FIXME - this is the same as the function in tree.c, which is awkward.
- Probably the cleanest solution is to move the function to line-map.c.
- This is difficult as long as we still support --disable-mapped-location,
- since whether expanded_location has a column fields depends on
- USE_MAPPED_LOCATION. */
-
-expanded_location
-expand_location (source_location loc)
-{
- expanded_location xloc;
- if (loc == 0) { xloc.file = NULL; xloc.line = 0; xloc.column = 0; }
- else
- {
- const struct line_map *map = linemap_lookup (&line_table, loc);
- xloc.file = map->to_file;
- xloc.line = SOURCE_LINE (map, loc);
- xloc.column = SOURCE_COLUMN (map, loc);
- };
- return xloc;
-}
-#endif
-
/* jc1-lite main entry point */
int
main (int argc, char **argv)
if (encoding == NULL || *encoding == '\0')
encoding = DEFAULT_ENCODING;
- input_filename = filename;
- input_line = 0;
+ main_input_filename = filename;
java_init_lex (finput, encoding);
ctxp->filename = filename;
yyparse ();
if (!wfl_operator)
{
+#ifndef JC1_LITE
#ifdef USE_MAPPED_LOCATION
wfl_operator = build_expr_wfl (NULL_TREE, input_location);
#else
wfl_operator = build_expr_wfl (NULL_TREE, ctxp->filename, 0, 0);
+#endif
#endif
}
if (!label_id)
ctxp->package = NULL_TREE;
#endif
+#ifndef JC1_LITE
ctxp->save_location = input_location;
+#endif
ctxp->java_error_flag = 0;
ctxp->lexer = java_new_lexer (finput, encoding);
}
#ifndef JC1_LITE
java_lval->operator.token = OCB_TK;
java_lval->operator.location = BUILD_LOCATION();
-#endif
#ifdef USE_MAPPED_LOCATION
if (ctxp->ccb_indent == 1)
ctxp->first_ccb_indent1 = input_location;
#else
if (ctxp->ccb_indent == 1)
ctxp->first_ccb_indent1 = input_line;
+#endif
#endif
ctxp->ccb_indent++;
return OCB_TK;
case '}':
+ ctxp->ccb_indent--;
#ifndef JC1_LITE
java_lval->operator.token = CCB_TK;
java_lval->operator.location = BUILD_LOCATION();
-#endif
- ctxp->ccb_indent--;
#ifdef USE_MAPPED_LOCATION
if (ctxp->ccb_indent == 1)
ctxp->last_ccb_indent1 = input_location;
#else
if (ctxp->ccb_indent == 1)
ctxp->last_ccb_indent1 = input_line;
+#endif
#endif
return CCB_TK;
case '[':
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "input.h"
#include "obstack.h"
#include "toplev.h"
extern FILE *finput, *out;
-/* Current position in real source file. */
-
-location_t input_location;
+ const char *main_input_filename;
/* Obstack for the lexer. */
struct obstack temporary_obstack;
if (!previous_output)
{
if (flag_list_filename)
- fprintf (out, "%s: ", input_filename);
+ fprintf (out, "%s: ", main_input_filename);
previous_output = 1;
}
{
extern int flag_complexity;
if (flag_complexity)
- fprintf (out, "%s %d\n", input_filename, complexity);
+ fprintf (out, "%s %d\n", main_input_filename, complexity);
}
/* Reset global status used by the report functions. */
void
yyerror (const char *msg ATTRIBUTE_UNUSED)
{
- fprintf (stderr, "%s: %d: %s\n", input_filename, input_line, msg);
+ fprintf (stderr, "%s: %s\n", main_input_filename, msg);
exit (1);
}