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

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 09:21:32 PDT 2020


eduucaldas added a reviewer: gribozavr2.
eduucaldas added inline comments.


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:227-254
+namespace llvm {
+template <> struct DenseMapInfo<clang::NestedNameSpecifierLoc> {
+  using FirstInfo = DenseMapInfo<clang::NestedNameSpecifier *>;
+  using SecondInfo = DenseMapInfo<void *>;
+
+  static inline NestedNameSpecifierLoc getEmptyKey() {
+    return NestedNameSpecifierLoc(FirstInfo::getEmptyKey(),
----------------
Inpired on the definition of: 
* `template<typename T> struct DenseMapInfo<T*>`
* `template<typename T, typename U> struct DenseMapInfo<std::pair<T,U>>`

Please tell me if this is all silly.


================
Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:1235
     | | | | |   |-(
-    | | | | |   |-IdExpression
-    | | | | |   | `-UnqualifiedId
-    | | | | |   |   `-s
+    | | | | |   |-s
     | | | | |   `-)
----------------
standard `TraverseNestedNameSpecifierLoc` fired `TraverseTypeLoc`, once we override it we lost this. This will be fixed when refining the Node for `DecltypeSpecifier`


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