[PATCH] D94259: [clangd] Fix type printing in the presence of qualifiers

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 8 05:07:32 PST 2021


kadircet added inline comments.


================
Comment at: clang/include/clang/AST/PrettyPrinter.h:49
+  /// To do this, isNamespaceVisible should return true on "foo" NamespaceDecl.
+  virtual bool isNamespaceVisible(const NamespaceDecl *NS) const {
+    return false;
----------------
oh wow, i didn't know about these callbacks at all.

this looks pretty need, but i wonder if we should make it more generic like "shouldPrintScope" (or isScopeVisible) and pass not only namespacedecls but the declcontext directly to enable short circuiting of type scopes as well?

also it might be nice to note in comments that any parent scope won't be visited once this callback returns true (or false in the case of shouldPrintScope).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94259/new/

https://reviews.llvm.org/D94259



More information about the cfe-commits mailing list