This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Add hasPlacementArg and hasAnyPlacementArg traversal matcher for CXXNewExpr
ClosedPublic

Authored by njames93 on Jan 28 2020, 9:46 AM.

Details

Summary

Adds new traversal matchers called hasPlacementArg and hasAnyPlacementArg that matches on arguments to placement new operators.

Diff Detail

Event Timeline

njames93 created this revision.Jan 28 2020, 9:46 AM

Unit tests: fail. 62272 tests passed, 1 failed and 827 were skipped.

failed: Clang.CodeGenOpenCL/amdgpu-features.cl

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

aaron.ballman added inline comments.Jan 28 2020, 1:09 PM
clang/include/clang/ASTMatchers/ASTMatchers.h
6794

I think a better design would be something like hasPlacementExpr() as a traversal matcher. Then isPlacement() can be trivially done in the project as hasPlacementExpr(anything()) (we could still consider adding it as a dedicated matcher, but it doesn't seem critical to me), but this would also allow people to check for specific placement new argument expressions.

njames93 updated this revision to Diff 241012.Jan 28 2020, 3:15 PM
  • Changed isPlacement to hasPlacementArg and hasAnyPlacementArg
njames93 retitled this revision from [ASTMatchers] Add isPlacement traversal matcher for CXXNewExpr to [ASTMatchers] Add hasPlacementArg and hasAnyPlacementArg traversal matcher for CXXNewExpr.Jan 28 2020, 3:18 PM
njames93 edited the summary of this revision. (Show Details)
njames93 marked an inline comment as done.

Unit tests: fail. 62276 tests passed, 1 failed and 827 were skipped.

failed: Clang.CodeGenOpenCL/amdgpu-features.cl

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision is now accepted and ready to land.Jan 29 2020, 5:02 AM
This revision was automatically updated to reflect the committed changes.