From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- include/llvm/CodeGen/MachineDominators.h | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'include/llvm/CodeGen/MachineDominators.h') diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h index 21ecef587aa5..30b6cfdd1c36 100644 --- a/include/llvm/CodeGen/MachineDominators.h +++ b/include/llvm/CodeGen/MachineDominators.h @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/GenericDomTree.h" #include "llvm/Support/GenericDomTreeConstruction.h" +#include namespace llvm { @@ -60,7 +61,7 @@ class MachineDominatorTree : public MachineFunctionPass { mutable SmallSet NewBBs; /// The DominatorTreeBase that is used to compute a normal dominator tree - DominatorTreeBase* DT; + std::unique_ptr> DT; /// \brief Apply all the recorded critical edges to the DT. /// This updates the underlying DT information in a way that uses @@ -74,9 +75,9 @@ public: MachineDominatorTree(); - ~MachineDominatorTree() override; - DominatorTreeBase &getBase() { + if (!DT) + DT.reset(new DominatorTreeBase(false)); applySplitCriticalEdges(); return *DT; } @@ -244,21 +245,6 @@ public: CriticalEdgesToSplit.push_back({FromBB, ToBB, NewBB}); } - /// \brief Returns *false* if the other dominator tree matches this dominator - /// tree. - inline bool compare(const MachineDominatorTree &Other) const { - const MachineDomTreeNode *R = getRootNode(); - const MachineDomTreeNode *OtherR = Other.getRootNode(); - - if (!R || !OtherR || R->getBlock() != OtherR->getBlock()) - return true; - - if (DT->compare(*Other.DT)) - return true; - - return false; - } - /// \brief Verify the correctness of the domtree by re-computing it. /// /// This should only be used for debugging as it aborts the program if the -- cgit v1.2.3