diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-11 17:41:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-11 17:41:54 +0000 |
commit | 3ab50fe3fc8311fb68c4f5eb97e9bb3d0041bf1a (patch) | |
tree | 7ca68fb742508c859da0e4714b7d3f142f433f22 /include/clang | |
parent | e9652bf15246d6e08e953b52cdb7812ddb8a43e0 (diff) |
Introduce a simple "hint" scheme to eliminate the quadratic behavior
associated with deserializing macro history for an identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 3 | ||||
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 2c0814c910..7888a26fcb 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -519,7 +519,8 @@ public: /// \brief Specify a macro for this identifier. void setMacroInfo(IdentifierInfo *II, MacroInfo *MI); /// \brief Add a MacroInfo that was loaded from an AST file. - void addLoadedMacroInfo(IdentifierInfo *II, MacroInfo *MI); + void addLoadedMacroInfo(IdentifierInfo *II, MacroInfo *MI, + MacroInfo *Hint = 0); /// \brief Make the given MacroInfo, that was loaded from an AST file and /// previously hidden, visible. void makeLoadedMacroInfoVisible(IdentifierInfo *II, MacroInfo *MI); diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 2a9afc92e9..4e8531a820 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -1433,7 +1433,7 @@ public: unsigned LocalID); /// \brief Retrieve the macro with the given ID. - MacroInfo *getMacro(serialization::MacroID ID); + MacroInfo *getMacro(serialization::MacroID ID, MacroInfo *Hint = 0); /// \brief Retrieve the global macro ID corresponding to the given local /// ID within the given module file. @@ -1582,7 +1582,7 @@ public: Expr *ReadSubExpr(); /// \brief Reads the macro record located at the given offset. - void ReadMacroRecord(ModuleFile &F, uint64_t Offset); + void ReadMacroRecord(ModuleFile &F, uint64_t Offset, MacroInfo *Hint = 0); /// \brief Determine the global preprocessed entity ID that corresponds to /// the given local ID within the given module. |