Disable the preprocessing record when indexing a source file
and modules are not enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165593 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp
index d2b0ab3..887b5fc 100644
--- a/tools/libclang/Indexing.cpp
+++ b/tools/libclang/Indexing.cpp
@@ -398,6 +398,9 @@
PPOpts.DetailedRecord = true;
}
+ if (!requestedToGetTU && !CInvok->getLangOpts()->Modules)
+ PPOpts.DetailedRecord = false;
+
DiagnosticErrorTrap DiagTrap(*Diags);
bool Success = ASTUnit::LoadFromCompilerInvocationAction(CInvok.getPtr(), Diags,
IndexAction.get(),