13#include "llvm/ADT/STLExtras.h"
16using namespace ast_matchers;
26 const auto IgnoreDerivedToBase = [](
const Expr *
E,
auto Matcher) {
29 if (
const auto *Cast = dyn_cast<ImplicitCastExpr>(
E)) {
30 if ((Cast->getCastKind() == CK_DerivedToBase ||
31 Cast->getCastKind() == CK_UncheckedDerivedToBase) &&
32 Matcher(Cast->getSubExpr()))
38 const auto EvalCommaExpr = [](
const Expr *
E,
auto Matcher) {
40 while (
const auto *BOComma =
41 dyn_cast_or_null<BinaryOperator>(
Result->IgnoreParens())) {
42 if (!BOComma->isCommaOp())
44 Result = BOComma->getRHS();
57 const auto ConditionalOperatorM = [
Target](
const Expr *
E) {
58 if (
const auto *CO = dyn_cast<AbstractConditionalOperator>(
E)) {
59 const auto *TE = CO->getTrueExpr()->IgnoreParens();
62 const auto *FE = CO->getFalseExpr()->IgnoreParens();
70 return IgnoreDerivedToBase(SourceExprP,
72 return E ==
Target || ConditionalOperatorM(
E);
74 EvalCommaExpr(SourceExprP, [&](
const Expr *
E) {
75 return IgnoreDerivedToBase(
83 return llvm::is_contained(
Node.capture_inits(),
E);
87 ast_matchers::internal::Matcher<DeclStmt>, InnerMatcher) {
88 const DeclStmt *
const Range =
Node.getRangeStmt();
89 return InnerMatcher.matches(*
Range, Finder, Builder);
93 auto *Exp = dyn_cast<Expr>(&
Node);
96 auto *
Target = dyn_cast<Expr>(Inner);
104AST_MATCHER_P(InitListExpr, hasAnyInit, ast_matchers::internal::Matcher<Expr>,
106 for (
const Expr *Arg :
Node.inits()) {
107 ast_matchers::internal::BoundNodesTreeBuilder
Result(*Builder);
108 if (InnerMatcher.matches(*Arg, Finder, &
Result)) {
109 *Builder = std::move(
Result);
116const ast_matchers::internal::VariadicDynCastAllOfMatcher<Stmt, CXXTypeidExpr>
119AST_MATCHER(CXXTypeidExpr, isPotentiallyEvaluated) {
120 return Node.isPotentiallyEvaluated();
124 const Decl *CalleeDecl =
Node.getCalleeDecl();
125 const auto *VD = dyn_cast_or_null<ValueDecl>(CalleeDecl);
128 const QualType
T = VD->getType().getCanonicalType();
129 const auto *MPT = dyn_cast<MemberPointerType>(
T);
130 const auto *FPT = MPT ? cast<FunctionProtoType>(MPT->getPointeeType())
131 : dyn_cast<FunctionProtoType>(
T);
134 return FPT->isConst();
138 ast_matchers::internal::Matcher<Expr>, InnerMatcher) {
139 if (
Node.isTypePredicate())
141 return InnerMatcher.matches(*
Node.getControllingExpr(), Finder, Builder);
145ast_matchers::internal::Matcher<T>
146findFirst(
const ast_matchers::internal::Matcher<T> &Matcher) {
150const auto nonConstReferenceType = [] {
151 return hasUnqualifiedDesugaredType(
155const auto nonConstPointerType = [] {
156 return hasUnqualifiedDesugaredType(
160const auto isMoveOnly = [] {
170template <
class T>
struct NodeID;
171template <>
struct NodeID<Expr> {
static constexpr StringRef value =
"expr"; };
172template <>
struct NodeID<
Decl> {
static constexpr StringRef value =
"decl"; };
173constexpr StringRef NodeID<Expr>::value;
174constexpr StringRef NodeID<Decl>::value;
177 class F =
const Stmt *(ExprMutationAnalyzer::Analyzer::*)(
const T *)>
178const Stmt *tryEachMatch(ArrayRef<ast_matchers::BoundNodes> Matches,
179 ExprMutationAnalyzer::Analyzer *Analyzer, F Finder) {
180 const StringRef
ID = NodeID<T>::value;
181 for (
const auto &
Nodes : Matches) {
182 if (
const Stmt *S = (Analyzer->*Finder)(
Nodes.getNodeAs<
T>(
ID)))
191 return findMutationMemoized(
193 {&ExprMutationAnalyzer::Analyzer::findDirectMutation,
194 &ExprMutationAnalyzer::Analyzer::findMemberMutation,
195 &ExprMutationAnalyzer::Analyzer::findArrayElementMutation,
196 &ExprMutationAnalyzer::Analyzer::findCastMutation,
197 &ExprMutationAnalyzer::Analyzer::findRangeLoopMutation,
198 &ExprMutationAnalyzer::Analyzer::findReferenceMutation,
199 &ExprMutationAnalyzer::Analyzer::findFunctionArgMutation},
214 return tryEachDeclRef(Dec,
218const Stmt *ExprMutationAnalyzer::Analyzer::findMutationMemoized(
222 auto [
Memoized, Inserted] = MemoizedResults.try_emplace(Exp);
229 for (
const auto &Finder : Finders) {
230 if (
const Stmt *S = (this->*Finder)(Exp))
231 return MemoizedResults[Exp] = S;
238ExprMutationAnalyzer::Analyzer::tryEachDeclRef(
const Decl *Dec,
239 MutationFinder Finder) {
240 const auto Refs =
match(
244 anyOf(equalsNode(Dec),
248 .bind(NodeID<Expr>::value)),
250 for (
const auto &RefNodes : Refs) {
251 const auto *
E = RefNodes.getNodeAs<Expr>(NodeID<Expr>::value);
252 if ((this->*Finder)(
E))
273 cxxTypeidExpr(
unless(isPotentiallyEvaluated())),
285 return tryEachMatch<Expr>(Matches,
this,
290ExprMutationAnalyzer::Analyzer::findDeclMutation(ArrayRef<BoundNodes> Matches) {
291 return tryEachMatch<Decl>(Matches,
this,
295const Stmt *ExprMutationAnalyzer::Analyzer::findExprPointeeMutation(
296 ArrayRef<ast_matchers::BoundNodes> Matches) {
297 return tryEachMatch<Expr>(
301const Stmt *ExprMutationAnalyzer::Analyzer::findDeclPointeeMutation(
302 ArrayRef<ast_matchers::BoundNodes> Matches) {
303 return tryEachMatch<Decl>(
308ExprMutationAnalyzer::Analyzer::findDirectMutation(
const Expr *Exp) {
310 const auto AsAssignmentLhs =
311 binaryOperator(isAssignmentOperator(), hasLHS(canResolveToExpr(Exp)));
314 const auto AsIncDecOperand =
316 hasUnaryOperand(canResolveToExpr(Exp)));
325 hasArgument(0, canResolveToExpr(Exp))),
331 hasEitherOperand(ignoringImpCasts(canResolveToExpr(Exp)))),
335 cxxFoldExpr(hasFoldInit(ignoringImpCasts(canResolveToExpr(Exp)))),
342 hasObjectExpression(canResolveToExpr(Exp))))))),
348 hasObjectExpression(canResolveToExpr(Exp))))))));
354 const auto AsAmpersandOperand =
358 hasUnaryOperand(canResolveToExpr(Exp)));
359 const auto AsPointerFromArrayDecay =
castExpr(
360 hasCastKind(CK_ArrayToPointerDecay),
368 cxxMethodDecl(ofClass(isMoveOnly()), returns(nonConstPointerType()))),
369 argumentCountIs(1), hasArgument(0, canResolveToExpr(Exp)));
376 const auto NonConstRefParam = forEachArgumentWithParamType(
377 anyOf(canResolveToExpr(Exp),
378 memberExpr(hasObjectExpression(canResolveToExpr(Exp)))),
379 nonConstReferenceType());
382 const auto AsNonConstRefArg =
388 callExpr(isTypeDependent(), hasAnyArgument(canResolveToExpr(Exp))),
404 const auto AsLambdaRefCaptureInit =
lambdaExpr(hasCaptureInit(Exp));
411 const auto AsNonConstRefReturn =
412 returnStmt(hasReturnValue(canResolveToExpr(Exp)));
416 allOf(canResolveToExpr(Exp), hasType(nonConstReferenceType())))));
418 const auto Matches =
match(
421 findFirst(
stmt(
anyOf(AsAssignmentLhs, AsIncDecOperand, AsNonConstThis,
422 AsAmpersandOperand, AsPointerFromArrayDecay,
423 AsOperatorArrowThis, AsNonConstRefArg,
424 AsLambdaRefCaptureInit, AsNonConstRefReturn,
425 AsNonConstRefRangeInit))
428 return selectFirst<Stmt>(
"stmt", Matches);
432ExprMutationAnalyzer::Analyzer::findMemberMutation(
const Expr *Exp) {
434 const auto MemberExprs =
match(
437 hasObjectExpression(canResolveToExpr(Exp))),
439 hasLHS(equalsNode(Exp)))))
440 .bind(NodeID<Expr>::value)),
442 return findExprMutation(MemberExprs);
446ExprMutationAnalyzer::Analyzer::findArrayElementMutation(
const Expr *Exp) {
448 const auto SubscriptExprs =
match(
450 anyOf(hasBase(canResolveToExpr(Exp)),
452 hasCastKind(CK_ArrayToPointerDecay),
453 hasSourceExpression(canResolveToExpr(Exp)))))))
454 .bind(NodeID<Expr>::value)),
456 return findExprMutation(SubscriptExprs);
459const Stmt *ExprMutationAnalyzer::Analyzer::findCastMutation(
const Expr *Exp) {
462 const auto ExplicitCast =
465 nonConstReferenceType()))))
469 if (
const auto *CastStmt = selectFirst<Stmt>(
"stmt", ExplicitCast))
473 const auto Casts =
match(
476 nonConstReferenceType())),
478 nonConstReferenceType())))))
479 .bind(NodeID<Expr>::value)),
482 if (
const Stmt *S = findExprMutation(Casts))
487 hasAnyName(
"::std::move",
"::std::forward"))),
488 hasArgument(0, canResolveToExpr(Exp)))
491 return findExprMutation(Calls);
495ExprMutationAnalyzer::Analyzer::findRangeLoopMutation(
const Expr *Exp) {
502 const auto DeclStmtToNonRefToArray =
declStmt(hasSingleDecl(
varDecl(hasType(
504 const auto RefToArrayRefToElements =
match(
508 hasType(nonConstPointerType())))
509 .bind(NodeID<Decl>::value)),
510 hasRangeStmt(DeclStmtToNonRefToArray),
511 hasRangeInit(canResolveToExpr(Exp))))
515 if (
const auto *BadRangeInitFromArray =
516 selectFirst<Stmt>(
"stmt", RefToArrayRefToElements))
517 return BadRangeInitFromArray;
526 const auto HasAnyNonConstIterator =
532 const auto DeclStmtToNonConstIteratorContainer =
declStmt(
536 const auto RefToContainerBadIterators =
match(
538 hasRangeStmt(DeclStmtToNonConstIteratorContainer),
539 hasRangeInit(canResolveToExpr(Exp)))))
543 if (
const auto *BadIteratorsContainer =
544 selectFirst<Stmt>(
"stmt", RefToContainerBadIterators))
545 return BadIteratorsContainer;
549 const auto LoopVars =
551 hasLoopVariable(
varDecl(hasType(nonConstReferenceType()))
552 .bind(NodeID<Decl>::value)),
553 hasRangeInit(canResolveToExpr(Exp)))),
555 return findDeclMutation(LoopVars);
559ExprMutationAnalyzer::Analyzer::findReferenceMutation(
const Expr *Exp) {
563 const auto Ref =
match(
567 returns(nonConstReferenceType()))),
568 argumentCountIs(1), hasArgument(0, canResolveToExpr(Exp)))
569 .bind(NodeID<Expr>::value)),
571 if (
const Stmt *S = findExprMutation(Ref))
575 const auto Refs =
match(
577 varDecl(hasType(nonConstReferenceType()),
578 hasInitializer(
anyOf(
579 canResolveToExpr(Exp),
580 memberExpr(hasObjectExpression(canResolveToExpr(Exp))))),
585 hasRangeStmt(equalsBoundNode(
"stmt"))))))))
586 .bind(NodeID<Decl>::value))),
588 return findDeclMutation(Refs);
592ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(
const Expr *Exp) {
593 const auto NonConstRefParam = forEachArgumentWithParam(
594 canResolveToExpr(Exp),
595 parmVarDecl(hasType(nonConstReferenceType())).bind(
"parm"));
598 const auto Matches =
match(
604 "::std::move",
"::std::forward"))))),
607 .bind(NodeID<Expr>::value))),
609 for (
const auto &
Nodes : Matches) {
610 const auto *Exp =
Nodes.getNodeAs<Expr>(NodeID<Expr>::value);
611 const auto *
Func =
Nodes.getNodeAs<FunctionDecl>(
"func");
612 if (!
Func->getBody() || !
Func->getPrimaryTemplate())
615 const auto *Parm =
Nodes.getNodeAs<ParmVarDecl>(
"parm");
616 const ArrayRef<ParmVarDecl *> AllParams =
617 Func->getPrimaryTemplate()->getTemplatedDecl()->parameters();
619 AllParams[std::min<size_t>(Parm->getFunctionScopeIndex(),
620 AllParams.size() - 1)]
622 if (
const auto *
T = ParmType->
getAs<PackExpansionType>())
623 ParmType =
T->getPattern();
627 if (
const auto *RefType = ParmType->getAs<RValueReferenceType>()) {
628 if (!RefType->getPointeeType().getQualifiers() &&
629 RefType->getPointeeType()->getAs<TemplateTypeParmType>()) {
632 *
Func, Context, Memorized);
633 if (Analyzer->findMutation(Parm))
644FunctionParmMutationAnalyzer::FunctionParmMutationAnalyzer(
645 const FunctionDecl &
Func, ASTContext &Context,
646 ExprMutationAnalyzer::Memoized &Memorized)
647 : BodyAnalyzer(*
Func.getBody(), Context, Memorized) {
648 if (
const auto *Ctor = dyn_cast<CXXConstructorDecl>(&
Func)) {
651 for (
const CXXCtorInitializer *
Init : Ctor->inits()) {
652 ExprMutationAnalyzer::Analyzer InitAnalyzer(*
Init->getInit(), Context,
654 for (
const ParmVarDecl *Parm : Ctor->parameters()) {
655 if (Results.contains(Parm))
657 if (
const Stmt *S = InitAnalyzer.findMutation(Parm))
666 const auto Memoized = Results.find(Parm);
667 if (Memoized != Results.end())
668 return Memoized->second;
673 Results[Parm] =
nullptr;
675 return Results[Parm] = S;
676 return Results[Parm];
BoundNodesTreeBuilder Nodes
#define AST_MATCHER(Type, DefineMatcher)
AST_MATCHER(Type, DefineMatcher) { ... } defines a zero parameter function named DefineMatcher() that...
#define AST_MATCHER_P(Type, DefineMatcher, ParamType, Param)
AST_MATCHER_P(Type, DefineMatcher, ParamType, Param) { ... } defines a single-parameter function name...
llvm::MachO::Target Target
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.
static bool isUnevaluated(const Stmt *Stm, ASTContext &Context)
check whether stmt is unevaluated.
friend class FunctionParmMutationAnalyzer
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
static FunctionParmMutationAnalyzer * getFunctionParmMutationAnalyzer(const FunctionDecl &Func, ASTContext &Context, ExprMutationAnalyzer::Memoized &Memorized)
const Stmt * findMutation(const ParmVarDecl *Parm)
Represents a parameter to a function.
Stmt - This represents one statement.
const T * getAs() const
Member-template getAs<specific type>'.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
const internal::VariadicDynCastAllOfMatcher< Stmt, ImplicitCastExpr > implicitCastExpr
Matches the implicit cast nodes of Clang's AST.
const internal::ArgumentAdaptingMatcherFunc< internal::HasDescendantMatcher > hasDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXDependentScopeMemberExpr > cxxDependentScopeMemberExpr
Matches member expressions where the actual member referenced could not be resolved because the base ...
const AstTypeMatcher< PointerType > pointerType
Matches pointer types, but does not match Objective-C object pointer types.
const internal::VariadicDynCastAllOfMatcher< Decl, BindingDecl > bindingDecl
Matches binding declarations Example matches foo and bar (matcher = bindingDecl()
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, GenericSelectionExpr > genericSelectionExpr
Matches C11 _Generic expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
internal::Matcher< NamedDecl > hasName(StringRef Name)
Matches NamedDecl nodes that have the specified name.
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, LambdaExpr > lambdaExpr
Matches lambda expressions.
const AstTypeMatcher< VariableArrayType > variableArrayType
Matches C arrays with a specified size that is not an integer-constant-expression.
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryExprOrTypeTraitExpr > unaryExprOrTypeTraitExpr
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
const internal::ArgumentAdaptingMatcherFunc< internal::ForEachDescendantMatcher > forEachDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
const internal::VariadicDynCastAllOfMatcher< Decl, NamedDecl > namedDecl
Matches a declaration of anything that could have a name.
const internal::VariadicAllOfMatcher< TypeLoc > typeLoc
Matches TypeLocs in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Stmt, ParenListExpr > parenListExpr
Matches paren list expressions.
const AstTypeMatcher< ArrayType > arrayType
Matches all kinds of arrays.
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
const internal::VariadicFunction< internal::Matcher< NamedDecl >, StringRef, internal::hasAnyNameFunc > hasAnyName
Matches NamedDecl nodes that have any of the specified names.
const internal::VariadicDynCastAllOfMatcher< Stmt, ArraySubscriptExpr > arraySubscriptExpr
Matches array subscript expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXForRangeStmt > cxxForRangeStmt
Matches range-based for statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXConstructorDecl > cxxConstructorDecl
Matches C++ constructor declarations.
internal::BindableMatcher< Stmt > sizeOfExpr(const internal::Matcher< UnaryExprOrTypeTraitExpr > &InnerMatcher)
Same as unaryExprOrTypeTraitExpr, but only matching sizeof.
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXNoexceptExpr > cxxNoexceptExpr
Matches noexcept expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
const internal::ArgumentAdaptingMatcherFunc< internal::HasMatcher > has
Matches AST nodes that have child AST nodes that match the provided matcher.
const internal::VariadicDynCastAllOfMatcher< Stmt, ExplicitCastExpr > explicitCastExpr
Matches explicit cast expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXConstructExpr > cxxConstructExpr
Matches constructor call expressions (including implicit ones).
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
internal::PolymorphicMatcher< internal::HasOverloadedOperatorNameMatcher, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl), std::vector< std::string > > hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> allOf
Matches if all given matchers match.
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, UnresolvedMemberExpr > unresolvedMemberExpr
Matches unresolved member expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, MemberExpr > memberExpr
Matches member expressions.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
internal::Matcher< T > traverse(TraversalKind TK, const internal::Matcher< T > &InnerMatcher)
Causes all nested matchers to be matched with the specified traversal kind.
const AstTypeMatcher< ReferenceType > referenceType
Matches both lvalue and rvalue reference types.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXUnresolvedConstructExpr > cxxUnresolvedConstructExpr
Matches unresolved constructor call expressions.
internal::Matcher< T > findAll(const internal::Matcher< T > &Matcher)
Matches if the node or any descendant matches.
internal::PolymorphicMatcher< internal::HasDeclarationMatcher, void(internal::HasDeclarationSupportedTypes), internal::Matcher< Decl > > hasDeclaration(const internal::Matcher< Decl > &InnerMatcher)
Matches a node if the declaration associated with that node matches the given matcher.
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXFoldExpr > cxxFoldExpr
Matches C++17 fold expressions.
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> anyOf
Matches if any of the given matchers matches.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
const internal::ArgumentAdaptingMatcherFunc< internal::HasAncestorMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr > > hasAncestor
Matches AST nodes that have an ancestor that matches the provided matcher.
const internal::ArgumentAdaptingMatcherFunc< internal::HasParentMatcher, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr >, internal::TypeList< Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr > > hasParent
Matches AST nodes that have a parent that matches the provided matcher.
The JSON file list parser is used to communicate input to InstallAPI.
@ TK_AsIs
Will traverse all child nodes.
@ Result
The result type of a method or function.
const FunctionProtoType * T
static bool canExprResolveTo(const Expr *Source, const Expr *Target)
const Stmt * findPointeeMutation(const Expr *Exp)
const Stmt * findMutation(const Expr *Exp)
llvm::DenseMap< const Expr *, const Stmt * > ResultMap