Lines Matching defs:Cond
68 /// Return whether `Cond` is a variable that is possibly changed in `LoopStmt`.
70 const Stmt *Cond, ASTContext *Context) {
71 if (const auto *DRE = dyn_cast<DeclRefExpr>(Cond)) {
87 ObjCIvarRefExpr, ObjCPropertyRefExpr, ObjCMessageExpr>(Cond)) {
90 } else if (const auto *CE = dyn_cast<CastExpr>(Cond)) {
106 /// Return whether at least one variable of `Cond` changed in `LoopStmt`.
108 const Stmt *Cond, ASTContext *Context) {
109 if (isVarThatIsPossiblyChanged(Func, LoopStmt, Cond, Context))
112 for (const Stmt *Child : Cond->children()) {
122 /// Return the variable names in `Cond`.
123 static std::string getCondVarNames(const Stmt *Cond) {
124 if (const auto *DRE = dyn_cast<DeclRefExpr>(Cond)) {
130 for (const Stmt *Child : Cond->children()) {
142 static bool isKnownToHaveValue(const Expr &Cond, const ASTContext &Ctx,
144 if (Cond.isValueDependent()) {
145 if (const auto *BinOp = dyn_cast<BinaryOperator>(&Cond)) {
156 } else if (const auto *UnOp = dyn_cast<UnaryOperator>(&Cond)) {
159 } else if (const auto *Paren = dyn_cast<ParenExpr>(&Cond))
161 else if (const auto *ImplCast = dyn_cast<ImplicitCastExpr>(&Cond))
166 if (Cond.EvaluateAsBooleanCondition(Result, Ctx))
216 /// returns true iff `Cond` involves at least one static local variable.
217 static bool hasStaticLocalVariable(const Stmt *Cond) {
218 if (const auto *DRE = dyn_cast<DeclRefExpr>(Cond))
222 for (const Stmt *Child : Cond->children())
228 /// Tests if the loop condition `Cond` involves static local variables and
239 static bool hasRecursionOverStaticLoopCondVariables(const Expr *Cond,
243 if (!hasStaticLocalVariable(Cond))
289 const auto *Cond = Result.Nodes.getNodeAs<Expr>("condition");
293 if (isKnownToHaveValue(*Cond, *Result.Context, false))
301 Cond = Init;
309 if (isAtLeastOneCondVarChanged(Func, LoopStmt, Cond, Result.Context))
311 if (hasRecursionOverStaticLoopCondVariables(Cond, LoopStmt, Func,
315 std::string CondVarNames = getCondVarNames(Cond);