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 d8894c6..278c80f 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -426,7 +426,8 @@
// 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: