diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-25 23:30:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-25 23:30:02 +0000 |
commit | 8c5a760b82e73ed90b560090772db97e2ae27b09 (patch) | |
tree | ef93a4503bf57c6f71ad8a6b8fe55a9532afefd8 /include/clang/Basic/IdentifierTable.h | |
parent | 71238f67c5df13eef19450d66b7a7ab28377192a (diff) |
Lazily load the controlling macros for all of the headers known in the
PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes
us from reading 503 identifiers down to 37 and from 470 macros down to
4. It also results in an 8% performance improvement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 235c19081c..083196a2c1 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -234,7 +234,20 @@ public: /// be found. virtual IdentifierInfo* get(const char *NameStart, const char *NameEnd) = 0; }; - + +/// \brief An abstract class used to resolve numerical identifier +/// references (meaningful only to some external source) into +/// IdentifierInfo pointers. +class ExternalIdentifierLookup { +public: + virtual ~ExternalIdentifierLookup(); + + /// \brief Return the identifier associated with the given ID number. + /// + /// The ID 0 is associated with the NULL identifier. + virtual IdentifierInfo *GetIdentifier(unsigned ID) = 0; +}; + /// IdentifierTable - This table implements an efficient mapping from strings to /// IdentifierInfo nodes. It has no other purpose, but this is an /// extremely performance-critical piece of the code, as each occurrance of |