[index/build] Upstream indexing while building changes

This patch upstreams previously AppleInternal changes for
indexing while building.
This commit is contained in:
David Farler
2017-06-29 16:20:06 -07:00
parent b40c0bd3db
commit 645aaad551
41 changed files with 1634 additions and 4 deletions

View File

@@ -97,6 +97,12 @@ bool CompilerInstance::setup(const CompilerInvocation &Invok) {
if (!Invocation.getFrontendOptions().ModuleDocOutputPath.empty())
Invocation.getLangOptions().AttachCommentsToDecls = true;
// If we are doing index-while-building, configure lexing and parsing to
// remember comments.
if (!Invocation.getFrontendOptions().IndexStorePath.empty()) {
Invocation.getLangOptions().AttachCommentsToDecls = true;
}
Context.reset(new ASTContext(Invocation.getLangOptions(),
Invocation.getSearchPathOptions(),
SourceMgr, Diagnostics));