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


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

two Java import_list patches


Alex (and others), what do you think of these patches?  The first one
is a minor efficiency simplifiction, and need not go in the branch.

The second one I'm not 100% sure about, but it does look like
IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P was being cleared/set on the wrong
field.

I have run the libjava testsuite with no regressions.

2001-04-27  Per Bothner  <per@bothner.com>

	* parse.h (REGISTER_IMPORT):  Use tree_cons instead of chainon.

	* parse.y (java_pop_parser_context):  The TREE_VALUE of a link in the
	import_list contains the name, not the TREE_PURPOSE.

Index: parse.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.h,v
retrieving revision 1.64.2.2
diff -u -p -r1.64.2.2 parse.h
--- parse.h	2001/03/27 04:41:19	1.64.2.2
+++ parse.h	2001/04/27 18:56:48
@@ -712,8 +712,7 @@ typedef struct _jdeplist {
 #define REGISTER_IMPORT(WHOLE, NAME)					\
 {									\
   IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P ((NAME)) = 1;			\
-  ctxp->import_list = chainon (ctxp->import_list, 			\
-			       build_tree_list ((WHOLE), (NAME)));	\
+  ctxp->import_list = tree_cons ((WHOLE), (NAME), ctxp->import_list);	\
 }
 
 /* Macro to access the osb (opening square bracket) count */
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.19
diff -u -p -r1.251.2.19 parse.y
--- parse.y	2001/04/26 19:43:48	1.251.2.19
+++ parse.y	2001/04/27 18:56:57
@@ -2671,12 +2671,12 @@ java_pop_parser_context (generate)
   /* Set the single import class file flag to 0 for the current list
      of imported things */
   for (current = ctxp->import_list; current; current = TREE_CHAIN (current))
-    IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 0;
+    IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 0;
 
   /* And restore those of the previous context */
   if ((ctxp = next))		/* Assignment is really meant here */
     for (current = ctxp->import_list; current; current = TREE_CHAIN (current))
-      IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 1;
+      IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1;
   
   /* If we pushed a context to parse a class intended to be generated,
      we keep it so we can remember the class. What we could actually
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


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