Add a new class to analyze whether an expression is mutated within a statement.

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.

Patch by Shuai Wang

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@334604 91177308-0d34-0410-b5e6-96231b3b80d8
5 files changed