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) {}
56 const Stmt *findMutationMemoized(
const Expr *Exp,
59 const Stmt *tryEachDeclRef(
const Decl *Dec, MutationFinder Finder);
70 const Stmt *findDirectMutation(
const Expr *Exp);
71 const Stmt *findMemberMutation(
const Expr *Exp);
72 const Stmt *findArrayElementMutation(
const Expr *Exp);
73 const Stmt *findCastMutation(
const Expr *Exp);
74 const Stmt *findRangeLoopMutation(
const Expr *Exp);
75 const Stmt *findReferenceMutation(
const Expr *Exp);
76 const Stmt *findFunctionArgMutation(
const Expr *Exp);
84 : Memorized(), A(Stm, Context, Memorized) {}
125 .try_emplace(&
Func, std::unique_ptr<FunctionParmMutationAnalyzer>(
127 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)
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)
static bool isUnevaluated(const Stmt *Smt, const Stmt &Stm, ASTContext &Context)
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)
static bool isUnevaluated(const Stmt *Smt, const Stmt &Stm, ASTContext &Context)
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