This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

another PATCH for --enable-mapped-location in gcc/java


This is the next bunch of fixes to support USE_MAPPED_LOCATION
in gcc/java.  Checked in to mainline.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

2004-09-30  Per Bothner  <per@bothner.com>

	More cleanup for --enable-mapped-location.
	* class.c (push_class):  If USE_MAPPED_LOCATION don't set
	input_location here.  Instead do it in give_name_to_class.
	(build_class_ref):  Set DECL_ARTIFICIAL, for the sake of dwarf2out.
	* expr.c (expand_byte_code): Call linemap_line_start.
	* expr.c (build_expr_wfl):  If USE_MAPPED_LOCATION, change final
	parameters to a source_location.  Don't need EXPR_WFL_FILENAME_NODE.
	(expr_add_location):  New function, if USE_MAPPED_LOCATION.
	* class.c (maybe_layout_super_class):  Adjust build_expr_wfl call
	to USE_MAPPED_LOCATION case.

	* java-tree.h (JAVA_FILE_P, ZIP_FILE_P):  Remove unused macros.
	* jcf-parse.c (java_parse_file): Don't set input_filename.
	Use IS_A_COMMAND_LINE_FILENAME_P to check for duplicate filenames.
	Create a list of TRANSLATION_UNIT_DECL.
	(current_file_list):  Is now a TRANSLATION_UNIT_DECL chain.  The
	reason is so we can set a DECL_SOURCE_LOCATION for each file.
	(java_parse_file):  Don't set unused ZIP_FILE_P, JAVA_FILE_P..
	Create line-map LC_ENTER/LC_LEAVE entries for archive itself.
	(file_start_location):  New static.
	(set_source_filename):  Avoid extra access to input_filename macro.
	Concatenate new name with class's package prefix.
	(set_source_filename, give_name_to_class): Update.
	(give_name_to_class):  Set class's "line 0" input_location here.
	(parse_class_file):  Set input_location as a unit.

	* jcf-parse.c (load_class): Sanity test if missing inner class file.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.208
diff -u -p -r1.208 class.c
--- class.c	28 Sep 2004 18:27:25 -0000	1.208
+++ class.c	30 Sep 2004 23:08:58 -0000
@@ -428,10 +428,12 @@ push_class (tree class_type, tree class_
 {
   tree decl, signature;
   location_t saved_loc = input_location;
+#ifndef USE_MAPPED_LOCATION
   tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
-  CLASS_P (class_type) = 1;
   input_filename = IDENTIFIER_POINTER (source_name);
   input_line = 0;
+#endif
+  CLASS_P (class_type) = 1;
   decl = build_decl (TYPE_DECL, class_name, class_type);
 
   /* dbxout needs a DECL_SIZE if in gstabs mode */
@@ -1037,6 +1039,7 @@ build_class_ref (tree type)
 	      TREE_STATIC (decl) = 1;
 	      TREE_PUBLIC (decl) = 1;
 	      DECL_EXTERNAL (decl) = 1;
+	      DECL_ARTIFICIAL (decl) = 1;
 	      make_decl_rtl (decl);
 	      pushdecl_top_level (decl);
 	    }
@@ -1996,9 +1999,14 @@ maybe_layout_super_class (tree super_cla
 	  if (this_class)
 	    {
 	      tree this_decl = TYPE_NAME (this_class);
+#ifdef USE_MAPPED_LOCATION
+	      this_wrap = build_expr_wfl (this_class,
+					  DECL_SOURCE_LOCATION (this_decl));
+#else
 	      this_wrap = build_expr_wfl (this_class,
 					  DECL_SOURCE_FILE (this_decl),
 					  DECL_SOURCE_LINE (this_decl), 0);
+#endif
 	    }
 	  super_class = do_resolve_class (NULL_TREE, /* FIXME? */
 					  super_class, NULL_TREE, this_wrap);
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.206
diff -u -p -r1.206 expr.c
--- expr.c	25 Sep 2004 13:49:21 -0000	1.206
+++ expr.c	30 Sep 2004 23:08:59 -0000
@@ -2695,7 +2695,12 @@ expand_byte_code (JCF *jcf, tree method)
 	      linenumber_pointer += 4;
 	      if (pc == PC)
 		{
-		  input_location.line = GET_u2 (linenumber_pointer - 2);
+		  int line = GET_u2 (linenumber_pointer - 2);
+#ifdef USE_MAPPED_LOCATION
+		  input_location = linemap_line_start (&line_table, line, 1);
+#else
+		  input_location.line = line;
+#endif
 		  if (!(instruction_bits[PC] & BCODE_HAS_MULTI_LINENUMBERS))
 		    break;
 		}
@@ -3225,21 +3230,33 @@ force_evaluation_order (tree node)
    recursively more than one file (Java is one of them).  */
 
 tree
-build_expr_wfl (tree node, const char *file, int line, int col)
+build_expr_wfl (tree node,
+#ifdef USE_MAPPED_LOCATION
+		source_location location
+#else
+		const char *file, int line, int col
+#endif
+)
 {
+  tree wfl;
+#ifdef USE_MAPPED_LOCATION
+  wfl = make_node (EXPR_WITH_FILE_LOCATION);
+  SET_EXPR_LOCATION (wfl, location);
+#else
+  wfl = make_node (EXPR_WITH_FILE_LOCATION);
+
   static const char *last_file = 0;
   static tree last_filenode = NULL_TREE;
-  tree wfl = make_node (EXPR_WITH_FILE_LOCATION);
 
-  EXPR_WFL_NODE (wfl) = node;
   EXPR_WFL_SET_LINECOL (wfl, line, col);
   if (file != last_file)
     {
       last_file = file;
       last_filenode = file ? get_identifier (file) : NULL_TREE;
     }
-
   EXPR_WFL_FILENAME_NODE (wfl) = last_filenode;
+#endif
+  EXPR_WFL_NODE (wfl) = node;
   if (node)
     {
       if (IS_NON_TYPE_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (node))))
@@ -3250,6 +3267,42 @@ build_expr_wfl (tree node, const char *f
   return wfl;
 }
 
+#ifdef USE_MAPPED_LOCATION
+tree
+expr_add_location (tree node, source_location location, bool statement)
+{
+  tree wfl;
+#if 0
+  /* FIXME. This optimization causes failures in code that expects an
+     EXPR_WITH_FILE_LOCATION.  E.g. in resolve_qualified_expression_name. */
+  if (node && ! (statement && flag_emit_class_files))
+    {
+      source_location node_loc = EXPR_LOCATION (node);
+      if (node_loc == location || location == UNKNOWN_LOCATION)
+	return node;
+      if (node_loc == UNKNOWN_LOCATION
+	  && IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (node))))
+	{
+	  SET_EXPR_LOCATION (node, location);
+	  return node;
+	}
+    }
+#endif
+  wfl = make_node (EXPR_WITH_FILE_LOCATION);
+  SET_EXPR_LOCATION (wfl, location);
+  EXPR_WFL_NODE (wfl) = node;
+  if (statement && debug_info_level != DINFO_LEVEL_NONE)
+    EXPR_WFL_EMIT_LINE_NOTE (wfl) = 1;
+  if (node)
+    {
+      if (IS_NON_TYPE_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (node))))
+	TREE_SIDE_EFFECTS (wfl) = TREE_SIDE_EFFECTS (node);
+      TREE_TYPE (wfl) = TREE_TYPE (node);
+    }
+
+  return wfl;
+}
+#endif
 
 /* Build a node to represent empty statements and blocks. */
 
Index: java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.217
diff -u -p -r1.217 java-tree.h
--- java-tree.h	30 Sep 2004 02:16:00 -0000	1.217
+++ java-tree.h	30 Sep 2004 23:08:59 -0000
@@ -52,17 +52,15 @@ struct JCF;
       COMPOUND_ASSIGN_P (in EXPR (binop_*))
       LOCAL_CLASS_P (in RECORD_TYPE)
       BLOCK_IS_IMPLICIT (in BLOCK)
-      JAVA_FILE_P (in TREE_LIST in current_file_list)
    2: RETURN_MAP_ADJUSTED (in TREE_VEC).
       QUALIFIED_P (in IDENTIFIER_NODE)
       PRIMARY_P (in EXPR_WITH_FILE_LOCATION)
       MODIFY_EXPR_FROM_INITIALIZATION_P (in MODIFY_EXPR)
       CLASS_METHOD_CHECKED_P (in RECORD_TYPE) 
-      CLASS_FILE_P (in TREE_LIST in current_file_list)
+      CLASS_FILE_P (in a TRANSLATION_UNIT_DECL in current_file_list)
    3: IS_AN_IMPORT_ON_DEMAND_P (in IDENTIFIER_NODE)
       RESOLVE_PACKAGE_NAME_P (in EXPR_WITH_FILE_LOCATION)
       SWITCH_HAS_DEFAULT (in SWITCH_EXPR)
-      ZIP_FILE_P (in TREE_LIST in current_file_list)
       HAS_FINALIZER (in RECORD_TYPE)
    4: IS_A_COMMAND_LINE_FILENAME_P (in IDENTIFIER_NODE)
       RESOLVE_TYPE_NAME_P (in EXPR_WITH_FILE_LOCATION)
@@ -756,7 +754,7 @@ union lang_tree_node 
 /* Number of local variable slots needed for the arguments of this function. */
 #define DECL_ARG_SLOT_COUNT(DECL) \
   (DECL_LANG_SPECIFIC(DECL)->u.f.arg_slot_count)
-/* Line number of end of function. */
+/* Source location of end of function. */
 #define DECL_FUNCTION_LAST_LINE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.last_line)
 /* Information on declaration location */
 #define DECL_FUNCTION_WFL(DECL)  (DECL_LANG_SPECIFIC(DECL)->u.f.wfl)
@@ -958,7 +956,9 @@ struct lang_decl_func GTY(())
   int max_locals;
   int max_stack;
   int arg_slot_count;
-  int last_line; 		/* End line number for a function decl */
+  /* A temportary lie for the sake of ggc.  Actually, last_line is
+  * only a source_location if USE_MAPPED_LOCATION.  FIXME. */
+  source_location last_line;	/* End line number for a function decl */
   tree wfl;			/* Information on the original location */
   tree throws_list;		/* Exception specified by `throws' */
   tree function_decl_body;	/* Hold all function's statements */
@@ -1378,9 +1378,7 @@ extern tree builtin_function (const char
 #define METHOD_INVISIBLE(DECL) \
   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.f.invisible)
 
-#define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
 #define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE)
-#define ZIP_FILE_P(NODE) TREE_LANG_FLAG_4 (NODE)
 
 /* Other predicates on method decls  */
 
Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.172
diff -u -p -r1.172 jcf-parse.c
--- jcf-parse.c	28 Sep 2004 17:40:56 -0000	1.172
+++ jcf-parse.c	30 Sep 2004 23:08:59 -0000
@@ -80,9 +80,12 @@ static GTY(()) tree parse_roots[3];
 /* The METHOD_DECL for the current method.  */
 #define current_method parse_roots[1]
 
-/* A list of file names.  */
+/* A list of TRANSLATION_UNIT_DECLs for the files to be compiled.  */
 #define current_file_list parse_roots[2]
 
+/* Line 0 in current file, if compiling from bytecode. */
+static location_t file_start_location;
+
 /* The Java archive that provides main_class;  the main input file. */
 static GTY(()) struct JCF * main_jcf;
 
@@ -128,21 +131,48 @@ set_source_filename (JCF *jcf, int index
 {
   tree sfname_id = get_name_constant (jcf, index);
   const char *sfname = IDENTIFIER_POINTER (sfname_id);
-  if (input_filename != NULL)
+  const char *old_filename = input_filename;
+  int new_len = IDENTIFIER_LENGTH (sfname_id);
+  if (old_filename != NULL)
     {
-      int old_len = strlen (input_filename);
-      int new_len = IDENTIFIER_LENGTH (sfname_id);
+      int old_len = strlen (old_filename);
       /* 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, input_filename + old_len - new_len) == 0
-	  && (input_filename[old_len - new_len - 1] == '/'
-	      || input_filename[old_len - new_len - 1] == '\\'))
+	  && strcmp (sfname, old_filename + old_len - new_len) == 0
+	  && (old_filename[old_len - new_len - 1] == '/'
+	      || old_filename[old_len - new_len - 1] == '\\'))
 	return;
     }
+  if (strchr (sfname, '/') == NULL && strchr (sfname, '\\') == NULL)
+    {
+      const char *class_name
+	= IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)));
+      char *dot = strrchr (class_name, '.');
+      if (dot != NULL)
+	{
+	  int i = dot - class_name;
+	  /* Concatenate current package prefix with new sfname. */
+	  char *buf = xmalloc (i+new_len+3);
+	  /* Replace '.' by DIR_SEPARATOR. */
+	  for (; i >= 0;  i--)
+	    {
+	      if (buf[i] == '.')
+		buf[i] = DIR_SEPARATOR;
+	    }
+	  sfname_id = get_identifier (buf);
+	  sfname = IDENTIFIER_POINTER (sfname_id);
+	}
+    }
+      
+#ifdef USE_MAPPED_LOCATION
+  line_table.maps[line_table.used-1].to_file = sfname;
+#else
   input_filename = sfname;
-  DECL_SOURCE_FILE (TYPE_NAME (current_class)) = sfname;
-  if (current_class == main_class) main_input_filename = input_filename;
+  DECL_SOURCE_LOCATION (TYPE_NAME (current_class)) = input_location;
+  file_start_location = input_location;
+#endif
+  if (current_class == main_class) main_input_filename = sfname;
 }
 
 #define HANDLE_SOURCEFILE(INDEX) set_source_filename (jcf, INDEX)
@@ -414,10 +444,22 @@ 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);
-      input_filename = DECL_SOURCE_FILE (TYPE_NAME (this_class));
-      input_line = 0;
+#ifdef USE_MAPPED_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);
+      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;
+#endif
 
       jcf->cpool.data[i].t = this_class;
       JPOOL_TAG (jcf, i) = CONSTANT_ResolvedClass;
@@ -602,6 +644,11 @@ load_class (tree class_or_name, int verb
 	  *separator = '\0';
 	  name = get_identifier (IDENTIFIER_POINTER (name));
 	  *separator = c;
+
+	  /* Otherwise we might get infinite recursion, if say we have
+	     String.class but not String$CaseInsensitiveComparator.class. */
+	  if (current_jcf && current_jcf->java_source == 0)
+	    break;
 	}
       /* Otherwise, we failed, we bail. */
       else
@@ -707,8 +754,7 @@ parse_class_file (void)
 
   java_layout_seen_class_methods ();
 
-  input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class));
-  input_line = 0;
+  input_location = DECL_SOURCE_LOCATION (TYPE_NAME (current_class));
   (*debug_hooks->start_source_file) (input_line, input_filename);
 
   /* Currently we always have to emit calls to _Jv_InitClass when
@@ -895,6 +941,7 @@ void
 java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
 {
   int filename_count = 0;
+  location_t save_location = input_location;
   char *list, *next;
   tree node;
   FILE *finput = NULL;
@@ -903,7 +950,7 @@ java_parse_file (int set_yydebug ATTRIBU
   if (flag_filelist_file)
     {
       int avail = 2000;
-      finput = fopen (input_filename, "r");
+      finput = fopen (main_input_filename, "r");
       if (finput == NULL)
 	fatal_error ("can't open %s: %m", input_filename);
       list = xmalloc(avail);
@@ -935,7 +982,7 @@ java_parse_file (int set_yydebug ATTRIBU
       finput = NULL;
     }
   else
-    list = input_filename ? xstrdup (input_filename) : 0;
+    list = (char *) main_input_filename;
 
   while (list)
     {
@@ -977,51 +1024,32 @@ java_parse_file (int set_yydebug ATTRIBU
 
       if (list[0]) 
 	{
-	  char *value;
-	  tree id;
-	  int twice = 0;
-
-	  int len = strlen (list);
-
-	  obstack_grow0 (&temporary_obstack, list, len);
-	  value = obstack_finish (&temporary_obstack);
+	  node = get_identifier (list);
 
 	  filename_count++;
 
-	  /* Exclude file that we see twice on the command line. For
-	     all files except {Class,Error,Object,RuntimeException,String,
-	     Throwable}.java we can rely on maybe_get_identifier. For
-	     these files, we need to do a linear search of
-	     current_file_list. This search happens only for these
-	     files, presumably only when we're recompiling libgcj. */
+	  /* Exclude file that we see twice on the command line. */
 	     
-	  if ((id = maybe_get_identifier (value)))
-	    {
-	      if (predefined_filename_p (id))
-		{
-		  tree c;
-		  for (c = current_file_list; c; c = TREE_CHAIN (c))
-		    if (TREE_VALUE (c) == id)
-		      twice = 1;
-		}
-	      else
-		twice = 1;
-	    }
-
-	  if (twice)
+	  if (IS_A_COMMAND_LINE_FILENAME_P (node))
 	    {
 	      location_t warn_loc;
-	      warn_loc.file = value;
+#ifdef USE_MAPPED_LOCATION
+	      linemap_add (&line_table, LC_RENAME, 0,
+			   IDENTIFIER_POINTER (node), 0);
+	      warn_loc = linemap_line_start (&line_table, 0, 1);
+#else
+	      warn_loc.file = IDENTIFIER_POINTER (node);
 	      warn_loc.line = 0;
+#endif
 	      warning ("%Hsource file seen twice on command line and "
 		       "will be compiled only once", &warn_loc);
 	    }
 	  else
 	    {
-	      node = get_identifier (value);
+	      tree file_decl = build_decl (TRANSLATION_UNIT_DECL, node, NULL);
+	      TREE_CHAIN (file_decl) = current_file_list;
+	      current_file_list = file_decl;
 	      IS_A_COMMAND_LINE_FILENAME_P (node) = 1;
-	      current_file_list = tree_cons (NULL_TREE, node, 
-					     current_file_list);
 	    }
 	}
       list = next;
@@ -1037,7 +1065,7 @@ java_parse_file (int set_yydebug ATTRIBU
       /* Only one resource file may be compiled at a time.  */
       assert (TREE_CHAIN (current_file_list) == NULL);
 
-      resource_filename = IDENTIFIER_POINTER (TREE_VALUE (current_file_list));
+      resource_filename = IDENTIFIER_POINTER (DECL_NAME (current_file_list));
       compile_resource_file (resource_name, resource_filename);
 
       goto finish;
@@ -1049,27 +1077,27 @@ java_parse_file (int set_yydebug ATTRIBU
     {
       unsigned char magic_string[4];
       uint32 magic = 0;
-      tree name = TREE_VALUE (node);
+      tree name = DECL_NAME (node);
       tree real_file;
+      const char *filename = IDENTIFIER_POINTER (name);
 
       /* Skip already parsed files */
-      real_file = get_identifier (lrealpath (IDENTIFIER_POINTER (name)));
+      real_file = get_identifier (lrealpath (filename));
       if (HAS_BEEN_ALREADY_PARSED_P (real_file))
 	continue;
-      
+
       /* Close previous descriptor, if any */
       if (finput && fclose (finput))
 	fatal_error ("can't close input file %s: %m", main_input_filename);
       
-      finput = fopen (IDENTIFIER_POINTER (name), "rb");
+      finput = fopen (filename, "rb");
       if (finput == NULL)
-	fatal_error ("can't open %s: %m", IDENTIFIER_POINTER (name));
+	fatal_error ("can't open %s: %m", filename);
 
 #ifdef IO_BUFFER_SIZE
       setvbuf (finput, xmalloc (IO_BUFFER_SIZE),
 	       _IOFBF, IO_BUFFER_SIZE);
 #endif
-      input_filename = IDENTIFIER_POINTER (name);
 
       /* Figure what kind of file we're dealing with */
       if (fread (magic_string, 1, 4, finput) == 4)
@@ -1085,22 +1113,29 @@ java_parse_file (int set_yydebug ATTRIBU
 	  current_jcf->read_state = finput;
 	  current_jcf->filbuf = jcf_filbuf_from_stdio;
 	  jcf_parse (current_jcf);
+	  DECL_SOURCE_LOCATION (node) = file_start_location;
 	  TYPE_JCF (current_class) = current_jcf;
 	  CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1;
-	  TREE_PURPOSE (node) = current_class;
+	  TREE_TYPE (node) = current_class;
 	}
       else if (magic == (JCF_u4)ZIPMAGIC)
 	{
-	  ZIP_FILE_P (node) = 1;
 	  main_jcf = ggc_alloc (sizeof (JCF));
 	  JCF_ZERO (main_jcf);
 	  main_jcf->read_state = finput;
 	  main_jcf->filbuf = jcf_filbuf_from_stdio;
-	  if (open_in_zip (main_jcf, input_filename, NULL, 0) <  0)
-	    fatal_error ("bad zip/jar file %s", IDENTIFIER_POINTER (name));
+#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 ();
 	  /*
 	  for (each entry)
@@ -1109,7 +1144,6 @@ java_parse_file (int set_yydebug ATTRIBU
 	}
       else
 	{
-	  JAVA_FILE_P (node) = 1;
 	  java_push_parser_context ();
 	  java_parser_context_save_global ();
 
@@ -1133,10 +1167,10 @@ java_parse_file (int set_yydebug ATTRIBU
 
   for (node = current_file_list; node; node = TREE_CHAIN (node))
     {
-      input_filename = IDENTIFIER_POINTER (TREE_VALUE (node));
+      input_location = DECL_SOURCE_LOCATION (node);
       if (CLASS_FILE_P (node))
 	{
-	  output_class = current_class = TREE_PURPOSE (node);
+	  output_class = current_class = TREE_TYPE (node);
 	  current_jcf = TYPE_JCF (current_class);
 	  layout_class (current_class);
 	  load_inner_classes (current_class);
@@ -1144,7 +1178,7 @@ java_parse_file (int set_yydebug ATTRIBU
 	  JCF_FINISH (current_jcf);
 	}
     }
-  input_filename = main_input_filename;
+  input_location = save_location;
 
   java_expand_classes ();
   if (java_report_errors () || flag_syntax_only)
@@ -1244,7 +1278,6 @@ parse_zip_file_entries (void)
 
 	    if (TYPE_SIZE (current_class) != error_mark_node)
 	      {
-		input_filename = current_jcf->filename;
 		parse_class_file ();
 		FREE (current_jcf->buffer); /* No longer necessary */
 		/* Note: there is a way to free this buffer right after a

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]