[PATCH] D52727: [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy
Balogh, Ádám via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 9 06:14:01 PDT 2018
baloghadamsoftware marked 2 inline comments as done.
baloghadamsoftware added inline comments.
================
Comment at: clang-tidy/performance/UnnecessaryCopyInitialization.cpp:65-66
has(varDecl(hasLocalStorage(),
- hasType(matchers::isExpensiveToCopy()),
+ hasType(hasCanonicalType(
+ allOf(matchers::isExpensiveToCopy(),
+ unless(hasDeclaration(namedDecl(
----------------
JonasToth wrote:
> lebedev.ri wrote:
> > Does it matter whether we are calling `matchers::isExpensiveToCopy()` on the type, or on the canonical type?
> the canonical type does resolve all typedefs, which is what is desirable in this case.
The real question is whether we want to match the canonical type to the list of allowed type names. I am not sure.
https://reviews.llvm.org/D52727
More information about the cfe-commits
mailing list