hokein added inline comments.

================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:803
 
+  bool TraverseIfStmt(IfStmt *S) {
+    bool Result = [&, this]() {
----------------
sammccall wrote:
> is it clear to you what all this code is doing?
> It does seem to fit the pattern used elsewhere, it just looks pretty 
> different than the RAVs I've seen in the pass (e.g. overriding WalkUp 
> functions).
> 
> It seems correct, but I think I'll need to study later.
this is also my first time to see the pattern of overriding WalkUp function 
etc. 

The purpose of overriding the `TraverseIfStmt` is that the default 
implementation (which traverses the implicit condition expression which has the 
same location of the condition variable decl) seems to violate the invariant of 
foldNode (`fold should not crosses boundaries of existing subtrees`).

I think the `TraverseCXXForRangeStmt` below follows the same patten :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95782

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to