[C++ PATCH] Avoid some token copying

Nathan Sidwell nathan@codesourcery.com
Wed Oct 20 07:56:00 GMT 2004


This patch changes the token saving mechanism for inline member functions
and the like.  We can simply point to the tokens in the parent lexer's
buffer.  It also removes some of the gunk that was necessary when
the lexer's token buffer was a circular buffer.

Now that parser debugging is enabled with ENABLE_CHECKING, there's
no real need for cp_lexer_peek_token_emit_debug_info to be a separate
function, so it's folded into peek_token.

Mark, is
	#define CP_SAVED_TOKEN_STACK 5
the maximum depth of that stack, or merely a good default?

This gives about .3% speedup.

booted & tested on i686-pc-linux-gnu.

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: parser.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041020/47fb8ee9/attachment.ksh>


More information about the Gcc-patches mailing list