fhahn added inline comments.
================
Comment at: clang/lib/CodeGen/CodeGenFunction.h:523
return getLangOpts().C11 || getLangOpts().C17 || getLangOpts().C2x;
}
----------------
jdoerfert wrote:
> Can you modify the documentation to talk about what loops must make progress,
> this is the code below transcribed.
>
> Also, I don't see how this works. Should the const-ness of the condition not
> be related to the standard/language to make a decision?
> Can you modify the documentation to talk about what loops must make progress,
> this is the code below transcribed.
I added some comments. I hope they make things clearer.
> Also, I don't see how this works. Should the const-ness of the condition not
> be related to the standard/language to make a decision?
The `functionMustProgress` call applies the C++ rules. So C++11 and above is
already handled by the call.
Afterwards, loops with constant conditions never have to make progress (C++
before 11, any C version). Loops with non-constant conditions have to make
progress in C11 and later.
Hopefully the comment makes that clearer.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96418/new/
https://reviews.llvm.org/D96418
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits