Recently I had to use it and although one assumes it returns null if there's no parent loop, I think it helps to doc it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Analysis/LoopInfo.h | ||
---|---|---|
106 | Use ///. That's how doxygen comments are defined. It might also be worth clarifying the parent loop relationship in https://llvm.org/docs/LoopTerminology.html. For the comment here I would suggest to start with a brief first sentence and maybe another one that explain the parent relationship, like Return the parent loop if it exists or nullptr otherwise. |
llvm/include/llvm/Analysis/LoopInfo.h | ||
---|---|---|
106 |
Reading this back I realized it might sound a bit harsh. That was not the intention, sorry! |
llvm/include/llvm/Analysis/LoopInfo.h | ||
---|---|---|
106 | No problem, thanks for the review! To change the LoopTerminology.html I change the /llvm/docs/LoopTerminology.rst right? |
llvm/include/llvm/Analysis/LoopInfo.h | ||
---|---|---|
106 | Yep, that would be great! |
llvm/docs/LoopTerminology.rst | ||
---|---|---|
123–124 | [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 forest is enough information. | |
llvm/include/llvm/Analysis/LoopInfo.h | ||
106 | Another suggestion: "Return the parent loop or nullptr for topmost loops" |
llvm/docs/LoopTerminology.rst | ||
---|---|---|
123–124 | Ok, thanks for the comment, indeed the definition structure is kind of bad. Regarding the last note, I think it's not stated in the terminology (although it's stated in some parts of LoopInfo.h). Do you think it would be good to add this clarification? | |
llvm/include/llvm/Analysis/LoopInfo.h | ||
106 | Ok. I'm going with "top level" for consistency with the terminology but please comment if I shouldn't. |
llvm/docs/LoopTerminology.rst | ||
---|---|---|
123–124 | I'd expect that tree concepts (node, root, leaf, child, parent, sibling, ancestor, descendent, ...) are known by a majority of programmers, but you should go for what you think is needed for someone who does not know terminology already (i.e. not me). I will look for that it's correct and understandable. |
llvm/docs/LoopTerminology.rst | ||
---|---|---|
123–124 | Ok great! I think just a small note that loops form a forest of trees (or smth like that) is good. It's mentioned in LoopInfo.h but from the terminology it's not obvious so I think it's beneficial to a newcomer. |
[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 forest is enough information.