This is an archive of the discontinued LLVM Phabricator instance.

[AST] Add NestedNameSpecifierLoc accessors to node introspection
ClosedPublic

Authored by steveire on Apr 17 2021, 3:31 PM.

Details

Summary

Change the GetLocations API to take instances by const-ref. This class
is copyable. APIs return copies, so the API taking a pointer was
needlessly hard to use.

Diff Detail

Event Timeline

steveire created this revision.Apr 17 2021, 3:31 PM
steveire requested review of this revision.Apr 17 2021, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2021, 3:31 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
njames93 added inline comments.Apr 18 2021, 2:15 AM
clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
59

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

RefClades = { "TypeLoc", "NestedNameSpecifierLoc" }
...
InstanceDecoration = '&' if CladeName in RefClades else '*'
clang/unittests/Introspection/IntrospectionTest.cpp
379–393
steveire added inline comments.Apr 18 2021, 10:42 AM
clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
59
njames93 added inline comments.Apr 18 2021, 12:14 PM
clang/unittests/Introspection/IntrospectionTest.cpp
292

I'm not entirely sure on the case, but the windows bot is giving a C2026 error here. Not entirely sure why as there is no string over the max length allowed.

steveire added inline comments.Apr 18 2021, 3:19 PM
clang/unittests/Introspection/IntrospectionTest.cpp
292

After https://reviews.llvm.org/D100720 is in, I'll push an update to fix this.

steveire added inline comments.Apr 19 2021, 1:26 PM
clang/unittests/Introspection/IntrospectionTest.cpp
292

My guess is that googletest converts the macro to a string which is too long.

njames93 accepted this revision.Apr 21 2021, 10:43 PM
This revision is now accepted and ready to land.Apr 21 2021, 10:43 PM