diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-02 16:10:51 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-02 16:10:51 +0000 |
| commit | d4fcf580709443c73c4b15d9880eb0851dbb6ff1 (patch) | |
| tree | 359b775e05bd465fbf48568acc20408152e0eaa5 /clang/lib/Serialization | |
| parent | f590e094addee7edb7c9605bd8c1f02ff72fda0c (diff) | |
| download | bcm5719-llvm-d4fcf580709443c73c4b15d9880eb0851dbb6ff1.tar.gz bcm5719-llvm-d4fcf580709443c73c4b15d9880eb0851dbb6ff1.zip | |
[libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.
llvm-svn: 165023
Diffstat (limited to 'clang/lib/Serialization')
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index b5e579566af..6bf6f94fbba 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -3381,6 +3381,16 @@ ASTReader::getModulePreprocessedEntity(unsigned GlobalIndex) { return std::make_pair(M, LocalIndex); } +std::pair<PreprocessingRecord::iterator, PreprocessingRecord::iterator> +ASTReader::getModulePreprocessedEntities(ModuleFile &Mod) const { + if (PreprocessingRecord *PPRec = PP.getPreprocessingRecord()) + return PPRec->getIteratorsForLoadedRange(Mod.BasePreprocessedEntityID, + Mod.NumPreprocessedEntities); + + return std::make_pair(PreprocessingRecord::iterator(), + PreprocessingRecord::iterator()); +} + PreprocessedEntity *ASTReader::ReadPreprocessedEntity(unsigned Index) { PreprocessedEntityID PPID = Index+1; std::pair<ModuleFile *, unsigned> PPInfo = getModulePreprocessedEntity(Index); |

