[PATCH] D94130: [ASTMatchers] Add support for CXXRewrittenBinaryOperator

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 06:47:35 PST 2021


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2000
+                                                   CXXRewrittenBinaryOperator>
+    cxxRewrittenBinaryOperator;
+
----------------
Missing changes to Registry.cpp to expose this to clang-query?


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5346
+    AST_POLYMORPHIC_SUPPORTED_TYPES(BinaryOperator, CXXOperatorCallExpr,
+                                    CXXRewrittenBinaryOperator)) {
   return Node.isAssignmentOp();
----------------
This change surprises me -- aren't rewritten binary operators *always* comparison operations? I don't know of a time when they'd ever be an assignment operator.


================
Comment at: clang/lib/ASTMatchers/ASTMatchFinder.cpp:260
+
+    auto DCF = Node->getDecomposedForm();
+    if (!match(*DCF.LHS) || !match(*DCF.RHS))
----------------
Please spell out this use of `auto`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94130



More information about the cfe-commits mailing list