Lines Matching refs:Exp

97 const Stmt *ExprMutationAnalyzer::findMutation(const Expr *Exp) {
98 return findMutationMemoized(Exp,
113 const Stmt *ExprMutationAnalyzer::findPointeeMutation(const Expr *Exp) {
114 return findMutationMemoized(Exp, {/*TODO*/}, PointeeResults);
122 const Expr *Exp, llvm::ArrayRef<MutationFinder> Finders,
124 const auto Memoized = MemoizedResults.find(Exp);
128 if (isUnevaluated(Exp))
129 return MemoizedResults[Exp] = nullptr;
132 if (const Stmt *S = (this->*Finder)(Exp))
133 return MemoizedResults[Exp] = S;
136 return MemoizedResults[Exp] = nullptr;
152 bool ExprMutationAnalyzer::isUnevaluated(const Expr *Exp) {
157 expr(equalsNode(Exp),
159 // `Exp` is part of the underlying expression of
177 hasDescendant(equalsNode(Exp)))),
205 const Stmt *ExprMutationAnalyzer::findDirectMutation(const Expr *Exp) {
209 hasLHS(maybeEvalCommaExpr(equalsNode(Exp))));
214 hasUnaryOperand(maybeEvalCommaExpr(equalsNode(Exp))));
221 on(maybeEvalCommaExpr(equalsNode(Exp)))),
224 maybeEvalCommaExpr(equalsNode(Exp)))),
227 hasObjectExpression(maybeEvalCommaExpr(equalsNode(Exp)))),
229 hasObjectExpression(maybeEvalCommaExpr(equalsNode(Exp))))))))));
231 // Taking address of 'Exp'.
232 // We're assuming 'Exp' is mutated as soon as its address is taken, though in
239 hasUnaryOperand(maybeEvalCommaExpr(equalsNode(Exp))));
243 has(maybeEvalCommaExpr(equalsNode(Exp))));
252 hasArgument(0, maybeEvalCommaExpr(equalsNode(Exp))));
260 maybeEvalCommaExpr(equalsNode(Exp)),
269 hasAnyArgument(maybeEvalCommaExpr(equalsNode(Exp)))),
270 cxxUnresolvedConstructExpr(hasAnyArgument(maybeEvalCommaExpr(equalsNode(Exp)))));
273 // If we're initializing a capture with 'Exp' directly then we're initializing
276 const auto AsLambdaRefCaptureInit = lambdaExpr(hasCaptureInit(Exp));
279 // If we're returning 'Exp' directly then it's returned as non-const-ref.
284 maybeEvalCommaExpr(equalsNode(Exp))));
296 const Stmt *ExprMutationAnalyzer::findMemberMutation(const Expr *Exp) {
297 // Check whether any member of 'Exp' is mutated.
299 match(findAll(expr(anyOf(memberExpr(hasObjectExpression(equalsNode(Exp))),
301 hasObjectExpression(equalsNode(Exp)))))
307 const Stmt *ExprMutationAnalyzer::findArrayElementMutation(const Expr *Exp) {
310 findAll(arraySubscriptExpr(hasBase(ignoringImpCasts(equalsNode(Exp))))
316 const Stmt *ExprMutationAnalyzer::findCastMutation(const Expr *Exp) {
317 // If 'Exp' is casted to any non-const reference type, check the castExpr.
319 match(findAll(castExpr(hasSourceExpression(equalsNode(Exp)),
332 hasArgument(0, equalsNode(Exp)))
338 const Stmt *ExprMutationAnalyzer::findRangeLoopMutation(const Expr *Exp) {
339 // If range for looping over 'Exp' with a non-const reference loop variable,
345 hasRangeInit(equalsNode(Exp)))),
350 const Stmt *ExprMutationAnalyzer::findReferenceMutation(const Expr *Exp) {
359 argumentCountIs(1), hasArgument(0, equalsNode(Exp)))
365 // If 'Exp' is bound to a non-const reference, check all declRefExpr to that.
370 hasInitializer(anyOf(equalsNode(Exp),
372 hasTrueExpression(equalsNode(Exp)),
373 hasFalseExpression(equalsNode(Exp)))))),
384 const Stmt *ExprMutationAnalyzer::findFunctionArgMutation(const Expr *Exp) {
386 equalsNode(Exp),
399 const auto *Exp = Nodes.getNodeAs<Expr>(NodeID<Expr>::value);
402 return Exp;
424 return Exp;
429 return Exp;