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

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 06:04:14 PST 2020


baziotis updated this revision to Diff 245630.
baziotis added a reviewer: fhahn.
baziotis added a comment.

- Address comment.


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

https://reviews.llvm.org/D74890

Files:
  llvm/docs/LoopTerminology.rst
  llvm/include/llvm/Analysis/LoopInfo.h


Index: llvm/include/llvm/Analysis/LoopInfo.h
===================================================================
--- llvm/include/llvm/Analysis/LoopInfo.h
+++ llvm/include/llvm/Analysis/LoopInfo.h
@@ -103,6 +103,13 @@
     return D;
   }
   BlockT *getHeader() const { return getBlocks().front(); }
+  /// Return the parent loop if it exists or nullptr otherwise.
+
+  /// A loop is either top-level in a function (that is, it is not
+  /// contained in any other loop) or it is entirely enclosed in
+  /// some other loop.
+  /// If a loop is top-level, it has no parent, otherwise its
+  /// parent is the innermost loop in which it is enclosed in.
   LoopT *getParentLoop() const { return ParentLoop; }
 
   /// This is a raw interface for bypassing addChildLoop.
Index: llvm/docs/LoopTerminology.rst
===================================================================
--- llvm/docs/LoopTerminology.rst
+++ llvm/docs/LoopTerminology.rst
@@ -117,6 +117,11 @@
     } while (..)
   }
 
+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.
+A top level loop does not have a parent.
+
 LoopInfo
 ========
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74890.245630.patch
Type: text/x-patch
Size: 1250 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200220/10d082c3/attachment.bin>


More information about the llvm-commits mailing list