diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/ExprMutationAnalyzer.h')
| -rw-r--r-- | clang-tools-extra/clang-tidy/utils/ExprMutationAnalyzer.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/ExprMutationAnalyzer.h b/clang-tools-extra/clang-tidy/utils/ExprMutationAnalyzer.h deleted file mode 100644 index 256bb712891..00000000000 --- a/clang-tools-extra/clang-tidy/utils/ExprMutationAnalyzer.h +++ /dev/null @@ -1,56 +0,0 @@ -//===---------- ExprMutationAnalyzer.h - clang-tidy -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRMUTATIONANALYZER_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRMUTATIONANALYZER_H - -#include <type_traits> - -#include "clang/AST/AST.h" -#include "clang/ASTMatchers/ASTMatchers.h" -#include "llvm/ADT/DenseMap.h" - -namespace clang { -namespace tidy { -namespace utils { - -/// Analyzes whether any mutative operations are applied to an expression within -/// a given statement. -class ExprMutationAnalyzer { -public: - ExprMutationAnalyzer(const Stmt *Stm, ASTContext *Context) - : Stm(Stm), Context(Context) {} - - bool isMutated(const Decl *Dec) { return findDeclMutation(Dec) != nullptr; } - bool isMutated(const Expr *Exp) { return findMutation(Exp) != nullptr; } - const Stmt *findMutation(const Expr *Exp); - -private: - bool isUnevaluated(const Expr *Exp); - - const Stmt *findExprMutation(ArrayRef<ast_matchers::BoundNodes> Matches); - const Stmt *findDeclMutation(ArrayRef<ast_matchers::BoundNodes> Matches); - const Stmt *findDeclMutation(const Decl *Dec); - - const Stmt *findDirectMutation(const Expr *Exp); - const Stmt *findMemberMutation(const Expr *Exp); - const Stmt *findArrayElementMutation(const Expr *Exp); - const Stmt *findCastMutation(const Expr *Exp); - const Stmt *findRangeLoopMutation(const Expr *Exp); - const Stmt *findReferenceMutation(const Expr *Exp); - - const Stmt *const Stm; - ASTContext *const Context; - llvm::DenseMap<const Expr *, const Stmt *> Results; -}; - -} // namespace utils -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRMUTATIONANALYZER_H |

