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]

[PATCH] Java: temporary fix to cope with recent tree.h changes.


The recent changes to tree.h are breaking the Java front-end,
something that I'll work on fixing ASAP -- this is independent from
the work that needs to be done in order for the Java front-end to do
The Right Thing as far as handling qualified expressions (using
COMPONENT_REF.)

Historically, with TREE_CHAIN used to hold the filename of a
EXPR_WITH_FILE_LOCATION (WFL), it left operand1 free for front-end
specific use, which is what the Java front-end took advantage of. The
issue over the use of TREE_CHAIN for something else than chaining
nodes was moderately debated when WFLs were introduced
(http://www.cygnus.com/ml/egcs/1998-Mar/0831.html).

Mark Mitchell's patch to tree.h
(http://gcc.gnu.org/ml/gcc-patches/1999-12/msg00133.html) stores the
filename in operand1 and TREE_CHAIN can be now used to link WFLs
together. Of course, this conflict with the use the Java front-end
makes of operand1.

This patch is a temporary fix in order for the Java front-end to keep
on working. It extends the number of operand a WFL can have to 3 and
instruct the Java parser to now use operand2 instead of operand1.

I need approval to check in the non Java part of this patch.

./A

Fri Dec 10 16:12:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* tree.def (EXPR_WITH_FILE_LOCATION): To temporary feature three
 	operands, until the Java front-end gets fixed with regard to Mark
 	Mitchell's tree.h patch (1999-12-04.)

Index: tree.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.def,v
retrieving revision 1.24
diff -u -p -r1.24 tree.def
--- tree.def	1999/12/05 02:42:10	1.24
+++ tree.def	1999/12/11 00:17:30
@@ -795,7 +795,7 @@ DEFTREECODE (EXIT_BLOCK_EXPR, "exit_bloc
    (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO).  It is
    expanded as the contained node (EXPR_WFL_NODE);  a line note should
    be emitted first if EXPR_WFL_EMIT_LINE_NOTE.  */
-DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 2)
+DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3)
 
 /* Switch expression.
    Operand 0 is the expression used to perform the branch,

Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
 	operand of a WFL, until the Java front-end gets fixed with regard
 	to Mark Mitchell's tree.h patch (1999-12-04.)

Index: java/parse.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.h,v
retrieving revision 1.36
diff -u -p -r1.36 parse.h
--- parse.h	1999/10/14 17:13:56	1.36
+++ parse.h	1999/12/11 00:17:32
@@ -487,7 +487,7 @@ typedef struct _jdeplist {
   build_expr_wfl ((NODE), input_filename, EXPR_WFL_LINENO ((WFL)), 	\
 		  EXPR_WFL_COLNO ((WFL)))
 
-#define EXPR_WFL_QUALIFICATION(WFL) TREE_OPERAND ((WFL), 1)
+#define EXPR_WFL_QUALIFICATION(WFL) TREE_OPERAND ((WFL), 2)
 #define QUAL_WFL(NODE) TREE_PURPOSE (NODE)
 #define QUAL_RESOLUTION(NODE) TREE_VALUE (NODE)
 #define QUAL_DECL_TYPE(NODE) GET_SKIP_TYPE (NODE)


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