[PATCH] D37004: [clang-diff] Fix the html output for CXXOperatorCallExpr

Johannes Altmanninger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 25 08:39:24 PDT 2017

johannes added inline comments.

Comment at: tools/clang-diff/ClangDiff.cpp:319
+           "A Binary operator is supposed to have two arguments.");
+    for (int I : {1, 0, 2})
+      Offset = printHtmlForNode(OS, Diff, Tree, IsLeft, Children[I], Offset);
arphaman wrote:
> Please add a short comment that describes why this out-of-order traversal is required
Should we do this in LexicallyOrderedRecursiveASTVisitor?

There are some other cases with CXXOperatorCallExpr where the order needs to be changed, e.g. postfix operators, operator->, operator() and operator[].
It can be done by sorting by SourceLocation of the first two elements, as the operator is always the first one.


More information about the cfe-commits mailing list