OSDN Git Service

[Dominators] Update DominatorTree compare in case roots are different
authorDavid Green <david.green@arm.com>
Mon, 19 Feb 2018 16:28:24 +0000 (16:28 +0000)
committerDavid Green <david.green@arm.com>
Mon, 19 Feb 2018 16:28:24 +0000 (16:28 +0000)
The compare function, unusually, returns false on same, true on
different. This fixes the conditions for different roots.

Reviewed as a part of D41298.

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

include/llvm/Support/GenericDomTree.h

index 84a935f..bcaac6b 100644 (file)
@@ -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())