Page MenuHomePhabricator

[clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.
ClosedPublic

Authored by hokein on Jun 14 2017, 8:28 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Jun 14 2017, 8:28 AM

It'll be good idea to run modernize-make-unique on LLVM/Clang/etc for llvm::make_unique.

hokein updated this revision to Diff 102833.Jun 16 2017, 8:56 AM

More improvements.

It'll be good idea to run modernize-make-unique on LLVM/Clang/etc for llvm::make_unique.

+1. See https://reviews.llvm.org/D34334, https://reviews.llvm.org/D34333. And found a few bugs in the check, will work on fixes on them.

alexfh edited edge metadata.Jun 26 2017, 5:26 AM

It'll be good idea to run modernize-make-unique on LLVM/Clang/etc for llvm::make_unique.

+1. See https://reviews.llvm.org/D34334, https://reviews.llvm.org/D34333. And found a few bugs in the check, will work on fixes on them.

Ping me once you're done fixing the bugs.

It'll be good idea to run modernize-make-unique on LLVM/Clang/etc for llvm::make_unique.

+1. See https://reviews.llvm.org/D34334, https://reviews.llvm.org/D34333. And found a few bugs in the check, will work on fixes on them.

Ping me once you're done fixing the bugs.

I have a fix patch under review: D34286, and the other will come afterwards.

I think it is fine to check in this patch before these two bugs are fixed.

Ping me once you're done fixing the bugs.

The bugs are fixed. The patch is ready for review ;)

alexfh requested changes to this revision.Jun 30 2017, 7:40 AM
alexfh added inline comments.
clang-tidy/modernize/MakeSmartPtrCheck.h
28 ↗(On Diff #102833)

s/makeSmartPtr/MakeSmartPtr/ here and below.

test/clang-tidy/modernize-make-shared-header.cpp
1 ↗(On Diff #102833)

Maybe just add "-I%S/Inputs/modernize-smart-ptr/" flag to the clang-tidy invocation?

This revision now requires changes to proceed.Jun 30 2017, 7:40 AM
hokein updated this revision to Diff 104922.Jun 30 2017, 1:31 PM
hokein edited edge metadata.
hokein marked 2 inline comments as done.

Rebase and address review comments.

hokein added inline comments.Jun 30 2017, 1:32 PM
test/clang-tidy/modernize-make-shared-header.cpp
1 ↗(On Diff #102833)

Good idea!

alexfh accepted this revision.Jul 4 2017, 6:57 AM

LG with a couple of nits.

test/clang-tidy/modernize-make-shared-header.cpp
9 ↗(On Diff #104922)

I'd put this on the previous line.

test/clang-tidy/modernize-make-unique-header.cpp
9 ↗(On Diff #104922)

I'd put this on the previous line.

This revision is now accepted and ready to land.Jul 4 2017, 6:57 AM
hokein updated this revision to Diff 105190.Jul 4 2017, 10:43 AM
hokein marked 2 inline comments as done.

Fix small nits.

This revision was automatically updated to reflect the committed changes.