This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] performance-unnecessary-copy-initialization: handle pointer containers.
Needs ReviewPublic

Authored by courbet on Nov 24 2021, 7:21 AM.

Details

Reviewers
flx
aaron.ballman
Summary

This includes modifying DeclRefExprUtils to handle more cases.

Diff Detail

Event Timeline

courbet created this revision.Nov 24 2021, 7:21 AM
courbet requested review of this revision.Nov 24 2021, 7:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2021, 7:21 AM
courbet updated this revision to Diff 389504.Nov 24 2021, 8:00 AM

Rebase on submitted unit tests so that we can see the changes better.

flx added a comment.Nov 24 2021, 8:17 AM

This looks great, but goes past my knowledge of the AST API :) While the existing and new test coverage provides good confidence, one other reviewer taking look would be good.

clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
112

Reuse Ctx here?

courbet updated this revision to Diff 389667.Nov 25 2021, 12:27 AM

Add more comments on the approach.

courbet updated this revision to Diff 389690.Nov 25 2021, 1:28 AM
courbet marked an inline comment as done.

address comment