[clangd] Adapt API change after 342451.
llvm-svn: 342452
diff --git a/clang-tools-extra/clangd/FindSymbols.cpp b/clang-tools-extra/clangd/FindSymbols.cpp
index 054e63d..0b00012 100644
--- a/clang-tools-extra/clangd/FindSymbols.cpp
+++ b/clang-tools-extra/clangd/FindSymbols.cpp
@@ -270,8 +270,9 @@
IndexOpts.SystemSymbolFilter =
index::IndexingOptions::SystemSymbolFilterKind::DeclarationsOnly;
IndexOpts.IndexFunctionLocals = false;
- indexTopLevelDecls(AST.getASTContext(), AST.getLocalTopLevelDecls(),
- DocumentSymbolsCons, IndexOpts);
+ indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(),
+ AST.getLocalTopLevelDecls(), DocumentSymbolsCons,
+ IndexOpts);
return DocumentSymbolsCons.takeSymbols();
}
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index 3318157..da98d88 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -206,8 +206,8 @@
IndexOpts.SystemSymbolFilter =
index::IndexingOptions::SystemSymbolFilterKind::All;
IndexOpts.IndexFunctionLocals = true;
- indexTopLevelDecls(AST.getASTContext(), AST.getLocalTopLevelDecls(),
- DeclMacrosFinder, IndexOpts);
+ indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(),
+ AST.getLocalTopLevelDecls(), DeclMacrosFinder, IndexOpts);
return {DeclMacrosFinder.getFoundDecls(), DeclMacrosFinder.takeMacroInfos()};
}
@@ -414,8 +414,8 @@
IndexOpts.SystemSymbolFilter =
index::IndexingOptions::SystemSymbolFilterKind::All;
IndexOpts.IndexFunctionLocals = true;
- indexTopLevelDecls(AST.getASTContext(), AST.getLocalTopLevelDecls(),
- RefFinder, IndexOpts);
+ indexTopLevelDecls(AST.getASTContext(), AST.getPreprocessor(),
+ AST.getLocalTopLevelDecls(), RefFinder, IndexOpts);
return std::move(RefFinder).take();
}
diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp
index 20bfb87..6b54674 100644
--- a/clang-tools-extra/clangd/index/FileIndex.cpp
+++ b/clang-tools-extra/clangd/index/FileIndex.cpp
@@ -54,7 +54,7 @@
SymbolCollector Collector(std::move(CollectorOpts));
Collector.setPreprocessor(PP);
- index::indexTopLevelDecls(AST, DeclsToIndex, Collector, IndexOpts);
+ index::indexTopLevelDecls(AST, *PP, DeclsToIndex, Collector, IndexOpts);
const auto &SM = AST.getSourceManager();
const auto *MainFileEntry = SM.getFileEntryForID(SM.getMainFileID());