[PATCH] D107900: [clang-tidy] Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-26 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec updated this revision to Diff 368881. jmarrec added a comment. documentation updates Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107900/new/ https://reviews.llvm.org/D107900 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt cla

[PATCH] D107873: [clang-tidy] Add 'performance-const-parameter-value-or-ref' for checking const-qualified parameters

2021-08-26 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec added a comment. Imported some discussion from https://reviews.llvm.org/D107900#inline-1029358. Sorry it took that long Comment at: clang-tools-extra/clang-tidy/performance/ConstParameterValueOrRef.h:40 + static constexpr int DefaultSmallMaxSize = 16; + int SmallMax

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-13 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-pod-const-ref-to-value.rst:21 + + If set to `true`, this check will limit itself to the `builtinType()` types. Default is `false`. cjdb wrote: > jmarrec wrote: > > Quuxpl

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec updated this revision to Diff 365779. jmarrec added a comment. Forgot to run clang format on the changes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107900/new/ https://reviews.llvm.org/D107900 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt clang-tools-extra/clan

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec updated this revision to Diff 365778. jmarrec added a comment. Added a MaxSize option. defaults to 16. Also skip templates. like in D107873 Dealt with the `f(int &i)` case instead of `f(int& i)` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10

[PATCH] D107873: [WIP][clang-tidy] adds a const-qualified parameter check

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-const-parameter-value-or-ref.rst:90 +Passing a ``shared_ptr`` by reference-to-``const`` is also acceptable in certain +situaitons. As such, ``std::shared_ptr`` and ``boost::shared_pt

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-pod-const-ref-to-value.rst:21 + + If set to `true`, this check will limit itself to the `builtinType()` types. Default is `false`. Quuxplusone wrote: > D107873 is related

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-pod-const-ref-to-value.cpp:3-5 +int f1(const int &i); +// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: argument 'i' is a trivially copyable type and should not be passed by const-reference bu

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec updated this revision to Diff 365735. jmarrec added a comment. Added content to the `clang-tools-extra/docs/clang-tidy/checks/misc-pod-const-ref-to-value.rst` file CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107900/new/ https://reviews.llvm.org/D107900 Files: clang-tools-e

[PATCH] D107900: Add a new clang-tidy check for trivially copyable types passed by const reference

2021-08-11 Thread Julien Marrec via Phabricator via cfe-commits
jmarrec created this revision. jmarrec added a reviewer: steveire. Herald added a subscriber: mgorny. jmarrec requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D10790