[PATCH] D82895: [NFC][LoopInfo] Document empty()
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 20 15:48:01 PDT 2020
fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.
In D82895#2283534 <https://reviews.llvm.org/D82895#2283534>, @baziotis wrote:
>> @baziotis Are you going to update this diff?
>
> Thanks, I had forgotten about this.
>
>> @fhahn OK with renaming empty() to isInnermost()?
>
> I'd say that now we see all the places `empty()` was used, for most of them the name `isInnermost()` makes more sense.
Thanks for updating!
LGTM, although it would be good to also update the code to use `isOutermost`.
================
Comment at: llvm/include/llvm/Analysis/LoopInfo.h:161
+ /// Outermost is the same as top-level.
+ bool isOutermost() const { return getParentLoop() == nullptr; }
----------------
It would be good to frame the comment in terms of the returned value, e.g. `Return true if the loop does not have a parent loop (= is the outermost loop)`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82895/new/
https://reviews.llvm.org/D82895
More information about the llvm-commits
mailing list