mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-27 07:19:03 -04:00

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
20 lines
351 B
CMake
20 lines
351 B
CMake
set(LLVM_LINK_COMPONENTS support)
|
|
|
|
add_clang_library(clangTidyLLVMModule
|
|
HeaderGuardCheck.cpp
|
|
IncludeOrderCheck.cpp
|
|
LLVMTidyModule.cpp
|
|
PreferIsaOrDynCastInConditionalsCheck.cpp
|
|
TwineLocalCheck.cpp
|
|
|
|
LINK_LIBS
|
|
clangAST
|
|
clangASTMatchers
|
|
clangBasic
|
|
clangLex
|
|
clangTidy
|
|
clangTidyReadabilityModule
|
|
clangTidyUtils
|
|
clangTooling
|
|
)
|