diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-07 23:11:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-07 23:11:54 +0000 |
commit | b8db7cd9ac05c522855631670ec2e97255384f5a (patch) | |
tree | 219ea0bfbdfdca93fcff2d45221abc0ffb660eac /include/clang/Basic/IdentifierTable.h | |
parent | 0e2ca014bdf92b405f7c02f2d37532f4c9b9b663 (diff) | |
download | clang-b8db7cd9ac05c522855631670ec2e97255384f5a.tar.gz clang-b8db7cd9ac05c522855631670ec2e97255384f5a.tar.bz2 clang-b8db7cd9ac05c522855631670ec2e97255384f5a.tar.xz |
Optimize the preprocessor's handling of the __import_module__
keyword. We now handle this keyword in HandleIdentifier, making a note
for ourselves when we've seen the __import_module__ keyword so that
the next lexed token can trigger a module import (if needed). This
greatly simplifies Preprocessor::Lex(), and completely erases the 5.5%
-Eonly slowdown Argiris noted when I originally implemented
__import_module__. Big thanks to Argiris for noting that horrible
regression!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index bd0b539d20..97cd68ee55 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -252,7 +252,7 @@ private: void RecomputeNeedsHandleIdentifier() { NeedsHandleIdentifier = (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() | - isExtensionToken()); + isExtensionToken() || (getTokenID() == tok::kw___import_module__)); } }; |