This is an archive of the discontinued LLVM Phabricator instance.

Fix `isInfixBinaryOp` that returned true for postfix ++
Needs ReviewPublic

Authored by eduucaldas on Jul 1 2020, 1:34 AM.

Details

Reviewers
gribozavr2

Diff Detail

Event Timeline

eduucaldas created this revision.Jul 1 2020, 1:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 1:34 AM
eduucaldas marked 2 inline comments as done.
eduucaldas added inline comments.
clang/unittests/Tooling/CXXOperatorCallExprTest.cpp
2

This file is in the unittests/Tooling instead in the unittests/AST directory because I wanted to have access to the TestVisitor infrastructure. I know the solution is not optimal and I am looking for suggestions

30

Previous code do something else. Look at CallsVisitor in clang/unittests/Tooling/SourceCodeTest.cpp . I prefer this approach because

  • The whole logic is then inside the the test case
  • There is not a big addition to lines of code
eduucaldas updated this revision to Diff 274769.Jul 1 2020, 5:18 AM

better comment

eduucaldas updated this revision to Diff 275325.Jul 3 2020, 1:29 AM

Remove review formatting noise

gribozavr2 added inline comments.Jul 6 2020, 12:12 PM
clang/unittests/Tooling/CXXOperatorCallExprTest.cpp
2

Could you make a separate patch where you move TestVisitor.h under clang/include/clang/Testing? Then you can place this test into unittests/AST.

OTOH, since the test is not testing the visitation, WDYT about changing the test to use AST matchers instead? It would seem to lead to more straightforward tests: get the AST node, act on it. See clang/unittests/AST/MatchVerifier.h.

21

Please add a space before "{".

24

Please add a space before "{". (Throughout the patch.)