From: Sam McCall Date: Tue, 4 Oct 2022 19:37:27 +0000 (+0200) Subject: [clangd] Don't print locations of anonymous tags X-Git-Tag: upstream/17.0.6~31615 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e212a4f838f17e2d37b1d572d8c1b49c50d7fe17;p=platform%2Fupstream%2Fllvm.git [clangd] Don't print locations of anonymous tags These are usually not interesting when clangd presents results in context, and the file paths are noisy. --- diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp index 31db4cf..a092b93 100644 --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -189,6 +189,9 @@ std::string printQualifiedName(const NamedDecl &ND) { // include them, but at query time it's hard to find all the inline // namespaces to query: the preamble doesn't have a dedicated list. Policy.SuppressUnwrittenScope = true; + // (unnamed struct), not (unnamed struct at /path/to/foo.cc:42:1). + // In clangd, context is usually available and paths are mostly noise. + Policy.AnonymousTagLocations = false; ND.printQualifiedName(OS, Policy); OS.flush(); assert(!StringRef(QName).startswith("::"));