There is currently no way to distinguish implicit from explicit CXXThisExpr in the AST dump output.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
I have no objection to this, but I wonder whether all state accessible from all nodes should be part of the AST dump. Where do you think the line is? Is there anything else missing currently from other nodes?
I think that this depends on the specific node. It seem that there should be a distinction between state that is "generally useful" (whatever that means) to the average clang developer/user and internal state which is there for a narrow specific purpose. For example (looking at the statement/expression hierarchy):
NullStmt has a flag HasLeadingEmptyMacro => probably not useful to expose.
SwitchStmt has a flag AllEnumCasesCovered which is used for diagnostics => probably not useful to expose.
Additionally some flags are there only to remember which trailing objects are there. I don't think that exposing these is useful (as long as the AST dump output is unambiguous).
Though it is a subjective distinction and in the end if someone need a flag it is going to be added I guess.
That's the crux of how we've decided what information to expose in the past. Some folks will expose the information when adding it to an AST node, but not always. More often what happens is that someone finds they need that information to help make an AST dump more readable, then the information gets exposed at that point because there's a use case for it.
Which is exactly why I added this flag. From what I understand the AST dump is mostly a tool used by people hacking on clang, and so this make sense.