summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-09-18 08:52:14 +0000
committerEric Liu <ioeric@google.com>2018-09-18 08:52:14 +0000
commitf736766659e85030a72a08cfc4aab743bf3a5599 (patch)
tree5d94f6f24e58fedc6ab818e0fa27fe5233be5887
parent4d22172b3a24a1991d6356762ec71d6e3097a49c (diff)
downloadbcm5719-llvm-f736766659e85030a72a08cfc4aab743bf3a5599.tar.gz
bcm5719-llvm-f736766659e85030a72a08cfc4aab743bf3a5599.zip
[clangd] Adapt API change after 342451.
llvm-svn: 342452
-rw-r--r--clang-tools-extra/clangd/FindSymbols.cpp5
-rw-r--r--clang-tools-extra/clangd/XRefs.cpp8
-rw-r--r--clang-tools-extra/clangd/index/FileIndex.cpp2
3 files changed, 8 insertions, 7 deletions
diff --git a/clang-tools-extra/clangd/FindSymbols.cpp b/clang-tools-extra/clangd/FindSymbols.cpp
index 054e63d9358..0b000121e15 100644
--- a/clang-tools-extra/clangd/FindSymbols.cpp
+++ b/clang-tools-extra/clangd/FindSymbols.cpp
@@ -270,8 +270,9 @@ getDocumentSymbols(ParsedAST &AST) {
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 33181576a3b..da98d88f713 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -206,8 +206,8 @@ IdentifiedSymbol getSymbolAtPosition(ParsedAST &AST, SourceLocation Pos) {
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 @@ findRefs(const std::vector<const Decl *> &Decls, ParsedAST &AST) {
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 20bfb871fb2..6b546747a2f 100644
--- a/clang-tools-extra/clangd/index/FileIndex.cpp
+++ b/clang-tools-extra/clangd/index/FileIndex.cpp
@@ -54,7 +54,7 @@ indexAST(ASTContext &AST, std::shared_ptr<Preprocessor> PP,
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());
OpenPOWER on IntegriCloud