This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Changed parser context variable from static to global.
- To: egcs-patches at egcs dot cygnus dot com
- Subject: [PATCH] Changed parser context variable from static to global.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Mon, 5 Apr 1999 12:04:55 -0700
I checked in a patch which changes the parser context variable `ctxp'
from static to global and I added some code in order for
cross-referencing information to be stored on local variable
declarations.
.--- Alex (www.cygnus.com/~apbianco, {apbianco-page,apbianco}@cygnus.com)
| Cygnus Solutions, Java team.
Mon Apr 5 11:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (struct parser_ctxt *ctxp): Now global.
(declare_local_variables): Use WFL compound value for the
declaration source line value, when doing cross-referencing.
Index: parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/parse.y,v
retrieving revision 1.69
diff -u -p -r1.69 parse.y
--- parse.y 1999/03/30 11:35:27 1.69
+++ parse.y 1999/04/05 18:57:34
@@ -248,9 +248,9 @@ int java_error_count;
int java_warning_count;
/* The current parser context */
-static struct parser_ctxt *ctxp;
+struct parser_ctxt *ctxp;
-/* List of things that were anlyzed for which code will be generated */
+/* List of things that were analyzed for which code will be generated */
static struct parser_ctxt *ctxp_for_generation = NULL;
/* binop_lookup maps token to tree_code. It is used where binary
@@ -5319,6 +5319,11 @@ declare_local_variables (modifier, type,
will be entered */
decl = build_decl (VAR_DECL, name, real_type);
BLOCK_CHAIN_DECL (decl);
+
+ /* If doing xreferencing, replace the line number with the WFL
+ compound value */
+ if (flag_emit_xref)
+ DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl);
/* Don't try to use an INIT statement when an error was found */
if (init && java_error_count)