[PATCH] D63874: [clangd] No need to setTraversalScope in SemanticHighlighting.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 27 05:05:04 PDT 2019
hokein created this revision.
hokein added a reviewer: jvikstrom.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
We have already set it when the AST is being built, and setting TraversalScope
is not free (it will clear the cache, which is expensive to build).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D63874
Files:
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
Index: clang-tools-extra/clangd/SemanticHighlighting.h
===================================================================
--- clang-tools-extra/clangd/SemanticHighlighting.h
+++ clang-tools-extra/clangd/SemanticHighlighting.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICHIGHLIGHT_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICHIGHLIGHT_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICHIGHLIGHTING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SEMANTICHIGHLIGHTING_H
#include "ClangdUnit.h"
Index: clang-tools-extra/clangd/SemanticHighlighting.cpp
===================================================================
--- clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -1,4 +1,4 @@
-//===--- SemanticHighlighting.cpp - -------------------------- ---*- C++ -*-===//
+//===--- SemanticHighlighting.cpp - ------------------------- ---*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -70,7 +70,6 @@
}
std::vector<HighlightingToken> getSemanticHighlightings(ParsedAST &AST) {
- AST.getASTContext().setTraversalScope(AST.getLocalTopLevelDecls());
return HighlightingTokenCollector(AST).collectTokens();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63874.206834.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190627/24621f2d/attachment.bin>
More information about the cfe-commits
mailing list