Lines Matching refs:If

356   bool VisitIfStmt(IfStmt *If) {  in VisitIfStmt()  argument
358 if (If->hasInitStorage() || If->hasVarStorage()) in VisitIfStmt()
365 Expr *Cond = If->getCond()->IgnoreImplicit(); in VisitIfStmt()
368 Check->replaceWithThenStatement(Context, If, Cond); in VisitIfStmt()
370 Check->replaceWithElseStatement(Context, If, Cond); in VisitIfStmt()
373 if (If->getElse()) { in VisitIfStmt()
379 checkSingleStatement(If->getThen(), parseReturnLiteralBool)) { in VisitIfStmt()
381 checkSingleStatement(If->getElse(), parseReturnLiteralBool); in VisitIfStmt()
385 Check->replaceWithReturnCondition(Context, If, ThenReturnBool.Item, in VisitIfStmt()
418 checkSingleStatement(If->getThen(), VarBoolAssignmentMatcher)) { in VisitIfStmt()
420 checkSingleStatement(If->getElse(), VarBoolAssignmentMatcher); in VisitIfStmt()
425 Check->replaceWithAssignment(Context, If, Var, Loc, in VisitIfStmt()
469 auto *If = cast<IfStmt>(*First); in VisitCompoundStmt() local
470 if (!If->hasInitStorage() && !If->hasVarStorage()) { in VisitCompoundStmt()
472 checkSingleStatement(If->getThen(), parseReturnLiteralBool); in VisitCompoundStmt()
476 If->getElse() == nullptr) { in VisitCompoundStmt()
479 If, ThenReturnBool.Item); in VisitCompoundStmt()
730 const ASTContext &Context, const IfStmt *If, const Expr *BoolLiteral, in replaceWithReturnCondition() argument
732 StringRef Terminator = isa<CompoundStmt>(If->getElse()) ? ";" : ""; in replaceWithReturnCondition()
734 replacementExpression(Context, Negated, If->getCond()); in replaceWithReturnCondition()
738 If->getSourceRange(), Replacement); in replaceWithReturnCondition()
743 const IfStmt *If, const Expr *ThenReturn) { in replaceCompoundReturnWithCondition() argument
745 "return " + replacementExpression(Context, Negated, If->getCond()); in replaceCompoundReturnWithCondition()
748 SourceRange(If->getBeginLoc(), Ret->getEndLoc()), Replacement); in replaceCompoundReturnWithCondition()