johannes created this revision.
This adds a special case for traversing CXXOperatorCallExpr. Its
children are traversed in the order in which they appear in the source
code, so infix and postfix operators are visited after their first
argument.
This behavior was previously only in
LexicallyOrdere
klimek added inline comments.
Comment at: include/clang/AST/RecursiveASTVisitor.h:334
+case OO_Arrow:
+case OO_Call:
+case OO_Subscript:
Why do we need to swap for calls?
https://reviews.llvm.org/D37663
___
johannes added inline comments.
Comment at: include/clang/AST/RecursiveASTVisitor.h:334
+case OO_Arrow:
+case OO_Call:
+case OO_Subscript:
klimek wrote:
> Why do we need to swap for calls?
The idea is that the opening parenthesis/bracket comes after
rsmith added inline comments.
Comment at: include/clang/AST/RecursiveASTVisitor.h:327
+
+ SmallVector getStmtChildren(CXXOperatorCallExpr *CE) {
+SmallVector Children(CE->children());
The copy here is more expensive than I'd like. Instead of returning a list
johannes updated this revision to Diff 115018.
johannes added a comment.
use CXXOperatorCallExpr::isPrefixOp() to determine whether it's infix or postfix
directly traverse statement children instead of copying
https://reviews.llvm.org/D37663
Files:
include/clang/AST/ExprCXX.h
include/clang/
johannes added inline comments.
Comment at: include/clang/AST/RecursiveASTVisitor.h:327
+
+ SmallVector getStmtChildren(CXXOperatorCallExpr *CE) {
+SmallVector Children(CE->children());
rsmith wrote:
> The copy here is more expensive than I'd like. Instead o