This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Speed-up get_identifier("main")
- From: Per Bothner <per at bothner dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 06 Aug 2003 16:29:52 -0700
- Subject: Re: [PATCH] Speed-up get_identifier("main")
- References: <Pine.LNX.4.44.0308061520110.29762-100000@www.eyesopen.com>
Roger Sayle wrote:
The one minor wart with this patch is that the java front-end already
defines a GET_IDENTIFIER macro. I work around this inconvenience by
renaming that macro as JAVA_GET_IDENTIFIER. I hope the java folks don't
mind; Java will be one of the big winners from this clean-up. I really
prefer to use "GET_IDENTIFIER" as it avoids having to think about
indentation during the mostly mechanical conversion process.
It might be cleaner to dump GET_IDENTIFIER in Java, and just
do in jv-scan.c:
#define get_identifier(S) xstrdup(S)
A further optimization would be to pre-calculate the hash values.
I don't know if the compiler is could be made to inline calc_hash,
but if not we could do build-time pre-processing.
--
--Per Bothner
per@bothner.com http://per.bothner.com/