[clang-tools-extra] 9d3ea5a - [clangd] Initialize HighlightingsBuilder::Resolver (#74971)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 10 19:05:56 PST 2023
Author: Nathan Ridge
Date: 2023-12-10T22:05:51-05:00
New Revision: 9d3ea5a06abe08fa37053b825b3a1510d96bb7fb
URL: https://github.com/llvm/llvm-project/commit/9d3ea5a06abe08fa37053b825b3a1510d96bb7fb
DIFF: https://github.com/llvm/llvm-project/commit/9d3ea5a06abe08fa37053b825b3a1510d96bb7fb.diff
LOG: [clangd] Initialize HighlightingsBuilder::Resolver (#74971)
Added:
Modified:
clang-tools-extra/clangd/SemanticHighlighting.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp
index 49e479abf45621..37939d36425a97 100644
--- a/clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -418,7 +418,8 @@ class HighlightingsBuilder {
public:
HighlightingsBuilder(const ParsedAST &AST, const HighlightingFilter &Filter)
: TB(AST.getTokens()), SourceMgr(AST.getSourceManager()),
- LangOpts(AST.getLangOpts()), Filter(Filter) {}
+ LangOpts(AST.getLangOpts()), Filter(Filter),
+ Resolver(AST.getHeuristicResolver()) {}
HighlightingToken &addToken(SourceLocation Loc, HighlightingKind Kind) {
auto Range = getRangeForSourceLocation(Loc);
@@ -589,7 +590,7 @@ class HighlightingsBuilder {
HighlightingFilter Filter;
std::vector<HighlightingToken> Tokens;
std::map<Range, llvm::SmallVector<HighlightingModifier, 1>> ExtraModifiers;
- const HeuristicResolver *Resolver = nullptr;
+ const HeuristicResolver *Resolver;
// returned from addToken(InvalidLoc)
HighlightingToken InvalidHighlightingToken;
};
More information about the cfe-commits
mailing list