I changed markStmtChild to ignore implicit expressions the same way as
markExprChild does it already. The test that I modified crashes
without this change.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
---|---|---|
1048 | I thought this treatement of derived class should be done by RecursiveASTVisitor And we would've wanted the opposite order: |
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
---|---|---|
1048 | Unfortunately I don't see how to implement this behavior (cheaply) in the visitation methods of RecursiveASTVisitor. The crux of the issue is that we are inserting a syntax tree node (ExpressionStatement) that does not correspond to any semantic AST node. We want to do it for every Expr that appears in a Stmt position -- so we need to know the parent node, or in this case, more precisely, that this Expr node is in a Stmt position. |
I thought this treatement of derived class should be done by RecursiveASTVisitor
This is kinda the task of WalkUpFrom*, unfortunately WalkUpFromThis follows the order:
WalkUpFromBase;
VisitThis;
And we would've wanted the opposite order:
VisitThis
WalkUpFromBase