[PATCH] D67825: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 20 05:03:19 PDT 2019
ilya-biryukov added inline comments.
================
Comment at: clang/include/clang/AST/Decl.h:313
+ /// Returns only qualifier from printQualifiedName, including the :: at the
+ /// end. E.g.
----------------
aaron.ballman wrote:
> This doesn't return anything, so I think a better way to phrase the comment is "Prints only the nested name specifier, including a trailing :: at the end. e.g., if printQualifiedName(D) prints "A::B::i", this function prints "A::B::".`
Good point, thanks!
================
Comment at: clang/include/clang/AST/Decl.h:317-318
+ /// this function returns "A::B::".
+ void printQualifier(raw_ostream &OS) const;
+ void printQualifier(raw_ostream &OS, const PrintingPolicy &Policy) const;
+
----------------
aaron.ballman wrote:
> I'm not keen on "qualifier" here because types have qualifiers. How about `printNestedNameSpecifier()`?
Now I understand why we clang uses 'nested name specifier' everywhere!
Renamed per your suggestions.
FWIW, I would rather use `NameQualifier` and `TypeQualifier` to disambiguate between the two.
`NestedNameSpecifier` is a bit too long for my taste. But happy to stick with the conventions in the codebase.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67825/new/
https://reviews.llvm.org/D67825
More information about the cfe-commits
mailing list