8#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_EXPRMUTATIONANALYZER_H
9#define LLVM_CLANG_ANALYSIS_ANALYSES_EXPRMUTATIONANALYZER_H
12#include "llvm/ADT/DenseMap.h"
17class FunctionParmMutationAnalyzer;
26 using ResultMap = llvm::DenseMap<const Expr *, const Stmt *>;
29 std::unique_ptr<FunctionParmMutationAnalyzer>>;
43 : Stm(Stm), Context(Context), Memorized(Memorized) {}
54 const Stmt *findMutationMemoized(
const Expr *Exp,
57 const Stmt *tryEachDeclRef(
const Decl *Dec, MutationFinder Finder);
66 const Stmt *findDirectMutation(
const Expr *Exp);
67 const Stmt *findMemberMutation(
const Expr *Exp);
68 const Stmt *findArrayElementMutation(
const Expr *Exp);
69 const Stmt *findCastMutation(
const Expr *Exp);
70 const Stmt *findRangeLoopMutation(
const Expr *Exp);
71 const Stmt *findReferenceMutation(
const Expr *Exp);
72 const Stmt *findFunctionArgMutation(
const Expr *Exp);
80 : Memorized(), A(Stm, Context, Memorized) {}
124 .try_emplace(&
Func, std::unique_ptr<FunctionParmMutationAnalyzer>(
126 Func, Context, Memorized)))
129 return it->getSecond().get();
139 llvm::DenseMap<const ParmVarDecl *, const Stmt *> Results;
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Decl - This represents one declaration (or definition), e.g.
Analyzes whether any mutative operations are applied to an expression within a given statement.
const Stmt * findMutation(const Expr *Exp)
static bool isUnevaluated(const Stmt *Stm, ASTContext &Context)
check whether stmt is unevaluated.
bool isMutated(const Decl *Dec)
bool isPointeeMutated(const Expr *Exp)
const Stmt * findMutation(const Decl *Dec)
const Stmt * findPointeeMutation(const Expr *Exp)
bool isMutated(const Expr *Exp)
ExprMutationAnalyzer(const Stmt &Stm, ASTContext &Context)
bool isPointeeMutated(const Decl *Dec)
const Stmt * findPointeeMutation(const Decl *Dec)
This represents one expression.
Represents a function declaration or definition.
static FunctionParmMutationAnalyzer * getFunctionParmMutationAnalyzer(const FunctionDecl &Func, ASTContext &Context, ExprMutationAnalyzer::Memoized &Memorized)
bool isMutated(const ParmVarDecl *Parm)
const Stmt * findMutation(const ParmVarDecl *Parm)
Represents a parameter to a function.
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.
Analyzer(const Stmt &Stm, ASTContext &Context, Memoized &Memorized)
const Stmt * findPointeeMutation(const Expr *Exp)
const Stmt * findMutation(const Expr *Exp)
llvm::SmallDenseMap< const FunctionDecl *, std::unique_ptr< FunctionParmMutationAnalyzer > > FunctionParaAnalyzerMap
FunctionParaAnalyzerMap FuncParmAnalyzer
llvm::DenseMap< const Expr *, const Stmt * > ResultMap