forked from OSchip/llvm-project
271e181c78
Summary: (Originally started as a clang-tidy check but there's already D45444 so shifted to just adding ExprMutationAnalyzer) `ExprMutationAnalyzer` is a generally useful helper that can be used in different clang-tidy checks for checking whether a given expression is (potentially) mutated within a statement (typically the enclosing compound statement.) This is a more general and more powerful/accurate version of isOnlyUsedAsConst, which is used in ForRangeCopyCheck, UnnecessaryCopyInitialization. It should also be possible to construct checks like D45444 (suggest adding const to variable declaration) or https://bugs.llvm.org/show_bug.cgi?id=21981 (suggest adding const to member function) using this helper function. This function is tested by itself and is intended to stay generally useful instead of tied to any particular check. Reviewers: hokein, alexfh, aaron.ballman, ilya-biryukov, george.karpenkov Reviewed By: aaron.ballman Subscribers: lebedev.ri, shuaiwang, rnkovacs, hokein, alexfh, aaron.ballman, a.sidorin, Eugene.Zelenko, xazax.hun, JonasToth, klimek, mgorny, cfe-commits Tags: #clang-tools-extra Patch by Shuai Wang. Differential Revision: https://reviews.llvm.org/D45679 llvm-svn: 335736 |
||
---|---|---|
.. | ||
ASTUtils.cpp | ||
ASTUtils.h | ||
CMakeLists.txt | ||
DeclRefExprUtils.cpp | ||
DeclRefExprUtils.h | ||
ExprMutationAnalyzer.cpp | ||
ExprMutationAnalyzer.h | ||
ExprSequence.cpp | ||
ExprSequence.h | ||
FixItHintUtils.cpp | ||
FixItHintUtils.h | ||
HeaderFileExtensionsUtils.cpp | ||
HeaderFileExtensionsUtils.h | ||
HeaderGuard.cpp | ||
HeaderGuard.h | ||
IncludeInserter.cpp | ||
IncludeInserter.h | ||
IncludeSorter.cpp | ||
IncludeSorter.h | ||
LexerUtils.cpp | ||
LexerUtils.h | ||
Matchers.h | ||
NamespaceAliaser.cpp | ||
NamespaceAliaser.h | ||
OptionsUtils.cpp | ||
OptionsUtils.h | ||
TypeTraits.cpp | ||
TypeTraits.h | ||
UsingInserter.cpp | ||
UsingInserter.h |