Add comment about a gotcha I ran across while touching this code.
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 14 Jan 2015 19:59:18 +0000 (19:59 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 14 Jan 2015 19:59:18 +0000 (19:59 +0000)
I haven't looked closely at exactly why the side effect is required, but
this seems better than not mentioning it at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226030 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/GenericDomTreeConstruction.h

index 61fc72de4434453bd7bacc4982d936c58b17a3c9..7c065f939256bf8fbf5aff51517a062d891db069 100644 (file)
@@ -260,6 +260,7 @@ void Calculate(DominatorTreeBase<typename GraphTraits<NodeT>::NodeType>& DT,
   for (unsigned i = 2; i <= N; ++i) {
     typename GraphT::NodeType* W = DT.Vertex[i];
 
+    // Don't replace this with 'count', the insertion side effect is important
     if (DT.DomTreeNodes[W])
       continue; // Haven't calculated this node yet?