[clang-tools-extra] Symbol tags in SymbolInformation, WorkspaceSymbol, CallHierarchyItem and TypeHierarchyItem (PR #170103)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 07:09:21 PDT 2026


================
@@ -153,6 +192,64 @@ bool isUniqueDefinition(const NamedDecl *Decl) {
          isa<TemplateTemplateParmDecl>(Decl) || isa<ObjCCategoryDecl>(Decl) ||
          isa<ObjCImplDecl>(Decl);
 }
+
+// Filter symbol tags based on the presence of other tags and the kind of
+// symbol. This is needed to avoid redundant tags, e.g. final implies override,
+// override implies virtual, etc.
+SymbolTags filterSymbolTags(const SymbolTags ST) {
+  SymbolTags Result = ST;
+
+  if (ST & toSymbolTagBitmask(SymbolTag::Overrides)) {
+    // Overrides means that ND overrides an existing implementation of a virtual
+    // method in a base class. If a symbol is marked as Overrides, the tags
+    // Virtual, Declaration and Definition should be removed, as the Overrides
----------------
timon-ul wrote:

Here and below you need to adjust your comments too! (Declaration & Definition are not removed anymore)

https://github.com/llvm/llvm-project/pull/170103


More information about the cfe-commits mailing list