[cfe-commits] r66011 - in /cfe/trunk: Driver/PrintParserCallbacks.cpp
sebastian.redl at getdesigned.at
Wed Mar 4 05:29:49 PST 2009
On Wed, 04 Mar 2009 04:23:07 -0000, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Tue Mar 3 22:23:07 2009
> New Revision: 66011
> URL: http://llvm.org/viewvc/llvm-project?rev=66011&view=rev
> Change Parser::ParseCaseStatement to use an iterative approach to parsing
> multiple sequential case statements instead of doing it with recursion.
> fixes a problem where we run out of stack space parsing 100K directly
> Sebastian, I would appreciate it if you could scrutinize the smart
> gymnastics I do.
Looks all right. One detail below, as well as a typo.
> + // Parsing this naively works, but is both inefficient and can cause
> to run
> + // out of stack space in our recursive descent parser. As a special
> + // flatten this recursion into an interative loop. This is complex
> - return Actions.ActOnCaseStmt(CaseLoc, move(LHS), DotDotDotLoc,
> - move(RHS), ColonLoc, move(SubStmt));
> + // Return the top level parsed statement tree.
> + return OwningStmtResult(Actions, TopLevelCase.release());
More information about the cfe-commits