[PATCH] D74890: [Analysis] getParentLoop() documentation

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 10:11:15 PST 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/LoopTerminology.rst:120-121
 
+Parent Loop - A loop is either a top level loop, that is it
+is not enclosed in any other loop or it is a sub-loop of another.
+A parent of a loop is the innermost loop in which it is enclosed in.
----------------
[grammar] "that is it is"

I also don't understand this part of a definition. Does it clarify in what positions a loop can be (it makes it an unusually structured dictionary definition -- I'd expect the first sentence to explain what a "parent loop" is followed by further explanations)? IMHO the LoopInfo being a [[ https://en.wikipedia.org/wiki/Tree_(graph_theory)#Forest | forest  ]] is enough information.


================
Comment at: llvm/include/llvm/Analysis/LoopInfo.h:106
   BlockT *getHeader() const { return getBlocks().front(); }
+  /// Return the parent loop if it exists or nullptr otherwise.
+
----------------
Another suggestion: "Return the parent loop or nullptr for topmost loops"


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74890/new/

https://reviews.llvm.org/D74890





More information about the llvm-commits mailing list