17 const Expr *ControllingExpression,
19 llvm::function_ref<
void()> RemoveMustProgress) {
30 !ControllingExpression ||
33 bool CondIsTrue = CondIsConstInt && (!ControllingExpression ||
34 Result.Val.getInt().getBoolValue());
37 if (LangOpts.C11 && !CondIsConstInt)
46 LangOpts.CPlusPlus11) {
47 if (HasEmptyBody && CondIsTrue) {
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool EvaluateAsInt(EvalResult &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects, bool InConstantContext=false) const
EvaluateAsInt - Return true if this is a constant which we can fold and convert to an integer,...
bool checkIfLoopMustProgress(const LangOptions &LangOpts, const CodeGenOptions &CGOpts, ASTContext &Ctx, const Expr *ControllingExpression, bool HasEmptyBody, llvm::function_ref< void()> RemoveMustProgress)
Returns true if a loop must make progress, which means the mustprogress attribute can be added to it.