[PATCH] D80029: Fix quadratic LexicalScopes::constructScopeNest(...), NFC
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 19 12:03:00 PDT 2020
dblaikie added inline comments.
================
Comment at: llvm/lib/CodeGen/LexicalScopes.cpp:245
+ auto &ChildScope = Children[i];
+ // Because of tree structure, !ChildScope->getDFSIn().
+ WorkStack.push_back(std::make_pair(ChildScope, 0));
----------------
jmorse wrote:
> IMO this comment isn't necessary, because it's describing the relationship between the new code and old code, which is best put in a commit message. After this lands, the DFSIn / DFSOut values of an unvisited scope shouldn't be something a reader would consider at all.
>
> That being said, would you be able to add a comment about the overall purpose of the function somewhere, i.e. "Visit each scope in depth-first order, with the current exploration state kept as a tree in WorkStack", or similar.
+1
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80029/new/
https://reviews.llvm.org/D80029
More information about the llvm-commits
mailing list