[PATCH] D82875: Added tests for RecursiveASTVisitor for AST nodes that are special cased

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 07:01:00 PDT 2020


gribozavr created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
gribozavr2 added reviewers: ymandel, eduucaldas.
gribozavr2 marked an inline comment as done.
gribozavr2 added inline comments.


================
Comment at: clang/unittests/Tooling/RecursiveASTVisitorTests/Callbacks.cpp:398
 
-TEST(RecursiveASTVisitor, StmtCallbacks_TraverseBinaryOperator) {
+TEST(RecursiveASTVisitor, StmtCallbacks_TraverseUnaryOperator) {
   class RecordingVisitor : public RecordingVisitorBase<RecordingVisitor> {
----------------
Phabricator shows the diff as a modification, but it is actually an addition -- new tests are just very similar to existing tests for binary operators, so the diff algorithm is confused. You can find old tests for binary operators below, shown as code being added.


RecursiveASTVisitor has special code for handling operator AST nodes,
specifically, unary, binary, and compound assignment operators. In this
change I'm adding tests for operator AST nodes that follow the existing
pattern of tests for the CallExpr node (an AST node that triggers the
common code path).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82875

Files:
  clang/unittests/Tooling/RecursiveASTVisitorTests/Callbacks.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82875.274455.patch
Type: text/x-patch
Size: 38667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200630/6ed8e776/attachment-0001.bin>


More information about the cfe-commits mailing list