HomePhabricator

[clang-tidy] New option for misc-throw-by-value-catch-by-reference

Authored by baloghadamsoftware on May 21 2019, 12:25 AM.

Description

[clang-tidy] New option for misc-throw-by-value-catch-by-reference

Catching trivial objects by value is not dangerous but may be
inefficient if they are too large. This patch adds an option
WarnOnLargeObject to the checker to also warn if such an object
is caught by value. An object is considered as "large" if its
size is greater than MaxSize which is another option. Default
value is the machine word of the architecture (size of the type
size_t).

Differential Revision: https://reviews.llvm.org/D61851

llvm-svn: 361225

Details