[cfe-commits] r60063 - /cfe/trunk/lib/Parse/ParseDecl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Wed Nov 26 14:55:08 PST 2008

Chris Lattner wrote:
> Argiris, is there any way to speed up TryAnnotateScopeToken in the 
> common case?

Well the common case is that the token cannot be the start of a C++ 
scope, and there are checks for this. I don't see how it can be sped up 

An optimization that may be of interest is adding another annotation 
token to indicate that an identifier is *not* a typename.
Currently, there's a Action.isTypeName check inside 
TryAnnotateTypeOrScopeToken and if the identifier is not a typename, 
there will be multiple checks for this.
E.g. there will be a TryAnnotateTypeOrScopeToken call from 
isDeclarationSpecifier and another one again by ParseCastExpression 
(when in C++); both calls will check Action.isTypeName.
The second check can be avoided if the first check annotates an 
identifier as a "non typename identifier".

What do you think ?


More information about the cfe-commits mailing list