[llvm] r325517 - [Dominators] Update DominatorTree compare in case roots are different

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 08:28:24 PST 2018


Author: dmgreen
Date: Mon Feb 19 08:28:24 2018
New Revision: 325517

URL: http://llvm.org/viewvc/llvm-project?rev=325517&view=rev
Log:
[Dominators] Update DominatorTree compare in case roots are different

The compare function, unusually, returns false on same, true on
different. This fixes the conditions for different roots.

Reviewed as a part of D41298.


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

Modified: llvm/trunk/include/llvm/Support/GenericDomTree.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GenericDomTree.h?rev=325517&r1=325516&r2=325517&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTree.h (original)
+++ llvm/trunk/include/llvm/Support/GenericDomTree.h Mon Feb 19 08:28:24 2018
@@ -319,10 +319,10 @@ protected:
     if (Parent != Other.Parent) return true;
 
     if (Roots.size() != Other.Roots.size())
-      return false;
+      return true;
 
     if (!std::is_permutation(Roots.begin(), Roots.end(), Other.Roots.begin()))
-      return false;
+      return true;
 
     const DomTreeNodeMapType &OtherDomTreeNodes = Other.DomTreeNodes;
     if (DomTreeNodes.size() != OtherDomTreeNodes.size())




More information about the llvm-commits mailing list