[PATCH] D100423: [AST] Add a print method to Introspection LocationCall

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 14 15:54:36 PDT 2021


steveire requested changes to this revision.
steveire added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Tooling/NodeIntrospection.cpp:26
+    if (On->returnsPointer())
+      OS << "->";
+    else
----------------
The reason for the `LocationCallFormatterCpp` is that we can write a `LocationCallFormatterPython` for example which skips over casts (not needed) and always uses `.`, never `->`. I can add a unit test for that once we do chaining and casting for typelocs (coming soon).

We shouldn't encode c++-ness into the `LocationCall`. I think the only remaining change in this MR is the `ArrayRef` change, which I think you can just go ahead and commit in an NFC commit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100423



More information about the cfe-commits mailing list