diff options
author | Don Hinton <hintonda@gmail.com> | 2019-04-24 21:25:57 +0000 |
---|---|---|
committer | Don Hinton <hintonda@gmail.com> | 2019-04-24 21:25:57 +0000 |
commit | 28413dd87aa21c72ab4d3e3f686647999eb59903 (patch) | |
tree | fd1bf161a117977083606ab6324221f43fc7aba7 /lldb/packages/Python/lldbsuite/test | |
parent | c95c08baa1afb3b654bd756edfaac1c0a063fed9 (diff) | |
download | bcm5719-llvm-28413dd87aa21c72ab4d3e3f686647999eb59903.tar.gz bcm5719-llvm-28413dd87aa21c72ab4d3e3f686647999eb59903.zip |
[clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals
Summary:
Looks at conditionals and finds cases of ``cast<>``, which will
assert rather than return a null pointer, and ``dyn_cast<>`` where
the return value is not captured. Additionally, finds cases that
match the pattern ``var.foo() && isa<X>(var.foo())``, where the
method is called twice and could be expensive.
.. code-block:: c++
// Finds cases like these:
if (auto x = cast<X>(y)) <...>
if (cast<X>(y)) <...>
// But not cases like these:
if (auto f = cast<Z>(y)->foo()) <...>
if (cast<Z>(y)->foo()) <...>
Reviewers: alexfh, rjmccall, hokein, aaron.ballman, JonasToth
Reviewed By: aaron.ballman
Subscribers: xbolva00, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D59802
llvm-svn: 359142
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
0 files changed, 0 insertions, 0 deletions