[PATCH] D85439: [SyntaxTree] Expand support for `NestedNameSpecifier`

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 04:12:18 PDT 2020


gribozavr2 accepted this revision.
gribozavr2 added inline comments.


================
Comment at: clang/include/clang/AST/NestedNameSpecifier.h:20
 #include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT//DenseMapInfo.h"
 #include "llvm/ADT/FoldingSet.h"
----------------



================
Comment at: clang/include/clang/AST/NestedNameSpecifier.h:534
+// Define DenseMapInfo so that DeclarationNames can be used as keys
+// in DenseMap and DenseSets.
+template <> struct DenseMapInfo<clang::NestedNameSpecifierLoc> {
----------------
I'd suggest to remove the comment because it repeats the API (this is the only reason to define a DenseMapInfo specialization).


================
Comment at: clang/include/clang/AST/NestedNameSpecifier.h:539
+
+  static inline clang::NestedNameSpecifierLoc getEmptyKey() {
+    return clang::NestedNameSpecifierLoc(FirstInfo::getEmptyKey(),
----------------
Inline is implied here.


================
Comment at: clang/include/clang/AST/NestedNameSpecifier.h:544
+
+  static inline clang::NestedNameSpecifierLoc getTombstoneKey() {
+    return clang::NestedNameSpecifierLoc(FirstInfo::getTombstoneKey(),
----------------
Inline is implied here.


================
Comment at: clang/include/clang/AST/NestedNameSpecifier.h:550
+  static unsigned getHashValue(const clang::NestedNameSpecifierLoc &PairVal) {
+    return detail::combineHashValue(
+        FirstInfo::getHashValue(PairVal.getNestedNameSpecifier()),
----------------
Please use hash_combine instead of this internal API (see an example in `include/clang/Sema/Sema.h`).


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:770
+  /// Given a nested-name-specifier return the range for the last name
+  /// specifier
   ///
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85439



More information about the cfe-commits mailing list