Lines Matching refs:Context
30 bool isNULLMacroExpansion(const Stmt *Statement, ASTContext &Context) { in isNULLMacroExpansion() argument
31 SourceManager &SM = Context.getSourceManager(); in isNULLMacroExpansion()
32 const LangOptions &LO = Context.getLangOpts(); in isNULLMacroExpansion()
44 ASTContext &Context) { in getZeroLiteralToCompareWithForType() argument
50 return Context.hasSameType(Type, Context.FloatTy) ? "0.0f" : "0.0"; in getZeroLiteralToCompareWithForType()
54 return Context.getLangOpts().CPlusPlus11 ? "nullptr" : "0"; in getZeroLiteralToCompareWithForType()
93 ASTContext &Context) { in fixGenericExprCastToBool() argument
105 Parent = Context.getParents(*Parent)[0].get<Stmt>(); in fixGenericExprCastToBool()
140 Cast->getCastKind(), SubExpr->getType(), Context); in fixGenericExprCastToBool()
147 Cast->getEndLoc(), 0, Context.getSourceManager(), Context.getLangOpts()); in fixGenericExprCastToBool()
152 ASTContext &Context) { in getEquivalentBoolLiteralForExpr() argument
153 if (isNULLMacroExpansion(Expression, Context)) { in getEquivalentBoolLiteralForExpr()
180 ASTContext &Context, StringRef OtherType) { in fixGenericExprCastFromBool() argument
191 Cast->getEndLoc(), 0, Context.getSourceManager(), in fixGenericExprCastFromBool()
192 Context.getLangOpts()); in fixGenericExprCastFromBool()
199 QualType DestType, ASTContext &Context) { in getEquivalentForBoolLiteral() argument
201 if (!Context.getLangOpts().CPlusPlus11 && in getEquivalentForBoolLiteral()
208 if (Context.hasSameType(DestType, Context.FloatTy)) { in getEquivalentForBoolLiteral()
221 ASTContext &Context) { in isCastAllowedInCondition() argument
225 TraversalKindScope RAII(Context, TK_AsIs); in isCastAllowedInCondition()
228 for (const auto &N : Context.getParents(*Q.front())) { in isCastAllowedInCondition()
251 StringRef Name, ClangTidyContext *Context) in ImplicitBoolConversionCheck() argument
252 : ClangTidyCheck(Name, Context), in ImplicitBoolConversionCheck()
339 return handleCastToBool(CastToBool, Parent, *Result.Context); in check()
346 return handleCastFromBool(CastFromBool, NextImplicitCast, *Result.Context); in check()
352 ASTContext &Context) { in handleCastToBool() argument
356 isCastAllowedInCondition(Cast, Context)) { in handleCastToBool()
361 isCastAllowedInCondition(Cast, Context)) { in handleCastToBool()
369 getEquivalentBoolLiteralForExpr(Cast->getSubExpr(), Context); in handleCastToBool()
373 fixGenericExprCastToBool(Diag, Cast, Parent, Context); in handleCastToBool()
379 ASTContext &Context) { in handleCastFromBool() argument
388 *Cast, getEquivalentForBoolLiteral(BoolLiteral, DestType, Context)); in handleCastFromBool()
390 fixGenericExprCastFromBool(Diag, Cast, Context, DestType.getAsString()); in handleCastFromBool()