[PATCH] D100712: [AST] Add NestedNameSpecifierLoc accessors to node introspection

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 18 02:15:49 PDT 2021


njames93 added inline comments.


================
Comment at: clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py:57
         InstanceDecoration = "*"
-        if CladeName == "TypeLoc":
+        if CladeName == "TypeLoc" or CladeName == "NestedNameSpecifierLoc":
             InstanceDecoration = "&"
----------------
Are there more Clades that require const ref instead of pointer, it may be wise to create a set of these and re use that throughout
```lang=py
RefClades = { "TypeLoc", "NestedNameSpecifierLoc" }
...
InstanceDecoration = '&' if CladeName in RefClades else '*'
```


================
Comment at: clang/unittests/Introspection/IntrospectionTest.cpp:369-370
+  EXPECT_EQ(
       ExpectedLocations,
-      UnorderedElementsAre(
-          STRING_LOCATION_PAIR(NNS, getBeginLoc()),
-          STRING_LOCATION_PAIR(NNS, getEndLoc()),
-          STRING_LOCATION_PAIR(NNS, getLocalBeginLoc()),
-          STRING_LOCATION_PAIR(NNS, getLocalEndLoc()),
-          STRING_LOCATION_PAIR(
+      (std::vector<std::pair<std::string, SourceLocation>>{
+          STRING_LOCATION_STDPAIR(NNS, getBeginLoc()),
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100712



More information about the cfe-commits mailing list