From: David Blaikie Date: Wed, 14 Jan 2015 19:59:18 +0000 (+0000) Subject: Add comment about a gotcha I ran across while touching this code. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4ade012dd08c80ef14e899de4455d16df5fa732d;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226030 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/GenericDomTreeConstruction.h b/include/llvm/Support/GenericDomTreeConstruction.h index 61fc72de443..7c065f93925 100644 --- a/include/llvm/Support/GenericDomTreeConstruction.h +++ b/include/llvm/Support/GenericDomTreeConstruction.h @@ -260,6 +260,7 @@ void Calculate(DominatorTreeBase::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?