This is an archive of the discontinued LLVM Phabricator instance.

[clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.
ClosedPublic

Authored by ymandel on Aug 8 2019, 5:47 AM.

Details

Summary

The ExprWithCleanups node is added to the AST along with the elidable
CXXConstructExpr. If it is the outermost node of the node being matched, ignore
it as well.

Diff Detail

Repository
rL LLVM

Event Timeline

ymandel created this revision.Aug 8 2019, 5:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 5:47 AM
gribozavr accepted this revision.Aug 8 2019, 6:24 AM
gribozavr added inline comments.
clang/include/clang/ASTMatchers/ASTMatchers.h
6538 ↗(On Diff #214123)

while you're editing it: "elidable copy constructors"

6540 ↗(On Diff #214123)

"elide these differences" => "abstract over these differences"?

6541 ↗(On Diff #214123)

"This matcher skips elidable constructor call AST nodes, ... "?

6556 ↗(On Diff #214123)

Could you add this matcher as a test?

This revision is now accepted and ready to land.Aug 8 2019, 6:24 AM
ymandel updated this revision to Diff 214159.Aug 8 2019, 8:14 AM
ymandel marked an inline comment as done.

Added test; adjusted comments.

ymandel marked 4 inline comments as done.Aug 8 2019, 8:16 AM

Thanks for the comments. I struggled with the wording so your edits are appreciated.

clang/include/clang/ASTMatchers/ASTMatchers.h
6556 ↗(On Diff #214123)

Done

Also, I noticed that the matcher is classified as "Traversal" yet its tests are in ASTMatchersNarrowingTest.cpp. Any objection to my moving the tests to ASTMatchersTraversalTest.cpp as a followup patch?

gribozavr accepted this revision.Aug 8 2019, 8:49 AM
gribozavr added inline comments.
clang/include/clang/ASTMatchers/ASTMatchers.h
6556 ↗(On Diff #214123)

That would make a lot of sense, thank you!

ymandel updated this revision to Diff 214188.Aug 8 2019, 10:39 AM
ymandel marked an inline comment as done.

updated HTML docs.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 10:41 AM