]> granicus.if.org Git - clang/commitdiff
Moving tagging of '__experimental_modules_import' IdentifierInfo out of
authorTed Kremenek <kremenek@apple.com>
Thu, 1 Mar 2012 22:53:32 +0000 (22:53 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 1 Mar 2012 22:53:32 +0000 (22:53 +0000)
IndentifierTable::get() and into IdentifierTable's constructor.

This gets a 0.7% reducing on lexing time for Cocoa.h, and
about the same for PCH generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151854 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/IdentifierTable.h
lib/Basic/IdentifierTable.cpp

index fce79aa652cab33ce4c95f9f3c06ed59a1bbb32d..cc0080b8779d318f209d54e8076082a09e0e247b 100644 (file)
@@ -460,11 +460,6 @@ public:
     // contents.
     II->Entry = &Entry;
 
-    // If this is the '__experimental_modules_import' contextual keyword,
-    // mark it as such.
-    if (Name.equals("__experimental_modules_import"))
-      II->setModulesImport(true);
-
     return *II;
   }
 
index 8945c2f47ca41c9efaf22b90e6e0300fdcd4dc03..7df52c65676a065611c9185df941ae185a6c47dd 100644 (file)
@@ -78,6 +78,10 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts,
   // Populate the identifier table with info about keywords for the current
   // language.
   AddKeywords(LangOpts);
+      
+
+  // Add the '_experimental_modules_import' contextual keyword.
+  get("__experimental_modules_import").setModulesImport(true);
 }
 
 //===----------------------------------------------------------------------===//