[libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.
llvm-svn: 165023
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp
index f6314b9..8c19aeb 100644
--- a/clang/tools/libclang/Indexing.cpp
+++ b/clang/tools/libclang/Indexing.cpp
@@ -455,21 +455,10 @@
if (!PP.getPreprocessingRecord())
return;
- PreprocessingRecord &PPRec = *PP.getPreprocessingRecord();
-
// FIXME: Only deserialize inclusion directives.
- // FIXME: Only deserialize stuff from the last chained PCH, not the PCH/Module
- // that it depends on.
- bool OnlyLocal = !Unit.isMainFileAST() && Unit.getOnlyLocalDecls();
PreprocessingRecord::iterator I, E;
- if (OnlyLocal) {
- I = PPRec.local_begin();
- E = PPRec.local_end();
- } else {
- I = PPRec.begin();
- E = PPRec.end();
- }
+ llvm::tie(I, E) = Unit.getLocalPreprocessingEntities();
for (; I != E; ++I) {
PreprocessedEntity *PPE = *I;