From: Daniel Dunbar Date: Tue, 25 Nov 2008 23:05:24 +0000 (+0000) Subject: Only call TryAnnotateScopeToken when parsing C++. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab4c91c708ca0c7d80f513af74926271e25b2f56;p=clang Only call TryAnnotateScopeToken when parsing C++. - This improves -parse-noop of Carbon.h by +2%, and I believe compensates for the majority of the performance regression in r58913. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60063 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index d8894c66fa..278c80f72c 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -426,7 +426,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) { // Only annotate C++ scope. Allow class-name as an identifier in case // it's a constructor. - TryAnnotateScopeToken(); + if (getLang().CPlusPlus) + TryAnnotateScopeToken(); switch (Tok.getKind()) { default: