From ab4c91c708ca0c7d80f513af74926271e25b2f56 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 25 Nov 2008 23:05:24 +0000 Subject: [PATCH] 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 --- lib/Parse/ParseDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.40.0