This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: gcj support for lex timevar
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 17 Mar 2003 17:01:19 -0700
- Subject: Patch: gcj support for lex timevar
- Reply-to: tromey at redhat dot com
This patch adds support for the TV_LEX timevar to gcj.
Ok for trunk?
Tom
Index: gcc/java/ChangeLog
from Tom Tromey <tromey at redhat dot com>
* lex.c (do_java_lex): Renamed from java_lex.
(java_lex): New function.
Include timevar.h.
Index: gcc/java/lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lex.c,v
retrieving revision 1.103
diff -u -r1.103 lex.c
--- gcc/java/lex.c 24 Feb 2003 02:14:49 -0000 1.103
+++ gcc/java/lex.c 17 Mar 2003 21:05:14 -0000
@@ -38,12 +38,17 @@
#include "keyword.h"
#include "flags.h"
#include "chartables.h"
+#ifndef JC1_LITE
+#include "timevar.h"
+#endif
/* Function declarations. */
static char *java_sprint_unicode (struct java_line *, int);
static void java_unicode_2_utf8 (unicode_t);
static void java_lex_error (const char *, int);
#ifndef JC1_LITE
+static int do_java_lex (YYSTYPE *);
+static int java_lex (YYSTYPE *);
static int java_is_eol (FILE *, int);
static tree build_wfl_node (tree);
#endif
@@ -937,7 +942,7 @@
#ifdef JC1_LITE
yylex (YYSTYPE *java_lval)
#else
-java_lex (YYSTYPE *java_lval)
+do_java_lex (YYSTYPE *java_lval)
#endif
{
int c;
@@ -1699,6 +1704,19 @@
}
#ifndef JC1_LITE
+
+/* The exported interface to the lexer. */
+static int
+java_lex (YYSTYPE *java_lval)
+{
+ int r;
+
+ timevar_push (TV_LEX);
+ r = do_java_lex (java_lval);
+ timevar_pop (TV_LEX);
+ return r;
+}
+
/* This is called by the parser to see if an error should be generated
due to numeric overflow. This function only handles the particular
case of the largest negative value, and is only called in the case
@@ -1716,6 +1734,7 @@
java_lex_error ("Numeric overflow for `int' literal", 0);
}
}
+
#endif /* JC1_LITE */
static void