[PATCH] D52315: [clang-tidy] Fix for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

Felix Berger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 10:41:42 PDT 2018


flx added inline comments.


================
Comment at: clang-tidy/utils/TypeTraits.cpp:49
+  if (Context.getTypeSize(Type) <= Context.getTypeSize(Context.VoidPtrTy))
+    return false;
+
----------------
This early return now ignores the fact that the type has non-trivial copy constructors, virtual destructors etc which makes the type expensive to copy. Could we achieve the same desired outcome by adding a blacklist that allows users exclude types they deem to be not expensive?

This way they would get a warning the first time they run the check and then could disable such types. 


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52315





More information about the cfe-commits mailing list