summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-02 16:10:51 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-02 16:10:51 +0000
commitd4fcf580709443c73c4b15d9880eb0851dbb6ff1 (patch)
tree359b775e05bd465fbf48568acc20408152e0eaa5 /clang/lib/Serialization/ASTReader.cpp
parentf590e094addee7edb7c9605bd8c1f02ff72fda0c (diff)
downloadbcm5719-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/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp10
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);
OpenPOWER on IntegriCloud