Lines Matching defs:Exp

106   auto *Exp = dyn_cast<Expr>(&Node);
107 if (!Exp)
112 return canExprResolveTo(Exp, Target);
203 const Stmt *ExprMutationAnalyzer::Analyzer::findMutation(const Expr *Exp) {
205 Exp,
221 ExprMutationAnalyzer::Analyzer::findPointeeMutation(const Expr *Exp) {
222 return findMutationMemoized(Exp, {/*TODO*/}, Memorized.PointeeResults);
232 const Expr *Exp, llvm::ArrayRef<MutationFinder> Finders,
234 const auto Memoized = MemoizedResults.find(Exp);
238 // Assume Exp is not mutated before analyzing Exp.
239 MemoizedResults[Exp] = nullptr;
240 if (isUnevaluated(Exp))
244 if (const Stmt *S = (this->*Finder)(Exp))
245 return MemoizedResults[Exp] = S;
272 bool ExprMutationAnalyzer::Analyzer::isUnevaluated(const Stmt *Exp,
279 stmt(canResolveToExpr(Exp),
281 // `Exp` is part of the underlying expression of
299 hasDescendant(equalsNode(Exp)))),
305 bool ExprMutationAnalyzer::Analyzer::isUnevaluated(const Expr *Exp) {
306 return isUnevaluated(Exp, Stm, Context);
334 ExprMutationAnalyzer::Analyzer::findDirectMutation(const Expr *Exp) {
337 binaryOperator(isAssignmentOperator(), hasLHS(canResolveToExpr(Exp)));
342 hasUnaryOperand(canResolveToExpr(Exp)));
349 cxxMemberCallExpr(on(canResolveToExpr(Exp)), unless(isConstCallee())),
351 hasArgument(0, canResolveToExpr(Exp))),
357 hasEitherOperand(ignoringImpCasts(canResolveToExpr(Exp)))),
358 // A fold expression may contain `Exp` as it's initializer.
359 // We don't know if the operator modifies `Exp` because the
361 cxxFoldExpr(hasFoldInit(ignoringImpCasts(canResolveToExpr(Exp)))),
366 unresolvedMemberExpr(hasObjectExpression(canResolveToExpr(Exp))),
368 hasObjectExpression(canResolveToExpr(Exp))))))),
374 hasObjectExpression(canResolveToExpr(Exp))))))));
376 // Taking address of 'Exp'.
377 // We're assuming 'Exp' is mutated as soon as its address is taken, though in
384 hasUnaryOperand(canResolveToExpr(Exp)));
387 unless(hasParent(arraySubscriptExpr())), has(canResolveToExpr(Exp)));
395 argumentCountIs(1), hasArgument(0, canResolveToExpr(Exp)));
403 anyOf(canResolveToExpr(Exp),
404 memberExpr(hasObjectExpression(canResolveToExpr(Exp)))),
414 callExpr(isTypeDependent(), hasAnyArgument(canResolveToExpr(Exp))),
415 cxxUnresolvedConstructExpr(hasAnyArgument(canResolveToExpr(Exp))),
421 parenListExpr(hasDescendant(expr(canResolveToExpr(Exp)))),
424 initListExpr(hasAnyInit(expr(canResolveToExpr(Exp)))));
427 // If we're initializing a capture with 'Exp' directly then we're initializing
430 const auto AsLambdaRefCaptureInit = lambdaExpr(hasCaptureInit(Exp));
433 // If we're returning 'Exp' directly then it's returned as non-const-ref.
438 returnStmt(hasReturnValue(canResolveToExpr(Exp)));
442 allOf(canResolveToExpr(Exp), hasType(nonConstReferenceType())))));
458 ExprMutationAnalyzer::Analyzer::findMemberMutation(const Expr *Exp) {
459 // Check whether any member of 'Exp' is mutated.
461 findAll(expr(anyOf(memberExpr(hasObjectExpression(canResolveToExpr(Exp))),
463 hasObjectExpression(canResolveToExpr(Exp))),
465 hasLHS(equalsNode(Exp)))))
472 ExprMutationAnalyzer::Analyzer::findArrayElementMutation(const Expr *Exp) {
476 anyOf(hasBase(canResolveToExpr(Exp)),
479 hasSourceExpression(canResolveToExpr(Exp)))))))
485 const Stmt *ExprMutationAnalyzer::Analyzer::findCastMutation(const Expr *Exp) {
486 // If the 'Exp' is explicitly casted to a non-const reference type the
487 // 'Exp' is considered to be modified.
489 match(findFirst(stmt(castExpr(hasSourceExpression(canResolveToExpr(Exp)),
498 // If 'Exp' is casted to any non-const reference type, check the castExpr.
500 findAll(expr(castExpr(hasSourceExpression(canResolveToExpr(Exp)),
514 hasArgument(0, canResolveToExpr(Exp)))
521 ExprMutationAnalyzer::Analyzer::findRangeLoopMutation(const Expr *Exp) {
537 hasRangeInit(canResolveToExpr(Exp))))
565 hasRangeInit(canResolveToExpr(Exp)))))
573 // If range for looping over 'Exp' with a non-const reference loop variable,
579 hasRangeInit(canResolveToExpr(Exp)))),
585 ExprMutationAnalyzer::Analyzer::findReferenceMutation(const Expr *Exp) {
594 argumentCountIs(1), hasArgument(0, canResolveToExpr(Exp)))
600 // If 'Exp' is bound to a non-const reference, check all declRefExpr to that.
605 canResolveToExpr(Exp),
606 memberExpr(hasObjectExpression(canResolveToExpr(Exp))))),
618 ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) {
620 canResolveToExpr(Exp),
636 const auto *Exp = Nodes.getNodeAs<Expr>(NodeID<Expr>::value);
639 return Exp;
660 return Exp;
665 return Exp;