diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-04-26 11:23:24 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-06-13 20:01:15 +0000 |
commit | d409305fa3838fb39b38c26fc085fb729b8766d5 (patch) | |
tree | fd234b27775fb59a57266cf36a05ec916e79a85f /contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h | |
parent | e8d8bef961a50d4dc22501cde4fb9fb0be1b2532 (diff) | |
parent | b4125f7d51da2bb55d3b850dba9a69c201c3422c (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h index 8eb7adbc8fcb..95c0b7b4d7c0 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h @@ -507,12 +507,23 @@ public: /// True if the C++ Standard Requires Progress. bool CPlusPlusWithProgress() { + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Never) + return false; + return getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 || getLangOpts().CPlusPlus17 || getLangOpts().CPlusPlus20; } /// True if the C Standard Requires Progress. bool CWithProgress() { + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Always) + return true; + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Never) + return false; + return getLangOpts().C11 || getLangOpts().C17 || getLangOpts().C2x; } |