]> granicus.if.org Git - clang/commitdiff
Only call TryAnnotateScopeToken when parsing C++.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 25 Nov 2008 23:05:24 +0000 (23:05 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 25 Nov 2008 23:05:24 +0000 (23:05 +0000)
 - 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

index d8894c66fa9d5427d16eb205c4d8407ad7fed8da..278c80f72c32a7f6f9661d25f599a175e47f8f42 100644 (file)
@@ -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: