[llvm] r226030 - Add comment about a gotcha I ran across while touching this code.

David Blaikie dblaikie at gmail.com
Wed Jan 14 11:59:18 PST 2015


Author: dblaikie
Date: Wed Jan 14 13:59:18 2015
New Revision: 226030

URL: http://llvm.org/viewvc/llvm-project?rev=226030&view=rev
Log:
Add comment about a gotcha I ran across while touching this code.

I haven't looked closely at exactly why the side effect is required, but
this seems better than not mentioning it at all.

Modified:
    llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h

Modified: llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h?rev=226030&r1=226029&r2=226030&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h (original)
+++ llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h Wed Jan 14 13:59:18 2015
@@ -260,6 +260,7 @@ void Calculate(DominatorTreeBase<typenam
   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?
 





More information about the llvm-commits mailing list