diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-15 01:51:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-15 01:51:03 +0000 |
commit | 23f77e59718385512984d4e2a021bef52b9f6ddf (patch) | |
tree | 89efca14655a462a16c1c4dc8d9b082dc36ba901 /include/clang/Lex/Preprocessor.h | |
parent | c768a0c46e6c064c3281d663777ee95aea8652ee (diff) |
set up the machinery for a MacroArgs cache hanging off Preprocessor.
We creating and free thousands of MacroArgs objects (and the related
std::vectors hanging off them) for the testcase in PR5610 even though
there are only ~20 live at a time. This doesn't actually use the
cache yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 4e3651befe..7c838ff862 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -139,7 +139,7 @@ class Preprocessor { /// CurPPLexer - This is the current top of the stack what we're lexing from /// if not expanding a macro. This is an alias for either CurLexer or /// CurPTHLexer. - PreprocessorLexer* CurPPLexer; + PreprocessorLexer *CurPPLexer; /// CurLookup - The DirectoryLookup structure used to find the current /// FileEntry, if CurLexer is non-null and if applicable. This allows us to @@ -176,8 +176,14 @@ class Preprocessor { llvm::DenseMap<IdentifierInfo*, MacroInfo*> Macros; /// MICache - A "freelist" of MacroInfo objects that can be reused for quick - /// allocation. + /// allocation. + /// FIXME: why not use a singly linked list? std::vector<MacroInfo*> MICache; + + /// MacroArgCache - This is a "freelist" of MacroArg objects that can be + /// reused for quick allocation. + MacroArgs *MacroArgCache; + friend class MacroArgs; // Various statistics we track for performance analysis. unsigned NumDirectives, NumIncluded, NumDefined, NumUndefined, NumPragma; |