================ @@ -654,6 +716,83 @@ ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) { return nullptr; } +const Stmt * +ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) { + const auto Matches = match( + stmt(forEachDescendant( + expr(anyOf( + // deref by * + unaryOperator(hasOperatorName("*"), + hasUnaryOperand(canResolveToExprPointee(Exp))), + // deref by [] + arraySubscriptExpr(hasBase(canResolveToExprPointee(Exp))))) + .bind(NodeID<Expr>::value))), + Stm, Context); + return findExprMutation(Matches); +} + +const Stmt * +ExprMutationAnalyzer::Analyzer::findPointeeMemberMutation(const Expr *Exp) { + const Stmt *MemberCallExpr = selectFirst<Stmt>( + "stmt", match(stmt(forEachDescendant( + cxxMemberCallExpr(on(canResolveToExprPointee(Exp)), + unless(isConstCallee())) ---------------- 5chmidti wrote:
Please check for the constness of the callee before trying to resolve to `Exp` https://github.com/llvm/llvm-project/pull/118593 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits